2006-04-11 21:52:54 +00:00
|
|
|
# ----------------------------------------------------------------------
|
2010-02-12 10:14:11 -06:00
|
|
|
# Copyright (c) 1999, 2004-2009 NOVELL (All rights reserved)
|
2011-02-07 17:39:36 -06:00
|
|
|
# Copyright (c) 2010-2011 Canonical Ltd.
|
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.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
NAME = apparmor-utils
|
|
|
|
all:
|
2006-04-12 19:31:08 +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
|
|
|
|
|
2011-01-13 13:58:26 -08:00
|
|
|
MODDIR = Immunix
|
|
|
|
PERLTOOLS = aa-genprof aa-logprof aa-autodep aa-audit aa-complain aa-enforce \
|
2012-03-20 11:45:13 -07:00
|
|
|
aa-unconfined aa-notify aa-disable aa-exec
|
2011-05-27 15:08:50 -04:00
|
|
|
TOOLS = ${PERLTOOLS} aa-decode aa-status
|
2011-01-13 13:58:26 -08:00
|
|
|
MODULES = ${MODDIR}/AppArmor.pm ${MODDIR}/Repository.pm \
|
|
|
|
${MODDIR}/Config.pm ${MODDIR}/Severity.pm
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2010-11-03 17:03:52 -07:00
|
|
|
MANPAGES = ${TOOLS:=.8} logprof.conf.5
|
2007-04-03 19:13:35 +00:00
|
|
|
|
|
|
|
all: ${MANPAGES} ${HTMLMANPAGES}
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po all
|
2006-11-15 09:22:15 +00:00
|
|
|
|
2006-04-11 21:52:54 +00:00
|
|
|
# need some better way of determining this
|
|
|
|
DESTDIR=/
|
|
|
|
BINDIR=${DESTDIR}/usr/sbin
|
|
|
|
CONFDIR=${DESTDIR}/etc/apparmor
|
2011-09-15 20:17:58 +02:00
|
|
|
VENDOR_PERL=$(shell perl -e 'use Config; print $$Config{"vendorlib"};')
|
2011-02-08 10:39:44 -08:00
|
|
|
PERLDIR=${DESTDIR}${VENDOR_PERL}/${MODDIR}
|
2006-04-11 21:52:54 +00:00
|
|
|
|
|
|
|
po/${NAME}.pot: ${TOOLS}
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po ${NAME}.pot NAME=${NAME} SOURCES="${TOOLS} ${MODULES}"
|
2006-04-11 21:52:54 +00:00
|
|
|
|
|
|
|
.PHONY: install
|
2007-04-03 19:13:35 +00:00
|
|
|
install: ${MANPAGES} ${HTMLMANPAGES}
|
2006-04-11 21:52:54 +00:00
|
|
|
install -d ${CONFDIR}
|
2010-02-12 10:14:11 -06:00
|
|
|
install -m 644 logprof.conf severity.db notify.conf ${CONFDIR}
|
2006-04-11 21:52:54 +00:00
|
|
|
install -d ${BINDIR}
|
2010-11-04 11:52:33 -07:00
|
|
|
ln -sf aa-status ${BINDIR}/apparmor_status
|
2006-04-11 21:52:54 +00:00
|
|
|
install -m 755 ${TOOLS} ${BINDIR}
|
|
|
|
install -d ${PERLDIR}
|
2011-09-13 20:58:24 +02:00
|
|
|
install -m 644 ${MODULES} ${PERLDIR}
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po install DESTDIR=${DESTDIR} NAME=${NAME}
|
|
|
|
$(MAKE) install_manpages DESTDIR=${DESTDIR}
|
2010-11-04 13:36:38 -07:00
|
|
|
ln -sf aa-status.8 ${DESTDIR}/${MANDIR}/man8/apparmor_status.8
|
2010-02-12 10:14:11 -06:00
|
|
|
|
2006-04-11 21:52:54 +00:00
|
|
|
.PHONY: clean
|
2007-04-03 20:12:16 +00:00
|
|
|
.SILENT: clean
|
|
|
|
clean: _clean
|
2006-11-04 21:34:47 +00:00
|
|
|
rm -f core core.* *.o *.s *.a *~
|
2007-04-03 20:12:16 +00:00
|
|
|
rm -f Make.rules
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po clean
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2012-03-22 13:23:19 -07:00
|
|
|
# ${CAPABILITIES} is defined in common/Make.rules
|
|
|
|
.PHONY: check_severity_db
|
|
|
|
.SILENT: check_severity_db
|
|
|
|
check_severity_db: /usr/include/sys/capability.h severity.db
|
|
|
|
# The sed statement is based on the one in the parser's makefile
|
|
|
|
RC=0 ; for cap in ${CAPABILITIES} ; do \
|
|
|
|
if ! grep -q -w $${cap} severity.db ; then \
|
|
|
|
echo "Warning! capability $${cap} not found in severity.db" ; \
|
|
|
|
RC=1 ; \
|
|
|
|
fi ;\
|
|
|
|
done ; \
|
|
|
|
test "$$RC" -eq 0
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
.SILENT: check
|
|
|
|
check: check_severity_db
|
2011-01-13 13:58:26 -08:00
|
|
|
for i in ${MODULES} ${PERLTOOLS} ; do \
|
|
|
|
perl -c $$i || exit 1; \
|
|
|
|
done
|