[092d9ef] | 1 | BASEDIR=~/lfs-book
|
---|
[094b6b4] | 2 | CHUNK_QUIET=0
|
---|
[092d9ef] | 3 | PDF_OUTPUT=LFS-BOOK.pdf
|
---|
| 4 | NOCHUNKS_OUTPUT=LFS-BOOK.html
|
---|
[094b6b4] | 5 | XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
|
---|
[092d9ef] | 6 | ARCH=x86
|
---|
[287ea55] | 7 |
|
---|
| 8 | lfs:
|
---|
[092d9ef] | 9 | # top-level index.html
|
---|
| 10 | xsltproc --nonet --output $(BASEDIR)/index.html stylesheets/top-index.xsl prologue/bookinfo.xml
|
---|
| 11 |
|
---|
| 12 | # x86
|
---|
| 13 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch x86 \
|
---|
[9288c84] | 14 | -stringparam base.dir $(BASEDIR)/x86/ stylesheets/lfs-chunked.xsl index.xml
|
---|
[092d9ef] | 15 |
|
---|
| 16 | if [ ! -e $(BASEDIR)/x86/stylesheets ]; then \
|
---|
| 17 | mkdir -p $(BASEDIR)/x86/stylesheets; \
|
---|
| 18 | fi;
|
---|
| 19 | cp stylesheets/*.css $(BASEDIR)/x86/stylesheets
|
---|
| 20 |
|
---|
| 21 | if [ ! -e $(BASEDIR)/x86/images ]; then \
|
---|
| 22 | mkdir -p $(BASEDIR)/x86/images; \
|
---|
| 23 | fi;
|
---|
| 24 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 25 | $(BASEDIR)/x86/images
|
---|
| 26 | cd $(BASEDIR)/x86/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
| 27 | *.html
|
---|
| 28 | cd $(BASEDIR)/x86/; sed -i -e "s@../images@images@g" \
|
---|
| 29 | *.html
|
---|
| 30 |
|
---|
[dd13e76] | 31 | # alpha
|
---|
| 32 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch alpha \
|
---|
| 33 | -stringparam base.dir $(BASEDIR)/alpha/ stylesheets/lfs-chunked.xsl index.xml
|
---|
[092d9ef] | 34 |
|
---|
[dd13e76] | 35 | if [ ! -e $(BASEDIR)/alpha/stylesheets ]; then \
|
---|
| 36 | mkdir -p $(BASEDIR)/alpha/stylesheets; \
|
---|
[092d9ef] | 37 | fi;
|
---|
[dd13e76] | 38 | cp stylesheets/*.css $(BASEDIR)/alpha/stylesheets
|
---|
[092d9ef] | 39 |
|
---|
[dd13e76] | 40 | if [ ! -e $(BASEDIR)/alpha/images ]; then \
|
---|
| 41 | mkdir -p $(BASEDIR)/alpha/images; \
|
---|
[092d9ef] | 42 | fi;
|
---|
| 43 | cp $(XSLROOTDIR)/images/*.png \
|
---|
[dd13e76] | 44 | $(BASEDIR)/alpha/images
|
---|
| 45 | cd $(BASEDIR)/alpha/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
[092d9ef] | 46 | *.html
|
---|
[dd13e76] | 47 | cd $(BASEDIR)/alpha/; sed -i -e "s@../images@images@g" \
|
---|
[092d9ef] | 48 | *.html
|
---|
| 49 |
|
---|
[da51ba8] | 50 | # ppc
|
---|
| 51 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch ppc \
|
---|
[9288c84] | 52 | -stringparam base.dir $(BASEDIR)/ppc/ stylesheets/lfs-chunked.xsl index.xml
|
---|
[da51ba8] | 53 |
|
---|
| 54 | if [ ! -e $(BASEDIR)/ppc/stylesheets ]; then \
|
---|
| 55 | mkdir -p $(BASEDIR)/ppc/stylesheets; \
|
---|
| 56 | fi;
|
---|
| 57 | cp stylesheets/*.css $(BASEDIR)/ppc/stylesheets
|
---|
| 58 |
|
---|
| 59 | if [ ! -e $(BASEDIR)/ppc/images ]; then \
|
---|
| 60 | mkdir -p $(BASEDIR)/ppc/images; \
|
---|
| 61 | fi;
|
---|
| 62 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 63 | $(BASEDIR)/ppc/images
|
---|
| 64 | cd $(BASEDIR)/ppc/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
| 65 | *.html
|
---|
| 66 | cd $(BASEDIR)/ppc/; sed -i -e "s@../images@images@g" \
|
---|
| 67 | *.html
|
---|
| 68 |
|
---|
[dd13e76] | 69 | # raq2
|
---|
| 70 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch raq2 \
|
---|
| 71 | -stringparam base.dir $(BASEDIR)/raq2/ stylesheets/lfs-chunked.xsl index.xml
|
---|
| 72 |
|
---|
| 73 | if [ ! -e $(BASEDIR)/raq2/stylesheets ]; then \
|
---|
| 74 | mkdir -p $(BASEDIR)/raq2/stylesheets; \
|
---|
| 75 | fi;
|
---|
| 76 | cp stylesheets/*.css $(BASEDIR)/raq2/stylesheets
|
---|
| 77 |
|
---|
| 78 | if [ ! -e $(BASEDIR)/raq2/images ]; then \
|
---|
| 79 | mkdir -p $(BASEDIR)/raq2/images; \
|
---|
| 80 | fi;
|
---|
| 81 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 82 | $(BASEDIR)/raq2/images
|
---|
| 83 | cd $(BASEDIR)/raq2/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
| 84 | *.html
|
---|
| 85 | cd $(BASEDIR)/raq2/; sed -i -e "s@../images@images@g" \
|
---|
| 86 | *.html
|
---|
[da51ba8] | 87 |
|
---|
[092d9ef] | 88 | # common stuff
|
---|
| 89 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 90 | tidy -config tidy.conf $$filename; \
|
---|
| 91 | true; \
|
---|
| 92 | done;
|
---|
| 93 |
|
---|
| 94 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 95 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 96 | done;
|
---|
| 97 |
|
---|
| 98 | html:
|
---|
[2b11d898] | 99 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch $(ARCH) \
|
---|
[9288c84] | 100 | -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl index.xml
|
---|
[094b6b4] | 101 |
|
---|
| 102 | if [ ! -e $(BASEDIR)/stylesheets ]; then \
|
---|
| 103 | mkdir -p $(BASEDIR)/stylesheets; \
|
---|
| 104 | fi;
|
---|
| 105 | cp stylesheets/*.css $(BASEDIR)/stylesheets
|
---|
| 106 |
|
---|
| 107 | if [ ! -e $(BASEDIR)/images ]; then \
|
---|
| 108 | mkdir -p $(BASEDIR)/images; \
|
---|
| 109 | fi;
|
---|
| 110 | cp $(XSLROOTDIR)/images/*.png \
|
---|
| 111 | $(BASEDIR)/images
|
---|
| 112 | cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
|
---|
[3001a42] | 113 | *.html
|
---|
[094b6b4] | 114 | cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
|
---|
[3001a42] | 115 | *.html
|
---|
[287ea55] | 116 |
|
---|
[3a78860e] | 117 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
[9d3e271] | 118 | tidy -config tidy.conf $$filename; \
|
---|
[3a78860e] | 119 | true; \
|
---|
| 120 | done;
|
---|
[094b6b4] | 121 |
|
---|
[eb016f3b] | 122 | for filename in `find $(BASEDIR) -name "*.html"`; do \
|
---|
| 123 | sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
|
---|
| 124 | done;
|
---|
| 125 |
|
---|
[3e46693] | 126 | pdf:
|
---|
[51f501a] | 127 | xsltproc --xinclude --nonet --stringparam profile.condition pdf -stringparam profile.arch $(ARCH) \
|
---|
[9288c84] | 128 | --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 129 |
|
---|
[094b6b4] | 130 | xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
|
---|
| 131 | $(BASEDIR)/lfs-pdf.xml
|
---|
[9288c84] | 132 |
|
---|
[094b6b4] | 133 | sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo
|
---|
[9288c84] | 134 |
|
---|
[094b6b4] | 135 | fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT)
|
---|
[9288c84] | 136 |
|
---|
[094b6b4] | 137 | rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
|
---|
[91364a5] | 138 |
|
---|
| 139 | nochunks:
|
---|
[51f501a] | 140 | xsltproc --xinclude --nonet -stringparam profile.condition html -stringparam profile.arch $(ARCH) \
|
---|
[9288c84] | 141 | --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) stylesheets/lfs-nochunks.xsl index.xml
|
---|
[09a4b2f] | 142 |
|
---|
[9d3e271] | 143 | tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
|
---|
[91364a5] | 144 |
|
---|
[09a4b2f] | 145 | sed -i -e "s@text/html@application/xhtml+xml@g" \
|
---|
| 146 | $(BASEDIR)/$(NOCHUNKS_OUTPUT)
|
---|
| 147 |
|
---|
[287ea55] | 148 | validate:
|
---|
[bcadcfe] | 149 | # x86
|
---|
[8ac05079] | 150 | xsltproc --xinclude --nonet -stringparam profile.arch x86 \
|
---|
[bcadcfe] | 151 | --output index-x86.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 152 | xmllint --noout --nonet --postvalid index-x86.xml
|
---|
| 153 |
|
---|
| 154 | # alpha
|
---|
[8ac05079] | 155 | xsltproc --xinclude --nonet -stringparam profile.arch alpha \
|
---|
[bcadcfe] | 156 | --output index-alpha.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 157 | xmllint --noout --nonet --postvalid index-alpha.xml
|
---|
| 158 |
|
---|
| 159 | # ppc
|
---|
[8ac05079] | 160 | xsltproc --xinclude --nonet -stringparam profile.arch ppc \
|
---|
[bcadcfe] | 161 | --output index-ppc.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 162 | xmllint --noout --nonet --postvalid index-ppc.xml
|
---|
| 163 |
|
---|
| 164 | # raq2
|
---|
[8ac05079] | 165 | xsltproc --xinclude --nonet -stringparam profile.arch raq2 \
|
---|
[bcadcfe] | 166 | --output index-raq2.xml stylesheets/lfs-profile.xsl index.xml
|
---|
| 167 | xmllint --noout --nonet --postvalid index-raq2.xml
|
---|
| 168 |
|
---|
| 169 | # clean-up
|
---|
| 170 | rm index-x86.xml index-alpha.xml index-ppc.xml index-raq2.xml
|
---|
[3e46693] | 171 |
|
---|