2006-05-24 23:04:49 +02:00
|
|
|
#!/bin/bash
|
2006-05-24 21:31:48 +02:00
|
|
|
#####
|
|
|
|
#
|
|
|
|
# Parse the XML documents to create a 'package' book
|
|
|
|
#
|
2006-05-24 23:04:49 +02:00
|
|
|
# $Id$
|
2006-05-24 21:31:48 +02:00
|
|
|
#####
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------#
|
|
|
|
generate_TARGET_xml() { #
|
|
|
|
#----------------------------#
|
|
|
|
: <<inline_doc
|
|
|
|
function: Generate the XML document for the TARGET package
|
|
|
|
input vars: nothing
|
|
|
|
externals: vars: TARGET
|
|
|
|
modifies: nothing
|
|
|
|
returns: nothing
|
|
|
|
output: file: $TARGET-index.xml
|
|
|
|
on error: nothing
|
|
|
|
on success: nothing
|
|
|
|
inline_doc
|
|
|
|
|
2006-05-24 23:04:49 +02:00
|
|
|
local
|
2006-08-13 12:01:14 +02:00
|
|
|
echo -en "\n\tGenerating $TARGET-index.xml ..."
|
2006-05-24 21:31:48 +02:00
|
|
|
|
|
|
|
#---------------------
|
|
|
|
# Header to $TARGET-index.xml
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-09-19 18:50:48 +02:00
|
|
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
|
2006-05-24 21:31:48 +02:00
|
|
|
|
|
|
|
<book>
|
|
|
|
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/book/bookinfo.xml"/>
|
|
|
|
|
|
|
|
<preface>
|
|
|
|
<?dbhtml filename="preface.html" dir="preface"?>
|
|
|
|
|
|
|
|
<title>Preface</title>
|
|
|
|
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/locale-issues.xml"/>
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/bootscripts.xml"/>
|
|
|
|
|
|
|
|
</preface>
|
|
|
|
|
|
|
|
<chapter>
|
|
|
|
<?dbhtml filename="chapter.html" dir="installing"?>
|
|
|
|
|
|
|
|
<title>Installing $TARGET in Dependencies Build Order</title>
|
|
|
|
|
|
|
|
EOF
|
|
|
|
} > $TARGET-index.xml
|
|
|
|
|
|
|
|
#---------------------
|
|
|
|
# Dump $TARGET-index.xml.tmp in reverse order.
|
|
|
|
tac $TARGET-index.xml.tmp >> $TARGET-index.xml
|
|
|
|
rm $TARGET-index.xml.tmp
|
|
|
|
|
|
|
|
#---------------------
|
|
|
|
# Footer of $TARGET-index.xml
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
</chapter>
|
|
|
|
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/creat-comm.xml"/>
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/ac-free-lic.xml"/>
|
|
|
|
|
|
|
|
<index/>
|
|
|
|
|
|
|
|
</book>
|
|
|
|
|
|
|
|
EOF
|
|
|
|
} >> $TARGET-index.xml
|
|
|
|
|
|
|
|
echo "done"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#-------------------------#
|
|
|
|
generate_target_book() { #
|
|
|
|
#-------------------------#
|
|
|
|
: <<inline_doc
|
|
|
|
function: Create an HTML document of the requested TARGET.
|
|
|
|
input vars: nothing
|
|
|
|
externals: vars: TARGET
|
|
|
|
BLFS_XML
|
2006-06-11 12:04:36 +02:00
|
|
|
MAIL_SERVER
|
|
|
|
X11
|
2006-05-24 21:31:48 +02:00
|
|
|
modifies: nothing
|
|
|
|
returns: nothing
|
|
|
|
output: file: NUMEROUS FILES
|
|
|
|
on error: nothing
|
|
|
|
on success: nothing
|
|
|
|
inline_doc
|
|
|
|
|
|
|
|
local filename # output filename
|
2006-08-13 12:01:14 +02:00
|
|
|
echo -en "\n\tGenerating <$TARGET> HTML book from <$BLFS_XML> xml files ..."
|
2006-06-03 01:00:10 +02:00
|
|
|
xsltproc --xinclude --nonet \
|
|
|
|
--stringparam mail_server $MAIL_SERVER \
|
|
|
|
--stringparam xwindow $X11 \
|
|
|
|
--stringparam base.dir HTML/ \
|
2006-06-02 22:27:01 +02:00
|
|
|
../libs/book.xsl \
|
2006-05-24 21:31:48 +02:00
|
|
|
$TARGET-index.xml > xsltproc.log 2>&1
|
|
|
|
mkdir HTML/{stylesheets,images}
|
2007-09-19 18:50:48 +02:00
|
|
|
cp ../$BLFS_XML/stylesheets/lfs-xsl/*.css HTML/stylesheets
|
2006-05-24 21:31:48 +02:00
|
|
|
cp ../$BLFS_XML/images/*.png HTML/images
|
|
|
|
cd HTML
|
|
|
|
sed -i -e "s@../stylesheets@stylesheets@g" *.html
|
|
|
|
sed -i -e "s@../images@images@g" *.html
|
|
|
|
for filename in `find . -name "*.html"` ; do
|
|
|
|
tidy -config ../../$BLFS_XML/tidy.conf $filename || true
|
|
|
|
sh ../../$BLFS_XML/obfuscate.sh $filename
|
|
|
|
sed -i -e "s@text/html@application/xhtml+xml@g" $filename
|
|
|
|
done
|
2006-06-11 12:04:36 +02:00
|
|
|
cd ..
|
2006-05-24 21:31:48 +02:00
|
|
|
echo "done"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#-------------------------#
|
2006-05-24 23:04:49 +02:00
|
|
|
create_build_scripts() { #
|
2006-05-24 21:31:48 +02:00
|
|
|
#-------------------------#
|
|
|
|
: <<inline_doc
|
2006-06-11 12:04:36 +02:00
|
|
|
function: Create shell scripts of the requested TARGET.
|
2006-08-13 20:24:16 +02:00
|
|
|
input vars: $1 use sudo n/y
|
2006-06-11 12:04:36 +02:00
|
|
|
externals: TARGET
|
2006-05-24 23:04:49 +02:00
|
|
|
modifies: nothing
|
2006-05-24 21:31:48 +02:00
|
|
|
returns: nothing
|
2006-06-11 12:04:36 +02:00
|
|
|
output: file: NUMEROUS FILES
|
2006-05-24 21:31:48 +02:00
|
|
|
on error: nothing
|
|
|
|
on success: nothing
|
|
|
|
inline_doc
|
|
|
|
|
2006-06-11 12:04:36 +02:00
|
|
|
# Log separator
|
2006-06-14 22:38:31 +02:00
|
|
|
echo -e "\n\tScripts generation depuration and errors:\n" >> xsltproc.log
|
2006-06-11 12:04:36 +02:00
|
|
|
|
2006-08-13 12:01:14 +02:00
|
|
|
echo -en "\n\tGenerating the build scripts ..."
|
2006-06-11 12:04:36 +02:00
|
|
|
xsltproc --xinclude --nonet \
|
2006-08-13 20:24:16 +02:00
|
|
|
--stringparam sudo $SUDO \
|
2006-06-11 12:04:36 +02:00
|
|
|
-o ./scripts/ ../libs/scripts.xsl \
|
|
|
|
$TARGET-index.xml >> xsltproc.log 2>&1
|
2006-06-13 02:56:07 +02:00
|
|
|
# Make the scripts executable.
|
|
|
|
chmod -R +x scripts
|
2006-08-23 19:53:55 +02:00
|
|
|
cd ..
|
|
|
|
echo -e "done\n"
|
2006-06-13 02:56:07 +02:00
|
|
|
|
2006-05-24 21:31:48 +02:00
|
|
|
}
|