2006-04-11 21:52:54 +00:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2006-06-05 16:39:29 +00:00
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002-2006 Novell/SUSE
|
2006-04-11 21:52:54 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
2006-06-05 16:39:29 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, contact Novell, Inc.
|
|
|
|
#
|
2006-04-11 21:52:54 +00:00
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
2006-06-05 16:39:29 +00:00
|
|
|
# Makefile for LSM-based AppArmor SuSE profiles
|
2006-04-11 21:52:54 +00:00
|
|
|
|
|
|
|
NAME=apparmor-profiles
|
|
|
|
ALL:
|
2006-04-12 20:35:41 +00:00
|
|
|
COMMONDIR=../common/
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2006-11-04 21:34:47 +00:00
|
|
|
include common/Make.rules
|
2006-04-11 21:52:54 +00:00
|
|
|
|
|
|
|
COMMONDIR_EXISTS=$(strip $(shell [ -d ${COMMONDIR} ] && echo true))
|
|
|
|
ifeq ($(COMMONDIR_EXISTS), true)
|
2006-11-04 21:34:47 +00:00
|
|
|
common/Make.rules: $(COMMONDIR)/Make.rules
|
|
|
|
ln -sf $(COMMONDIR) .
|
2006-04-11 21:52:54 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
DESTDIR=/
|
|
|
|
EXTRASDIR=${DESTDIR}/usr/src/immunix/SubDomain/profiles/extras
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install:
|
|
|
|
install -d ${DESTDIR}/etc/apparmor.d
|
|
|
|
install -m 644 enabled/* ${DESTDIR}/etc/apparmor.d
|
|
|
|
install -d ${EXTRASDIR}
|
|
|
|
install -m 644 extras/* ${EXTRASDIR}
|
|
|
|
install -m 755 -d ${DESTDIR}/etc/apparmor.d/abstractions \
|
|
|
|
${DESTDIR}/etc/apparmor.d/program-chunks \
|
|
|
|
${DESTDIR}/etc/apparmor.d/tunables
|
|
|
|
install -m 644 abstractions/* ${DESTDIR}/etc/apparmor.d/abstractions
|
|
|
|
install -m 644 program-chunks/* ${DESTDIR}/etc/apparmor.d/program-chunks
|
|
|
|
install -m 644 tunables/* ${DESTDIR}/etc/apparmor.d/tunables
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2006-11-04 21:34:47 +00:00
|
|
|
-rm -f $(NAME)-$(VERSION)*.tar.gz Make.rules
|
2006-06-05 16:39:29 +00:00
|
|
|
|
|
|
|
ifndef VERBOSE
|
|
|
|
Q=@
|
|
|
|
else
|
|
|
|
Q=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef PARSER
|
|
|
|
# use system parser
|
|
|
|
PARSER=/sbin/apparmor_parser
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef LOGPROF
|
|
|
|
# use system logprof
|
|
|
|
LOGPROF=/usr/sbin/aa-logprof
|
|
|
|
endif
|
|
|
|
|
|
|
|
ENABLED_PATH=./enabled
|
|
|
|
EXTRAS_PATH=./extras
|
|
|
|
IGNORE_FILES=${EXTRAS_PATH}/README
|
|
|
|
CHECK_PROFILES=$(filter-out ${IGNORE_FILES}, $(wildcard ${ENABLED_PATH}/*) $(wildcard ${EXTRAS_PATH}/*))
|
|
|
|
CHECK_INCLUDES=${PWD}
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
@echo "*** Checking profiles against apparmor_parser"
|
|
|
|
$(Q)for profile in ${CHECK_PROFILES} ; do \
|
|
|
|
${PARSER} -S -b ${CHECK_INCLUDES} $${profile} > /dev/null ; \
|
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: check-install
|
|
|
|
check-install:
|
|
|
|
$(Q)make check ENABLED_PATH=${DESTDIR}/etc/apparmor.d EXTRAS_PATH=${EXTRASDIR} CHECK_INCLUDES=${DESTDIR}/etc/apparmor.d
|
|
|
|
@echo "*** Checking profiles against logprof"
|
|
|
|
$(Q)${LOGPROF} -d ${DESTDIR}/etc/apparmor.d -f /dev/null
|