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.
This commit is contained in:
Steve Beattie 2007-04-03 18:51:56 +00:00
parent 41bd5154e6
commit 9ef2941687
4 changed files with 70 additions and 38 deletions

View file

@ -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
# =====================

View file

@ -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

View file

@ -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 <sbeattie@use.de>