|
Packit |
e8bc57 |
# Tell BSD make(1) to not remake the .1in and .htmlin files.
|
|
Packit |
e8bc57 |
SUFFIXES= .1 .1in .htmlin .html
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# requires:
|
|
Packit |
e8bc57 |
# xmllint (libxml2)
|
|
Packit |
e8bc57 |
# xmlto (cyberelk.net)
|
|
Packit |
e8bc57 |
# nsgmls (opensp)
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# what to build
|
|
Packit |
e8bc57 |
man_MANS = bogofilter.1 bogoutil.1 bogoupgrade.1 bogolexer.1 bogotune.1 \
|
|
Packit |
e8bc57 |
bf_copy.1 bf_tar.1 bf_compact.1
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
html_MANS = bogofilter.html bogoutil.html bogoupgrade.html \
|
|
Packit |
e8bc57 |
bogolexer.html bogotune.html \
|
|
Packit |
e8bc57 |
bf_copy.html bf_tar.html bf_compact.html
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
all: $(man_MANS) $(html_MANS)
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
CLEANFILES = $(man_MANS) $(html_MANS)
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
HTML_DOCS = bogofilter-faq.html bogofilter-faq-fr.html bogofilter-faq-it.html bogotune-faq.html
|
|
Packit |
e8bc57 |
XHTML_DOCS= bogofilter-faq-bg.xhtml
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# what to distribute
|
|
Packit |
e8bc57 |
EXTRA_DIST = \
|
|
Packit |
e8bc57 |
bogofilter.xml bogofilter.1in bogofilter.htmlin \
|
|
Packit |
e8bc57 |
bogolexer.xml bogolexer.1in bogolexer.htmlin \
|
|
Packit |
e8bc57 |
bogotune.xml bogotune.1in bogotune.htmlin \
|
|
Packit |
e8bc57 |
bogoupgrade.xml bogoupgrade.1in bogoupgrade.htmlin \
|
|
Packit |
e8bc57 |
bogoutil.xml bogoutil.1in bogoutil.htmlin \
|
|
Packit |
e8bc57 |
bf_compact.xml bf_compact.1in bf_compact.htmlin \
|
|
Packit |
e8bc57 |
bf_copy.xml bf_copy.1in bf_copy.htmlin \
|
|
Packit |
e8bc57 |
bf_tar.xml bf_tar.1in bf_tar.htmlin \
|
|
Packit |
e8bc57 |
$(HTML_DOCS) \
|
|
Packit |
e8bc57 |
$(XHTML_DOCS) \
|
|
Packit |
e8bc57 |
bogofilter-tuning.HOWTO.html \
|
|
Packit |
e8bc57 |
bogofilter-SA-2002-01 bogofilter-SA-2004-01 \
|
|
Packit |
e8bc57 |
bogofilter-SA-2005-01 bogofilter-SA-2005-02 \
|
|
Packit |
e8bc57 |
bogofilter-SA-2010-01 \
|
|
Packit |
e8bc57 |
bogofilter-SA-2012-01 \
|
|
Packit |
e8bc57 |
integrating-with-postfix \
|
|
Packit |
e8bc57 |
integrating-with-qmail \
|
|
Packit |
e8bc57 |
programmer/OS2/configure.os2 \
|
|
Packit |
e8bc57 |
programmer/README.freebsd programmer/README.hp-ux \
|
|
Packit |
e8bc57 |
programmer/README.RISC-OS programmer/README.memory-checking \
|
|
Packit |
e8bc57 |
programmer/README.osx \
|
|
Packit |
e8bc57 |
programmer/RISC-OS/src/Makefile \
|
|
Packit |
e8bc57 |
programmer/RISC-OS/gsl/Makefile \
|
|
Packit |
e8bc57 |
README.db README.sqlite \
|
|
Packit |
e8bc57 |
README.validation
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# bogofilter.cf.example
|
|
Packit |
e8bc57 |
# strlcat.3 strlcpy.3
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
.1in.1:
|
|
Packit |
e8bc57 |
sed -e "s|[@]sysconfdir@|$(sysconfdir)|g" \
|
|
Packit |
e8bc57 |
-e "s|[@]bindir@|$(bindir)|g" <$< >$@ \
|
|
Packit |
e8bc57 |
|| { rm -f $@ ; exit 1 ; }
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# same as .1in.1: above, but POSIX doesn't allow two targets on one line.
|
|
Packit |
e8bc57 |
.htmlin.html:
|
|
Packit |
e8bc57 |
sed -e "s|[@]sysconfdir@|$(sysconfdir)|g" \
|
|
Packit |
e8bc57 |
-e "s|[@]bindir@|$(bindir)|g" <$< >$@ \
|
|
Packit |
e8bc57 |
|| { rm -f $@ ; exit 1 ; }
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
if ENABLE_XMLTO
|
|
Packit |
e8bc57 |
dist-hook:
|
|
Packit |
e8bc57 |
@if [ ! -f catalog ] ; then \
|
|
Packit |
e8bc57 |
echo ; echo "Warning: 'catalog' file not present; see 'README.validation'". ; echo ; else \
|
|
Packit |
e8bc57 |
case "$(MFLAGS)" in *s*) : ;; *) echo >&2 "validating $(HTML_DOCS)" ;; esac ; \
|
|
Packit |
e8bc57 |
( set -e ; for i in $(HTML_DOCS) ; do $(NSGMLS) -s $(srcdir)/$$i \
|
|
Packit |
e8bc57 |
|| { echo >&2 "ERROR: $$i does not validate." ; exit 1 ; } ; done ) ; \
|
|
Packit |
e8bc57 |
fi
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
# Use Perl to fix up br0ken 0xa0 characters that the XML DocBook style
|
|
Packit |
e8bc57 |
# sheets emit instead of "\ " for roff or " " for HTML,
|
|
Packit |
e8bc57 |
# respectively.
|
|
Packit |
e8bc57 |
.xml.htmlin:
|
|
Packit |
e8bc57 |
$(XMLLINT) --noout --postvalid $<
|
|
Packit |
e8bc57 |
if test -f $(srcdir)/$@ && test $(srcdir)/$@ -nt $< ; then \
|
|
Packit |
e8bc57 |
cp $(srcdir)/$@ . ; else \
|
|
Packit |
e8bc57 |
if xmlto html-nochunks $< ; then f=$@ ; mv $${f%%in} $@ ; else rm -f $@ ; exit 1 ; fi ; \
|
|
Packit |
e8bc57 |
perl -pl -e "s|\xA0| |g" -i $@ || { rm -f $@ ; exit 1 ; } \
|
|
Packit |
e8bc57 |
fi
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
.xml.1in:
|
|
Packit |
e8bc57 |
$(XMLLINT) --noout --postvalid $<
|
|
Packit |
e8bc57 |
if test -f $(srcdir)/$@ && test $(srcdir)/$@ -nt $< ; then \
|
|
Packit |
e8bc57 |
cp $(srcdir)/$@ . ; else \
|
|
Packit |
e8bc57 |
if xmlto man $< ; then f=$@ ; mv $${f%in} $@ ; else rm -f $@ ; exit 1 ; fi ; \
|
|
Packit |
e8bc57 |
perl -pl -e "s|\xA0|\\ |g" -i $@ || { rm -f $@ ; exit 1 ; } \
|
|
Packit |
e8bc57 |
fi
|
|
Packit |
e8bc57 |
else
|
|
Packit |
e8bc57 |
dist-hook:
|
|
Packit |
e8bc57 |
true
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
.xml.1in:
|
|
Packit |
e8bc57 |
@echo 1>&2
|
|
Packit |
e8bc57 |
@echo 1>&2 "You need xmlto to build bogofilter documentation."
|
|
Packit |
e8bc57 |
@echo 1>&2
|
|
Packit |
e8bc57 |
@exit 1
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
.xml.htmlin:
|
|
Packit |
e8bc57 |
@echo 1>&2
|
|
Packit |
e8bc57 |
@echo 1>&2 "You need xmlto to build bogofilter documentation."
|
|
Packit |
e8bc57 |
@echo 1>&2
|
|
Packit |
e8bc57 |
@exit 1
|
|
Packit |
e8bc57 |
endif
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
.PHONY: check checkx
|
|
Packit |
e8bc57 |
checkx:
|
|
Packit |
e8bc57 |
@if echo ' <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <head><title /> </head><body /> </html>' | $(XMLLINT) --noout --nonet --postvalid - 2>/dev/null ; then \
|
|
Packit |
e8bc57 |
set +e ; fail=0 ; for i in $(XHTML_DOCS) ; do if $(XMLLINT) --noout --postvalid $(srcdir)/$$i ; then echo PASS: $$i ; else echo FAIL: $$i: ; fail=1 ; fi ; done ; \
|
|
Packit |
e8bc57 |
if test "$$fail" = 1 ; then echo >&2 "*** XHTML document invalid ***" ; false ; fi ; \
|
|
Packit |
e8bc57 |
else echo >&2 "*** Not validating XHTML, XHTML 1.1 DTD not or improperly installed ***" ; fi
|
|
Packit |
e8bc57 |
|
|
Packit |
e8bc57 |
check: checkx
|
|
Packit |
e8bc57 |
@if echo '<HTML><HEAD><TITLE></TITLE></HEAD><BODY></BODY></HTML>' | $(NSGMLS) -s 2>/dev/null; then \
|
|
Packit |
e8bc57 |
set +e ; fail=0 ; for i in $(HTML_DOCS) ; do if $(NSGMLS) -s $(srcdir)/$$i ; then echo PASS: $$i ; else echo FAIL: $$i: ; fail=1 ; fi ; done ; \
|
|
Packit |
e8bc57 |
else echo >&2 "*** Not validating HTML, nsgmls/HTML DTDs improperly installed ***" ; fi ; \
|
|
Packit |
e8bc57 |
if test "$$fail" = "1" ; then echo >&2 "*** HTML document invalid ***" ; false ; fi
|