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
|
|
|
|
|
2014-02-13 00:04:39 -08:00
|
|
|
PERLTOOLS = aa-exec aa-notify
|
|
|
|
PYTOOLS = aa-easyprof aa-genprof aa-logprof aa-cleanprof aa-mergeprof \
|
|
|
|
aa-autodep aa-audit aa-complain aa-enforce aa-disable \
|
|
|
|
aa-status aa-unconfined
|
|
|
|
TOOLS = ${PERLTOOLS} ${PYTOOLS} aa-decode
|
2012-05-07 22:37:48 -07:00
|
|
|
PYSETUP = python-tools-setup.py
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2014-02-13 00:04:39 -08: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
|
2012-03-22 13:26:20 -07:00
|
|
|
$(MAKE) -C vim 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
|
2012-05-07 22:37:48 -07:00
|
|
|
PYPREFIX=/usr
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2014-02-13 00:04:39 -08:00
|
|
|
po/${NAME}.pot: ${TOOLS}
|
|
|
|
$(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}
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po install DESTDIR=${DESTDIR} NAME=${NAME}
|
|
|
|
$(MAKE) install_manpages DESTDIR=${DESTDIR}
|
2012-03-22 13:27:29 -07:00
|
|
|
$(MAKE) -C vim install DESTDIR=${DESTDIR}
|
2010-11-04 13:36:38 -07:00
|
|
|
ln -sf aa-status.8 ${DESTDIR}/${MANDIR}/man8/apparmor_status.8
|
2012-06-11 17:56:21 +01:00
|
|
|
${PYTHON} ${PYSETUP} install --prefix=${PYPREFIX} --root=${DESTDIR} --version=${VERSION}
|
2010-02-12 10:14:11 -06:00
|
|
|
|
2006-04-11 21:52:54 +00:00
|
|
|
.PHONY: clean
|
2012-03-27 17:15:50 -07:00
|
|
|
ifndef VERBOSE
|
2007-04-03 20:12:16 +00:00
|
|
|
.SILENT: clean
|
2012-03-27 17:15:50 -07:00
|
|
|
endif
|
2007-04-03 20:12:16 +00:00
|
|
|
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
|
2012-03-22 13:26:20 -07:00
|
|
|
$(MAKE) -C vim clean
|
2012-05-07 22:37:48 -07:00
|
|
|
rm -rf staging/ build/
|
|
|
|
rm -f apparmor/*.pyc
|
2013-08-12 17:55:45 -07:00
|
|
|
rm -rf test/__pycache__/
|
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
|
2012-03-22 16:41:08 -05:00
|
|
|
check_severity_db: /usr/include/linux/capability.h severity.db
|
2012-03-22 13:23:19 -07:00
|
|
|
# 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
|
2012-05-07 22:37:48 -07:00
|
|
|
tmpfile=$$(mktemp --tmpdir aa-pyflakes-XXXXXX); \
|
|
|
|
for i in ${PYTOOLS} apparmor aa-status test/*.py; do \
|
|
|
|
echo Checking $$i; \
|
|
|
|
pyflakes $$i 2>&1 | grep -v "undefined name '_'" > $$tmpfile; \
|
|
|
|
test -s $$tmpfile && cat $$tmpfile && rm -f $$tmpfile && exit 1; \
|
|
|
|
done || true; \
|
|
|
|
rm -f $$tmpfile
|
2012-06-11 17:56:21 +01:00
|
|
|
$(foreach test, $(wildcard test/test-*.py), $(call pyalldo, $(test)))
|