summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2017-01-09 05:22:59 +0100
committerRuss Allbery <rra@debian.org>2017-04-30 13:16:07 -0700
commitf8e1d95b51efb724ce1bfee8ffa77222b287c19d (patch)
tree5a3e5f5bfb5389a921505b5fe8a9cd47a6047870 /Makefile
parentd484761ecaab9e3b2c544fa533415d9d39e6e6ff (diff)
Update build system for DocBook conversion
Switch to use xsltproc and dblatex for the converted sources. Stop using tidy(1) because it produces bigger files, and the output generated by xsltproc is pretty clean and compliant already. Remove all build dependencies not used at all or not used directly by our build system, even if they end up being pulled anyway by our direct dependencies.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile45
1 files changed, 28 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 288c4ae..2df0ac0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,13 @@
include debian/rules
-policy.sgml: version.ent
-menu-policy.sgml: version.ent
-perl-policy.sgml: version.ent
+policy.xml: version.xml
+menu-policy.xml: version.xml
+perl-policy.xml: version.xml
+upgrading-checklist.xml: version.xml
+
+XSLTPROC = xsltproc --nonet --xinclude
+XMLLINT = xmllint --nonet --noout --postvalid --xinclude
+DBLATEX = dblatex -p xsl/dblatex.xsl
$(MDWN_FILES:=.txt): %.txt: %.md
cat $^ > $@
@@ -11,34 +16,40 @@ $(MDWN_FILES:=.txt): %.txt: %.md
$(MDWN_FILES:=.html): %.html: %.md
$(MDWN) $< > $@
+upgrading-checklist-1.html \
+upgrading-checklist.html/index.html: XSLPARAMS = --stringparam generate.toc ''
+
%.validate: %
- onsgmls -wall -gues $<
+ $(XMLLINT) $<
-%.html/index.html: %.sgml
- LANG=C debiandoc2html $<
+%.html/index.html: %.xml xsl/html-chunk.xsl
+ mkdir -p $(@D)
+ $(XSLTPROC) $(XSLPARAMS) \
+ --stringparam base.dir $(@D)/ \
+ xsl/html-chunk.xsl $<
-%-1.html: %.sgml
- LANG=C debiandoc2html -1 -b $*-1d $< && \
- mv $*-1d.html/index.html $*-1.html && \
- rmdir $*-1d.html
+%-1.html: %.xml xsl/html-single.xsl
+ $(XSLTPROC) $(XSLPARAMS) xsl/html-single.xsl $< > $@
%.html.tar.gz: %.html/index.html
GZIP=-n9 tar -czf $(<:/index.html=.tar.gz) $(<:/index.html=)
-$(SGML_FILES:=.txt): %.txt: %.sgml
- LANG=C debiandoc2text $<
+$(XML_FILES:=.txt): %.txt: %.xml
+ $(XSLTPROC) $(XSLPARAMS) xsl/text.xsl $< > $@.html
+ links -dump $@.html | perl -pe 's/[\r\0]//g' > $@
+ rm -f $@.html
%.txt.gz: %.txt
gzip -ncf9 $< > $@
-%.ps: %.sgml
- LANG=C debiandoc2latexps $<
+%.ps: %.xml
+ $(DBLATEX) --ps $<
%.ps.gz: %.ps
gzip -ncf9 $< > $@
-%.pdf: %.sgml
- LANG=C debiandoc2latexpdf $<
+%.pdf: %.xml
+ $(DBLATEX) --pdf $<
%.pdf.gz: %.pdf
gzip -ncf9 $< > $@
@@ -70,7 +81,7 @@ distclean:
rm -f $(filter-out $(leavealone),$(wildcard *.txt *.txt.gz *.html.tar.gz *.pdf *.ps))
rm -f *.lout* lout.li *.sasp* *.tex *.aux *.toc *.idx *.log *.out *.dvi *.tpt
rm -f `find . -name "*~" -o -name "*.bak" -o -name ".#*" -o -name core`
- rm -f version.ent
+ rm -f version.xml
rm -f *.rej *.orig
# if a rule bombs out, delete the target