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)
|
2016-12-10 10:25:31 -08:00
|
|
|
# Copyright (c) 2010-2016 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
|
|
|
|
2015-01-23 15:52:09 -08:00
|
|
|
include $(COMMONDIR)/Make.rules
|
2006-04-11 21:52:54 +00:00
|
|
|
|
2014-02-13 00:04:39 -08:00
|
|
|
PYTOOLS = aa-easyprof aa-genprof aa-logprof aa-cleanprof aa-mergeprof \
|
|
|
|
aa-autodep aa-audit aa-complain aa-enforce aa-disable \
|
2019-01-09 23:59:40 +01:00
|
|
|
aa-notify aa-status aa-unconfined
|
|
|
|
TOOLS = ${PYTOOLS} aa-decode aa-remove-unknown
|
2012-05-07 22:37:48 -07:00
|
|
|
PYSETUP = python-tools-setup.py
|
2015-11-18 21:28:53 +01:00
|
|
|
PYMODULES = $(wildcard apparmor/*.py apparmor/rule/*.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
|
|
|
|
2016-12-10 10:25:31 -08:00
|
|
|
all: docs
|
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
|
|
|
|
2016-12-10 10:25:31 -08:00
|
|
|
.PHONY: docs
|
|
|
|
docs: ${MANPAGES} ${HTMLMANPAGES}
|
|
|
|
|
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-11-17 12:32:30 -08:00
|
|
|
PYFLAKES=pyflakes
|
|
|
|
|
2014-09-10 11:13:59 -07:00
|
|
|
po/${NAME}.pot: ${TOOLS} ${PYMODULES}
|
|
|
|
$(MAKE) -C po ${NAME}.pot NAME=${NAME} SOURCES="${TOOLS} ${PYMODULES}"
|
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
|
2014-03-25 15:04:37 -07:00
|
|
|
# aa-easyprof is installed by python-tools-setup.py
|
|
|
|
install -m 755 $(filter-out aa-easyprof, ${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
|
2015-01-30 22:15:53 +01:00
|
|
|
clean: pod_clean
|
2006-11-04 21:34:47 +00:00
|
|
|
rm -f core core.* *.o *.s *.a *~
|
2011-11-10 09:27:29 -08:00
|
|
|
$(MAKE) -C po clean
|
2012-03-22 13:26:20 -07:00
|
|
|
$(MAKE) -C vim clean
|
2014-02-27 16:23:35 -08:00
|
|
|
$(MAKE) -C test clean
|
2012-05-07 22:37:48 -07:00
|
|
|
rm -rf staging/ build/
|
2015-05-11 21:57:55 +02:00
|
|
|
rm -f apparmor/*.pyc apparmor/rule/*.pyc
|
|
|
|
rm -rf apparmor/__pycache__/ apparmor/rule/__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
|
|
|
|
|
2014-09-15 11:30:47 -07:00
|
|
|
# check_pod_files is defined in common/Make.rules
|
2012-03-22 13:23:19 -07:00
|
|
|
.PHONY: check
|
|
|
|
.SILENT: check
|
2014-09-15 11:30:47 -07:00
|
|
|
check: check_severity_db check_pod_files
|
2014-02-13 11:01:29 -08:00
|
|
|
for i in ${PYTOOLS} apparmor test/*.py; do \
|
2012-05-07 22:37:48 -07:00
|
|
|
echo Checking $$i; \
|
2014-11-17 12:32:30 -08:00
|
|
|
$(PYFLAKES) $$i || exit 1; \
|
2014-11-14 02:21:23 +01:00
|
|
|
done
|
2014-02-27 16:23:35 -08:00
|
|
|
$(MAKE) -C test check
|
2014-02-27 16:25:00 -08:00
|
|
|
$(MAKE) -C vim check
|