From 9ef2941687faeb5fe7f4f584762bdb74bad25fa6 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Tue, 3 Apr 2007 18:51:56 +0000 Subject: [PATCH] Subject: Move make targets from docs/ to common/Make.rules This patch moves the make rules used to generate man pages and their html counterparts from the docs package to the common/ directory, so that all packages can make use of them. It also makes the immunix.css stylesheet available via the common/ dir, renaming it to apparmor.css. --- common/Make.rules | 69 +++++++++++++++++++++++++ docs/immunix.css => common/apparmor.css | 0 docs/Makefile | 37 ------------- docs/apparmor-docs.spec.in | 2 +- 4 files changed, 70 insertions(+), 38 deletions(-) rename docs/immunix.css => common/apparmor.css (100%) diff --git a/common/Make.rules b/common/Make.rules index b308255f7..dc1f86c22 100644 --- a/common/Make.rules +++ b/common/Make.rules @@ -165,6 +165,75 @@ build_dir: $(BUILDRPMSUBDIRS) $(BUILDRPMSUBDIRS): mkdir -p $(BUILDRPMSUBDIRS) +# ===================== +# manpages +# ===================== + +POD2MAN = /usr/bin/pod2man +POD2HTML = /usr/bin/pod2html +MANDIR = /usr/share/man +DOCDIR = /usr/share/doc/${NAME}-${VERSION} + +# get list of directory numbers based on definition of MANPAGES variable +MANDIRS=$(sort $(foreach dir, 1 2 3 4 5 6 7 8, $(patsubst %.${dir}, ${dir}, $(filter %.${dir}, ${MANPAGES})))) +HTMLMANPAGES=$(foreach manpage, ${MANPAGES}, ${manpage}.html) + +.PHONY: install_manpages +install_manpages: $(MANPAGES) + $(foreach dir, ${MANDIRS}, \ + install -d ${DESTDIR}/${MANDIR}/man${dir} ; \ + install -m 644 $(filter %.${dir}, ${MANPAGES}) ${DESTDIR}/${MANDIR}/man${dir}; \ + $(foreach aa_page, $(filter %.${dir}, ${AA_MANPAGES}), \ + ln -sf $(aa_page) ${DESTDIR}/${MANDIR}/man${dir}/${aa_page:%=aa-%};)) + +%.1: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=1 > $@ + +%.2: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=2 > $@ + +%.3: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=3 > $@ + +%.4: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=4 > $@ + +%.5: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=5 > $@ + +%.6: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=6 > $@ + +%.7: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=7 > $@ + +%.8: %.pod + $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=8 > $@ + +%.1.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.2.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.3.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.4.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.5.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.6.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.7.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + +%.8.html: %.pod + $(POD2HTML) --header --css apparmor.css --infile=$< --outfile=$@ + # ===================== # Slackware poo # ===================== diff --git a/docs/immunix.css b/common/apparmor.css similarity index 100% rename from docs/immunix.css rename to common/apparmor.css diff --git a/docs/Makefile b/docs/Makefile index d0aa11cf5..d198b71d5 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -33,11 +33,7 @@ common/Make.rules: ${COMMONDIR}/Make.rules ln -sf ${COMMONDIR} . endif -POD2MAN = /usr/bin/pod2man -POD2HTML = /usr/bin/pod2html RELEASE_DIR = ${NAME}-${VERSION} -MANDIRS = 2 5 7 8 -MANDIR = /usr/share/man DOCDIR = /usr/share/doc/${NAME}-${VERSION} AA_MANPAGES = autodep.8 complain.8 enforce.8 logprof.8 genprof.8 \ @@ -67,39 +63,6 @@ release: $(TARBALL) clean: -rm -f $(GENERATED) $(TARBALL) $(NAME)-$(VERSION)*.tar.gz Make.rules pod2*.tmp -# I'm pretty sure the following could be in a foreach loop, but I'm too -# lazy to code it up. - -%.1: %.pod - $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=1 > $@ - -%.2: %.pod - $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=2 > $@ - -%.5: %.pod - $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=5 > $@ - -%.7: %.pod - $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=7 > $@ - -%.8: %.pod - $(POD2MAN) $< --release=NOVELL/SUSE --center=AppArmor --section=8 > $@ - -%.1.html: %.pod - $(POD2HTML) --header --css immunix.css --infile=$< --outfile=$@ - -%.2.html: %.pod - $(POD2HTML) --header --css immunix.css --infile=$< --outfile=$@ - -%.5.html: %.pod - $(POD2HTML) --header --css immunix.css --infile=$< --outfile=$@ - -%.7.html: %.pod - $(POD2HTML) --header --css immunix.css --infile=$< --outfile=$@ - -%.8.html: %.pod - $(POD2HTML) --header --css immunix.css --infile=$< --outfile=$@ - .PHONY: install_manpages install_manpages: $(MANPAGES) for dir in ${MANDIRS} ; do install -d ${DESTDIR}/${MANDIR}/man$${dir} ; done diff --git a/docs/apparmor-docs.spec.in b/docs/apparmor-docs.spec.in index 4b8bc4c79..4e4e9650d 100644 --- a/docs/apparmor-docs.spec.in +++ b/docs/apparmor-docs.spec.in @@ -64,7 +64,7 @@ make install_manpages DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{_mandir}/man8/* # html versions of the manpages %doc *.[0-9].*html -%doc immunix.css +%doc common/apparmor.css %changelog * Tue Apr 11 2006 Steve Beattie