Added rules for building the FAQ.
[wine] / documentation / make_winehq
1 #!/bin/sh
2
3 ## John R. Sheets <jsheets@codeweavers.com>
4
5 ## This is a convenience script for building the website docs for
6 ## www.winehq.com.  It creates tarballs of the HTML with special
7 ## server-side includes and CSS settings that aren't appropriate for
8 ## the mainline Wine tree.  For this reason, and to make it easier to
9 ## set up an automated website update system, I'm putting this in
10 ## a standalone shell script.
11 ##
12 ## There's no need to invoke the Wine make system just for web
13 ## updates.  For example, we can just grab the documentation
14 ## subdirectory, without having to pull the entire wine tree:
15 ##
16 ## $ cvs co wine/documentation
17 ## $ cd wine/documentation
18 ## $ ./make_winehq
19 ## $ rsync ...
20
21 WWWDIR=www.winehq.com
22 ## Want to put this into a sub-directory for easier maintenance
23 if [ -d "$WWWDIR" -o -f "$WWWDIR" ]; then
24   rm -rf "$WWWDIR.old"
25   mv "$WWWDIR" "$WWWDIR".old
26 fi
27 mkdir "$WWWDIR"
28
29 ## Create five-book HTML tarball
30 echo "./db2html-winehq wine-user.sgml"
31 ./db2html-winehq wine-user.sgml
32 echo "./db2html-winehq wine-devel.sgml"
33 ./db2html-winehq wine-devel.sgml
34 echo "./db2html-winehq winelib-user.sgml"
35 ./db2html-winehq winelib-user.sgml
36 echo "./db2html-winehq wine-pkg.sgml"
37 ./db2html-winehq wine-pkg.sgml
38 echo "./db2html-winehq wine-faq.sgml"
39 ./db2html-winehq wine-faq.sgml
40 tar czf winedoc-html.tgz wine-user wine-devel winelib-user wine-pkg wine-faq
41 cp winedoc-html.tgz "$WWWDIR"
42
43 ## Create one-book HTML tarball
44 echo "./db2html-winehq wine-doc.sgml"
45 ./db2html-winehq wine-doc.sgml
46 tar czf wine-set-html.tgz wine-doc
47 cp wine-set-html.tgz "$WWWDIR"
48
49 ## Create PostScript tarball
50 echo "db2ps -d ./print.dsl wine-user.sgml"
51 db2ps -d ./print.dsl wine-user.sgml > /dev/null 2>&1
52 echo "db2ps -d ./print.dsl wine-devel.sgml"
53 db2ps -d ./print.dsl wine-devel.sgml > /dev/null 2>&1
54 echo "db2ps -d ./print.dsl winelib-user.sgml"
55 db2ps -d ./print.dsl winelib-user.sgml > /dev/null 2>&1
56 echo "db2ps -d ./print.dsl wine-pkg.sgml"
57 db2ps -d ./print.dsl wine-pkg.sgml > /dev/null 2>&1
58 echo "db2ps -d ./print.dsl wine-faq.sgml"
59 db2ps -d ./print.dsl wine-faq.sgml > /dev/null 2>&1
60 tar czf winedoc-ps.tgz wine-user.ps wine-devel.ps winelib-user.ps wine-pkg.ps wine-faq.ps
61 cp winedoc-ps.tgz "$WWWDIR"
62
63 ## Create PDF tarball
64 echo "db2pdf -d ./print.dsl wine-user.sgml"
65 db2pdf -d ./print.dsl wine-user.sgml > /dev/null 2>&1
66 echo "db2pdf -d ./print.dsl wine-devel.sgml"
67 db2pdf -d ./print.dsl wine-devel.sgml > /dev/null 2>&1
68 echo "db2pdf -d ./print.dsl winelib-user.sgml"
69 db2pdf -d ./print.dsl winelib-user.sgml > /dev/null 2>&1
70 echo "db2pdf -d ./print.dsl wine-pkg.sgml"
71 db2pdf -d ./print.dsl wine-pkg.sgml > /dev/null 2>&1
72 echo "db2pdf -d ./print.dsl wine-faq.sgml"
73 db2pdf -d ./print.dsl wine-faq.sgml > /dev/null 2>&1
74 tar czf winedoc-pdf.tgz wine-user.pdf wine-devel.pdf winelib-user.pdf wine-pkg.pdf wine-faq.pdf
75 cp winedoc-pdf.tgz "$WWWDIR"
76
77 ## Create SGML tarball
78 echo "Creating SGML package..."
79 tar czf winedoc-sgml.tgz *.sgml *.dsl *.ent db2html-winehq
80 cp winedoc-sgml.tgz "$WWWDIR"
81
82 ## Done creating downloadable tarballs for users.  Now we want to
83 ## create a tarball of SHTML in a slightly different form, for the
84 ## website.  These versions use special server-side includes which
85 ## aren't appropriate outside of winehq.com.
86 ## 
87 ## Use the special website stylesheet
88 export WINEDOC_STYLESHEET=../winehq.dsl
89
90 ## Create four-book SHTML tarball
91 echo "./db2html-winehq wine-user.sgml"
92 ./db2html-winehq wine-user.sgml
93 echo "./db2html-winehq wine-devel.sgml"
94 ./db2html-winehq wine-devel.sgml
95 echo "./db2html-winehq winelib-user.sgml"
96 ./db2html-winehq winelib-user.sgml
97 echo "./db2html-winehq wine-pkg.sgml"
98 ./db2html-winehq wine-pkg.sgml
99 echo "./db2html-winehq wine-faq.sgml"
100 ./db2html-winehq wine-faq.sgml
101 tar czf winehq-shtml.tgz wine-user wine-devel winelib-user wine-pkg wine-faq
102 cp winehq-shtml.tgz "$WWWDIR"