source: BLFS/libs/func_parser@ db6b934

experimental
Last change on this file since db6b934 was 2ca2992, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Moved function, XSL, and pre-made dependencies files to libs directory.

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[cace19a4]1#!/bin/bash
[41d4c11]2#####
3#
4# Parse the XML documents to create a 'package' book
5#
[cace19a4]6# $Id$
[41d4c11]7#####
8
9
10#----------------------------#
11generate_TARGET_xml() { #
12#----------------------------#
13: <<inline_doc
14 function: Generate the XML document for the TARGET package
15 input vars: nothing
16 externals: vars: TARGET
17 modifies: nothing
18 returns: nothing
19 output: file: $TARGET-index.xml
20 on error: nothing
21 on success: nothing
22inline_doc
23
[cace19a4]24 local
[41d4c11]25 echo -en "\tGenerating $TARGET-index.xml ..."
26
27 #---------------------
28 # Header to $TARGET-index.xml
29{
30cat << EOF
31<?xml version="1.0" encoding="ISO-8859-1"?>
32<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
33 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" >
34
35<book>
36
37 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/book/bookinfo.xml"/>
38
39 <preface>
40 <?dbhtml filename="preface.html" dir="preface"?>
41
42 <title>Preface</title>
43
44 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/locale-issues.xml"/>
45 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/bootscripts.xml"/>
46
47 </preface>
48
49 <chapter>
50 <?dbhtml filename="chapter.html" dir="installing"?>
51
52 <title>Installing $TARGET in Dependencies Build Order</title>
53
54EOF
55} > $TARGET-index.xml
56
57 #---------------------
58 # Dump $TARGET-index.xml.tmp in reverse order.
59 tac $TARGET-index.xml.tmp >> $TARGET-index.xml
60 rm $TARGET-index.xml.tmp
61
62 #---------------------
63 # Footer of $TARGET-index.xml
64{
65cat << EOF
66
67 </chapter>
68
69 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/creat-comm.xml"/>
70 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/ac-free-lic.xml"/>
71
72 <index/>
73
74</book>
75
76EOF
77} >> $TARGET-index.xml
78
79 echo "done"
80}
81
82
83#-------------------------#
84generate_target_book() { #
85#-------------------------#
86: <<inline_doc
87 function: Create an HTML document of the requested TARGET.
88 input vars: nothing
89 externals: vars: TARGET
90 BLFS_XML
91 modifies: nothing
92 returns: nothing
93 output: file: NUMEROUS FILES
94 on error: nothing
95 on success: nothing
96inline_doc
97
98 local filename # output filename
[cace19a4]99
[41d4c11]100 echo -en "\tGenerating the HTML book ..."
101 xsltproc --xinclude --nonet --stringparam base.dir HTML/ \
102 --stringparam chunk.quietly 1 \
103 ../$BLFS_XML/stylesheets/blfs-chunked.xsl \
104 $TARGET-index.xml > xsltproc.log 2>&1
105
106 mkdir HTML/{stylesheets,images}
107 cp ../$BLFS_XML/stylesheets/*.css HTML/stylesheets
108 cp ../$BLFS_XML/images/*.png HTML/images
109 cd HTML
110 sed -i -e "s@../stylesheets@stylesheets@g" *.html
111 sed -i -e "s@../images@images@g" *.html
112 for filename in `find . -name "*.html"` ; do
113 tidy -config ../../$BLFS_XML/tidy.conf $filename || true
114 sh ../../$BLFS_XML/obfuscate.sh $filename
115 sed -i -e "s@text/html@application/xhtml+xml@g" $filename
116 done
117 echo "done"
118}
119
120
121#-------------------------#
[cace19a4]122create_build_scripts() { #
[41d4c11]123#-------------------------#
124: <<inline_doc
[cace19a4]125 function:
[41d4c11]126 input vars: nothing
127 externals: none
[cace19a4]128 modifies: nothing
[41d4c11]129 returns: nothing
130 output: none
131 on error: nothing
132 on success: nothing
133inline_doc
134
135 echo -en "\tGenerating the build scripts ... not implemented yet, sorry\n"
136}
Note: See TracBrowser for help on using the repository browser.