[094b6b4] | 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
|
---|
[8b869d1] | 6 | TIDY=/home/manuel/bin/lfs-tidy
|
---|
[287ea55] | 7 |
|
---|
| 8 | lfs:
|
---|
[868b5fc] | 9 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
| 10 | --output $(BASEDIR)/lfs-html.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 11 |
|
---|
| 12 | xsltproc --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
|
---|
[094b6b4] | 13 | -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
|
---|
[868b5fc] | 14 | $(BASEDIR)/lfs-html.xml
|
---|
[094b6b4] | 15 |
|
---|
| 16 | if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
---|
| 17 | mkdir -p $(BASEDIR)/stylesheets; \
|
---|
| 18 | fi;
|
---|
| 19 | cp stylesheets/*.css $(BASEDIR)/stylesheets
|
---|
| 20 |
|
---|
| 21 | if [ ! -e $(BASEDIR)/images ]; then \
|
---|
| 22 | mkdir -p $(BASEDIR)/images; \
|
---|
| 23 | fi;
|
---|
| 24 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 25 | $(BASEDIR)/images
|
---|
| 26 | cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
[3001a42] | 27 | *.html
|
---|
[094b6b4] | 28 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
[3001a42] | 29 | *.html
|
---|
[287ea55] | 30 |
|
---|
[868b5fc] | 31 | rm $(BASEDIR)/lfs-html.xml
|
---|
| 32 |
|
---|
[8b869d1] | 33 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 34 | $(TIDY) -config tidy.conf $$filename; \
|
---|
| 35 | true; \
|
---|
| 36 | done;
|
---|
[094b6b4] | 37 |
|
---|
[eb016f3b] | 38 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 39 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 40 | done;
|
---|
| 41 |
|
---|
[094b6b4] | 42 | #
|
---|
| 43 | # This is the old "pdf" target. The old "print" target below has been
|
---|
| 44 | # renamed to "pdf" and will be used. This commented out previous_pdf
|
---|
| 45 | # target can be removed eventually. It'll remain here for a bit for
|
---|
| 46 | # historical reasons
|
---|
| 47 | #
|
---|
| 48 | #previous_pdf:
|
---|
| 49 | # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
|
---|
| 50 | # index.xml
|
---|
| 51 | # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
|
---|
| 52 | # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 53 | # rm lfs.fo
|
---|
[287ea55] | 54 |
|
---|
[3e46693] | 55 | pdf:
|
---|
[868b5fc] | 56 | xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
---|
[094b6b4] | 57 | --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 58 | xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
| 59 | $(BASEDIR)/lfs-pdf.xml
|
---|
| 60 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
| 61 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 62 | rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
[91364a5] | 63 |
|
---|
| 64 | nochunks:
|
---|
[56d1170] | 65 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
| 66 | --output $(BASEDIR)/lfs-nochunk.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 67 |
|
---|
| 68 | xsltproc --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
| 69 | stylesheets/lfs-nochunks.xsl $(BASEDIR)/lfs-nochunk.xml
|
---|
| 70 |
|
---|
| 71 | rm $(BASEDIR)/lfs-nochunk.xml
|
---|
| 72 |
|
---|
[8b869d1] | 73 | $(TIDY) -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[91364a5] | 74 |
|
---|
[56d1170] | 75 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
| 76 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 77 |
|
---|
[287ea55] | 78 | validate:
|
---|
| 79 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
[3e46693] | 80 |
|
---|