[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
|
---|
[287ea55] | 6 |
|
---|
| 7 | lfs:
|
---|
[868b5fc] | 8 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
[529e4e5] | 9 | -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/ \
|
---|
| 10 | stylesheets/lfs-chunked.xsl index.xml
|
---|
[094b6b4] | 11 |
|
---|
| 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" \
|
---|
[3001a42] | 23 | *.html
|
---|
[094b6b4] | 24 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
[3001a42] | 25 | *.html
|
---|
[287ea55] | 26 |
|
---|
[3a78860e] | 27 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
[9d3e271] | 28 | tidy -config tidy.conf $$filename; \
|
---|
[3a78860e] | 29 | true; \
|
---|
| 30 | done;
|
---|
[094b6b4] | 31 |
|
---|
[eb016f3b] | 32 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 33 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 34 | done;
|
---|
| 35 |
|
---|
[094b6b4] | 36 | #
|
---|
| 37 | # This is the old "pdf" target. The old "print" target below has been
|
---|
| 38 | # renamed to "pdf" and will be used. This commented out previous_pdf
|
---|
| 39 | # target can be removed eventually. It'll remain here for a bit for
|
---|
| 40 | # historical reasons
|
---|
| 41 | #
|
---|
| 42 | #previous_pdf:
|
---|
| 43 | # xsltproc --xinclude --nonet --output $(BASEDIR)/lfs.fo stylesheets/lfs-pdf.xsl \
|
---|
| 44 | # index.xml
|
---|
| 45 | # sed -i -e "s/inherit/all/" $(BASEDIR)/lfs.fo
|
---|
| 46 | # fop.sh $(BASEDIR)/lfs.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 47 | # rm lfs.fo
|
---|
[287ea55] | 48 |
|
---|
[3e46693] | 49 | pdf:
|
---|
[868b5fc] | 50 | xsltproc --xinclude --nonet --stringparam profile.condition pdf \
|
---|
[094b6b4] | 51 | --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 52 | xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
| 53 | $(BASEDIR)/lfs-pdf.xml
|
---|
| 54 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
| 55 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
| 56 | rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
[91364a5] | 57 |
|
---|
| 58 | nochunks:
|
---|
[09a4b2f] | 59 | xsltproc --xinclude --nonet -stringparam profile.condition html \
|
---|
[529e4e5] | 60 | --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
|
---|
| 61 | stylesheets/lfs-nochunks.xsl index.xml
|
---|
[09a4b2f] | 62 |
|
---|
[9d3e271] | 63 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[91364a5] | 64 |
|
---|
[09a4b2f] | 65 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
| 66 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 67 |
|
---|
[287ea55] | 68 | validate:
|
---|
| 69 | xmllint --noout --nonet --xinclude --postvalid index.xml
|
---|
[3e46693] | 70 |
|
---|