mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00

This patch adds a 'check_pod_files' make target to the common make rules, and then fixes the errors it highlighted as well as most of the warnings. It will cause 'make check' in most of the directories to fail if there are errors in a pod file (but not if there are warnings). Common issues were: - using an '=over/=back' pair for code-like snippets that did not contain any =items therein; the =over keyword is intended for indenting lists of =item entries, and generates a warning if there isn't any. - not escaping '<' or '>' - blank lines that contained spaces or tabs The second -warnings flag passed to podchecker is to add additional warnings, un-escaped '<' and '>' being of them. I did not fix all of the warnings in apparmor.d.pod, as I have not come up with a good warning-free way to express the BNF of the language similar in format to what is currently generated. The existing libapparmor warnings (complaints about duplicate =item definition names) are actually a result of passing the second -warnings flag. The integration into libapparmor is suboptimal due to automake's expectation that there will be a test driver program(s) for make check targets; that's why I added the podchecker call to the manpage generation point. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: Seth Arnold <seth.arnold@canonical.com> --- changehat/mod_apparmor/Makefile | 3 changehat/mod_apparmor/mod_apparmor.pod | 28 ++- common/Make.rules | 4 libraries/libapparmor/doc/Makefile.am | 7 parser/Makefile | 2 parser/apparmor.d.pod | 275 +++++++++++++------------------- utils/Makefile | 3 utils/aa-cleanprof.pod | 2 utils/aa-complain.pod | 2 utils/aa-decode.pod | 2 utils/aa-easyprof.pod | 69 +++----- utils/aa-enforce.pod | 2 utils/aa-genprof.pod | 2 utils/aa-logprof.pod | 6 utils/aa-sandbox.pod | 64 ++----- utils/logprof.conf.pod | 2 utils/vim/Makefile | 2 17 files changed, 212 insertions(+), 263 deletions(-)
100 lines
3.8 KiB
Makefile
100 lines
3.8 KiB
Makefile
# ----------------------------------------------------------------------
|
|
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
|
|
#
|
|
# 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:=apache2-mod_apparmor
|
|
all:
|
|
COMMONDIR=../../common/
|
|
|
|
include common/Make.rules
|
|
|
|
COMMONDIR_EXISTS=$(strip $(shell [ -d ${COMMONDIR} ] && echo true))
|
|
ifeq ($(COMMONDIR_EXISTS), true)
|
|
common/Make.rules: $(COMMONDIR)/Make.rules
|
|
ln -sf $(COMMONDIR) .
|
|
endif
|
|
|
|
TARGET:=mod_apparmor.so
|
|
MANPAGES=mod_apparmor.8
|
|
|
|
APXS:=$(shell if [ -x "/usr/sbin/apxs2" ] ; then \
|
|
echo "/usr/sbin/apxs2" ; \
|
|
elif [ -x "/usr/sbin/apxs" ] ; then \
|
|
echo "/usr/sbin/apxs" ; \
|
|
elif [ -x "/usr/bin/apxs2" ] ; then \
|
|
echo "/usr/bin/apxs2" ; \
|
|
elif [ -x "/usr/bin/apxs" ] ; then \
|
|
echo "/usr/bin/apxs" ; \
|
|
else \
|
|
echo "apxs" ; \
|
|
fi )
|
|
APXS_INSTALL_DIR=$(shell ${APXS} -q LIBEXECDIR)
|
|
DESTDIR=
|
|
ifdef USE_SYSTEM
|
|
LIBAPPARMOR = $(shell if pkg-config --exists libapparmor ; then \
|
|
pkg-config --silence-errors --libs libapparmor ; \
|
|
elif ldconfig -p | grep -q libapparmor\.so$$ ; then \
|
|
echo -lapparmor ; \
|
|
fi )
|
|
ifeq ($(strip $(LIBAPPARMOR)),)
|
|
ERROR_MESSAGE = $(error ${nl}\
|
|
************************************************************************${nl}\
|
|
Unable to find libapparmor installed on this system; either${nl}\
|
|
install libapparmor devel packages, set the LIBAPPARMOR variable${nl}\
|
|
manually, or build against in-tree libapparmor.${nl}\
|
|
************************************************************************${nl})
|
|
endif # LIBAPPARMOR not set
|
|
LDLIBS += $(LIBAPPARMOR)
|
|
else
|
|
LIBAPPARMOR_SRC := ../../libraries/libapparmor/
|
|
LIBAPPARMOR_INCLUDE = $(LIBAPPARMOR_SRC)/include
|
|
LIBAPPARMOR_PATH := $(LIBAPPARMOR_SRC)/src/.libs/
|
|
ifeq ($(realpath $(LIBAPPARMOR_PATH)/libapparmor.a),)
|
|
ERROR_MESSAGE = $(error ${nl}\
|
|
************************************************************************${nl}\
|
|
$(LIBAPPARMOR_PATH)/libapparmor.a is missing; either build against${nl}\
|
|
the in-tree libapparmor by building it first and then trying again${nl}\
|
|
(see the top-level README for help) or build against the system${nl}\
|
|
libapparmor by adding USE_SYSTEM=1 to your make command.${nl}\
|
|
************************************************************************${nl})
|
|
endif
|
|
# Need to pass -Wl twice here to get past both apxs2 and libtool, as
|
|
# libtool will add the path to the RPATH of the library if passed -L/some/path
|
|
LIBAPPARMOR_FLAGS = -I$(LIBAPPARMOR_INCLUDE) -Wl,-Wl,-L$(LIBAPPARMOR_PATH)
|
|
LDLIBS = -lapparmor
|
|
endif
|
|
|
|
.PHONY: libapparmor_check
|
|
.SILENT: libapparmor_check
|
|
libapparmor_check: ; $(ERROR_MESSAGE)
|
|
|
|
all: libapparmor_check $(TARGET) ${MANPAGES} ${HTMLMANPAGES}
|
|
|
|
%.so: %.c
|
|
${APXS} ${LIBAPPARMOR_FLAGS} -c $< ${LDLIBS}
|
|
mv .libs/$@ .
|
|
|
|
.PHONY: install
|
|
install: ${TARGET} ${MANPAGES}
|
|
mkdir -p ${DESTDIR}/${APXS_INSTALL_DIR}
|
|
install -m 755 $< ${DESTDIR}/${APXS_INSTALL_DIR}
|
|
make install_manpages DESTDIR=${DESTDIR}
|
|
|
|
.PHONY: clean
|
|
clean: _clean
|
|
rm -rf .libs
|
|
rm -f *.la *.lo *.so *.o *.slo Make.rules
|
|
|
|
.PHONY: check
|
|
check: check_pod_files
|