Automatic merge of trunk into multilib

This commit is contained in:
Thomas Trepl 2024-01-31 20:22:48 +01:00
commit 8ccf082a21
8 changed files with 55 additions and 44 deletions

View File

@ -1,7 +1,4 @@
# vim:ts=3 # vim:ts=3
#BASEDIR = ~/lfs-book
#SYSDDIR = ~/lfs-systemd
#DUMPDIR = ~/lfs-commands
RENDERTMP = $(HOME)/tmp RENDERTMP = $(HOME)/tmp
CHUNK_QUIET = 1 CHUNK_QUIET = 1
ROOT_ID = ROOT_ID =
@ -24,15 +21,15 @@ ifneq ($(REV), sysv)
endif endif
ifeq ($(REV), sysv) ifeq ($(REV), sysv)
BASEDIR ?= ~/public_html/lfs-book BASEDIR ?= $(HOME)/public_html/lfs-book
PDF_OUTPUT ?= LFS-BOOK.pdf PDF_OUTPUT ?= LFS-BOOK.pdf
NOCHUNKS_OUTPUT ?= LFS-BOOK.html NOCHUNKS_OUTPUT ?= LFS-BOOK.html
DUMPDIR ?= ~/lfs-commands DUMPDIR ?= $(HOME)/lfs-commands
else else
BASEDIR ?= ~/public_html/lfs-systemd BASEDIR ?= $(HOME)/public_html/lfs-systemd
PDF_OUTPUT ?= LFS-SYSD-BOOK.pdf PDF_OUTPUT ?= LFS-SYSD-BOOK.pdf
NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html
DUMPDIR ?= ~/lfs-sysd-commands DUMPDIR ?= $(HOME)/lfs-sysd-commands
endif endif
ifndef ARCH ifndef ARCH
@ -60,7 +57,8 @@ book: validate profile-html
@echo "Copying CSS code and images..." @echo "Copying CSS code and images..."
$(Q)mkdir -p $(BASEDIR)/stylesheets $(Q)mkdir -p $(BASEDIR)/stylesheets
$(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets $(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
$(Q)sed -i 's|../stylesheet|stylesheet|' $(BASEDIR)/index.html $(Q)sed -e 's|../stylesheet|stylesheet|' \
-i $(BASEDIR)/index.html
$(Q)mkdir -p $(BASEDIR)/images $(Q)mkdir -p $(BASEDIR)/images
$(Q)cp images/*.png $(BASEDIR)/images $(Q)cp images/*.png $(BASEDIR)/images
@ -68,11 +66,10 @@ book: validate profile-html
@echo "Running Tidy and obfuscate.sh..." @echo "Running Tidy and obfuscate.sh..."
$(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \ $(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
tidy -config tidy.conf $$filename; \ tidy -config tidy.conf $$filename; \
true; \
/bin/bash obfuscate.sh $$filename; \ /bin/bash obfuscate.sh $$filename; \
sed -e "s@text/html@application/xhtml+xml@g" \ sed -e "s|text/html|application/xhtml+xml|g" \
-i $$filename; \ -i $$filename; \
done; done
$(Q)$(MAKE) --no-print-directory wget-list md5sums $(Q)$(MAKE) --no-print-directory wget-list md5sums
@ -111,16 +108,16 @@ nochunks: validate profile-html
--output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
stylesheets/lfs-nochunks.xsl \ stylesheets/lfs-nochunks.xsl \
$(RENDERTMP)/lfs-html.xml $(RENDERTMP)/lfs-html.xml
# $(RENDERTMP)/lfs-html2.xml
@echo "Running Tidy..." @echo "Running Tidy..."
$(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true $(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || test $$? -le 1
@echo "Running obfuscate.sh..." @echo "Running obfuscate.sh..."
$(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) $(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
$(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT) $(Q)sed -e "s|text/html|application/xhtml+xml|g" \
$(Q)sed -i -e "s@../wget-list@wget-list@" $(BASEDIR)/$(NOCHUNKS_OUTPUT) -e "s|../wget-list|wget-list|" \
$(Q)sed -i -e "s@../md5sums@md5sums@" $(BASEDIR)/$(NOCHUNKS_OUTPUT) -e "s|../md5sums|md5sums|" \
-i $(BASEDIR)/$(NOCHUNKS_OUTPUT)
@echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)" @echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)"
@ -139,17 +136,17 @@ validate: tmpdir version
@echo "Adjusting for revision $(REV)..." @echo "Adjusting for revision $(REV)..."
$(Q)xsltproc --nonet \ $(Q)xsltproc --nonet \
--xinclude \ --xinclude \
--output $(RENDERTMP)/lfs-html2.xml \
--stringparam profile.revision $(REV) \ --stringparam profile.revision $(REV) \
--stringparam profile.arch $(ARCH) \ --stringparam profile.arch $(ARCH) \
--output $(RENDERTMP)/lfs-html2.xml \
stylesheets/lfs-xsl/profile.xsl \ stylesheets/lfs-xsl/profile.xsl \
index.xml index.xml
@echo "Validating the book..." @echo "Validating the book..."
$(Q)xmllint --nonet \ $(Q)xmllint --nonet \
--noent \ --encode UTF-8 \
--postvalid \ --postvalid \
-o $(RENDERTMP)/lfs-full.xml \ --output $(RENDERTMP)/lfs-full.xml \
$(RENDERTMP)/lfs-html2.xml $(RENDERTMP)/lfs-html2.xml
$(Q)rm -f appendices/*.script $(Q)rm -f appendices/*.script
@ -171,18 +168,21 @@ wget-list: $(BASEDIR)/wget-list $(BASEDIR)/wget-list-$(REV)
$(BASEDIR)/wget-list: stylesheets/wget-list.xsl $(DOWNLOADS_DEP) $(BASEDIR)/wget-list: stylesheets/wget-list.xsl $(DOWNLOADS_DEP)
@echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..." @echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..."
$(Q)mkdir -p $(BASEDIR) $(Q)mkdir -p $(BASEDIR)
$(Q)xsltproc --xinclude --nonet \ $(Q)xsltproc --nonet \
--xinclude \
--output $(BASEDIR)/wget-list \ --output $(BASEDIR)/wget-list \
stylesheets/wget-list.xsl \ stylesheets/wget-list.xsl \
chapter03/chapter03.xml chapter03/chapter03.xml
$(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl $(DOWNLOADS_DEP) $(BASEDIR)/wget-list-$(REV): stylesheets/wget-list.xsl $(DOWNLOADS_DEP)
$(Q)xsltproc --nonet --xinclude \ $(Q)xsltproc --nonet \
--xinclude \
--stringparam profile.revision $(REV) \ --stringparam profile.revision $(REV) \
--output $(RENDERTMP)/wget-list.xml \ --output $(RENDERTMP)/wget-list.xml \
stylesheets/lfs-xsl/profile.xsl \ stylesheets/lfs-xsl/profile.xsl \
chapter03/chapter03.xml chapter03/chapter03.xml
$(Q)xsltproc --xinclude --nonet \
$(Q)xsltproc --nonet \
--output $(BASEDIR)/wget-list-$(REV) \ --output $(BASEDIR)/wget-list-$(REV) \
stylesheets/wget-list.xsl \ stylesheets/wget-list.xsl \
$(RENDERTMP)/wget-list.xml $(RENDERTMP)/wget-list.xml
@ -192,14 +192,15 @@ $(BASEDIR)/md5sums: stylesheets/wget-list.xsl $(DOWNLOADS_DEP)
@echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..." @echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..."
$(Q)mkdir -p $(BASEDIR) $(Q)mkdir -p $(BASEDIR)
$(Q)xsltproc --nonet --xinclude \ $(Q)xsltproc --nonet \
--xinclude \
--stringparam profile.revision $(REV) \ --stringparam profile.revision $(REV) \
--stringparam profile.arch $(ARCH) \ --stringparam profile.arch $(ARCH) \
--output $(RENDERTMP)/md5sum.xml \ --output $(RENDERTMP)/md5sum.xml \
stylesheets/lfs-xsl/profile.xsl \ stylesheets/lfs-xsl/profile.xsl \
chapter03/chapter03.xml chapter03/chapter03.xml
$(Q)xsltproc --xinclude --nonet \ $(Q)xsltproc --nonet \
--output $(BASEDIR)/md5sums \ --output $(BASEDIR)/md5sums \
stylesheets/md5sum.xsl \ stylesheets/md5sum.xsl \
$(RENDERTMP)/md5sum.xml $(RENDERTMP)/md5sum.xml

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common" xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl" extension-element-prefixes="exsl"
@ -7,8 +7,7 @@
<!-- XSLT stylesheet to extract commands from [B,H]LFS books. --> <!-- XSLT stylesheet to extract commands from [B,H]LFS books. -->
<xsl:variable name="newline"> <xsl:variable name="newline">
<xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:text>
</xsl:variable> </xsl:variable>
<xsl:template match="/"> <xsl:template match="/">

View File

@ -10,6 +10,14 @@
<!-- Upstream XHTML presentation templates --> <!-- Upstream XHTML presentation templates -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
<xsl:param name="chunker.output.method" select="'xml'"/>
<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
<xsl:param name="chunker.output.media-type" select="'application/xhtml+xml'"/>
<xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD XHTML 1.0 Strict//EN'"/>
<xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'"/>
<xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/>
<xsl:param name="chunker.output.indent" select="'no'"/>
<!-- Including our customized elements templates --> <!-- Including our customized elements templates -->
<xsl:include href="common.xsl"/> <xsl:include href="common.xsl"/>
<xsl:include href="xhtml/lfs-admon.xsl"/> <xsl:include href="xhtml/lfs-admon.xsl"/>
@ -31,9 +39,6 @@
<xsl:param name="ulink.target" select="''"/> <xsl:param name="ulink.target" select="''"/>
<xsl:param name="css.decoration" select="0"/> <xsl:param name="css.decoration" select="0"/>
<!-- No XML declaration -->
<xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/>
<!-- Control generation of ToCs and LoTs --> <!-- Control generation of ToCs and LoTs -->
<xsl:param name="generate.toc"> <xsl:param name="generate.toc">
book toc,title book toc,title

View File

@ -10,6 +10,13 @@
<!-- Upstream XHTML templates --> <!-- Upstream XHTML templates -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/> <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
<xsl:output method="xml"
encoding="UTF-8"
media-type="application/xhtml+xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
omit-xml-declaration="yes"
indent="no" />
<!-- Include our customized templates --> <!-- Include our customized templates -->
<xsl:include href="common.xsl"/> <xsl:include href="common.xsl"/>
<xsl:include href="xhtml/lfs-index.xsl"/> <xsl:include href="xhtml/lfs-index.xsl"/>

View File

@ -53,8 +53,8 @@
We have expanded the support to several inline tags. We have expanded the support to several inline tags.
See pdf/lfs-mixed.xsl. See pdf/lfs-mixed.xsl.
Note: the argument in select= is a zero-width space Note: the argument in select= is a zero-width space
(unicode 200b, encoded in utf-8)--> (unicode 200b)-->
<xsl:param name="ulink.hyphenate" select="''"/> <xsl:param name="ulink.hyphenate" select="'&#x200B;'"/>
<!-- List of characters to allow ulink URLs, and supported inline tags, <!-- List of characters to allow ulink URLs, and supported inline tags,
to be automatically hyphenated on. to be automatically hyphenated on.

View File

@ -18,6 +18,7 @@
<!-- Generate DocBook instance with correct DOCTYPE --> <!-- Generate DocBook instance with correct DOCTYPE -->
<xsl:output method="xml" <xsl:output method="xml"
encoding="UTF-8"
doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/> doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>

View File

@ -31,8 +31,7 @@
</xsl:call-template> </xsl:call-template>
<!-- Add a newline --> <!-- Add a newline -->
<xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:text>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>

View File

@ -28,8 +28,7 @@
<xsl:value-of select="@url"/> <xsl:value-of select="@url"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:text>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>