[44758be] | 1 | BASEDIR=~/lfs-book
|
---|
| 2 | CHUNK_QUIET=0
|
---|
| 3 | PDF_OUTPUT=LFS-BOOK.pdf
|
---|
| 4 | NOCHUNKS_OUTPUT=LFS-BOOK.html
|
---|
| 5 | XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
|
---|
[287ea55] | 6 |
|
---|
| 7 | lfs:
|
---|
[44758be] | 8 | xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
|
---|
| 9 | -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
|
---|
| 10 | index.xml
|
---|
[287ea55] | 11 |
|
---|
[44758be] | 12 | if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
---|
| 13 | mkdir -p $(BASEDIR)/stylesheets; \
|
---|
| 14 | fi;
|
---|
| 15 | cp stylesheets/*.css $(BASEDIR)/stylesheets
|
---|
| 16 |
|
---|
| 17 | if [ ! -e $(BASEDIR)/images ]; then \
|
---|
| 18 | mkdir -p $(BASEDIR)/images; \
|
---|
| 19 | fi;
|
---|
| 20 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 21 | $(BASEDIR)/images
|
---|
| 22 | cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
[287ea55] | 23 | index.html part1.html part2.html part3.html longindex.html
|
---|
[44758be] | 24 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
[287ea55] | 25 | index.html part1.html part2.html part3.html longindex.html
|
---|
| 26 |
|
---|
[44758be] | 27 | sh goTidy $(BASEDIR)/
|
---|
[91364a5] | 28 |
|
---|
[3879ebc] | 29 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 30 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 31 | done;
|
---|
[536b6aa] | 32 | #
|
---|
| 33 | # This is the old "pdf" target. The old "print" target below has been
|
---|
| 34 | # renamed to "pdf" and will be used. This commented out previous_pdf
|
---|
| 35 | # target can be removed eventually. It'll remain here for a bit for
|
---|
| 36 | # historical reasons
|
---|
| 37 | #
|
---|
| 38 | #previous_pdf:
|
---|
| 39 | # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
|
---|
| 40 | # index.xml
|
---|
| 41 | # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
|
---|
| 42 | # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 43 | # rm lfs.fo
|
---|
[287ea55] | 44 |
|
---|
[536b6aa] | 45 | pdf:
|
---|
| 46 | xsltproc --xinclude --nonet --stringparam profile.condition print \
|
---|
[8aa0f3a] | 47 | --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index-pdf.xml
|
---|
[a03b9453] | 48 | xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
| 49 | $(BASEDIR)/lfs-pdf.xml
|
---|
| 50 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
| 51 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 52 | rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
[91364a5] | 53 |
|
---|
| 54 | nochunks:
|
---|
[536b6aa] | 55 | xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
[91364a5] | 56 | stylesheets/lfs-nochunks.xsl index.xml
|
---|
[536b6aa] | 57 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[91364a5] | 58 |
|
---|
[287ea55] | 59 | validate:
|
---|
| 60 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
[536b6aa] | 61 |
|
---|