2 # package_tutorial.sh - Package up the tutorial into various formats
3 # Copyright (C) Tony Gale 2000
4 # Contact: gale@gtk.org
6 # NOTE: This script requires the following to be installed:
11 TARGET=`pwd`/gtk-tut.sgml
13 EXAMPLES=`pwd`/../../examples
19 # Check top level directory
20 if [ ! -d gtk-tutorial.$DATE ]; then
21 if [ -e gtk-tutorial.$DATE ]; then
22 echo "ERROR: gtk-tutorial is not a directory"
25 if ! mkdir gtk-tutorial.$DATE; then
31 if ! cd gtk-tutorial.$DATE; then
40 echo -n "Copy SGML and images.... "
41 if [ ! -d sgml ]; then
43 echo "ERROR: html is not a directory"
49 (cd sgml ; cp $TARGET . ; cp -R $IMAGES . ; rm -rf images/CVS)
53 echo -n "Formatting into HTML.... "
54 if [ ! -d html ]; then
56 echo "ERROR: html is not a directory"
62 (db2html gtk-tut.sgml ; mv gtk-tut/* html ; cp -R $IMAGES html ; rm -rf gtk-tut) > /dev/null
63 (cd html ; ln -s book1.html index.html ; rm -rf images/CVS)
66 # PS, PDF and DVI Format
67 echo -n "Formatting into PS, DVI and PDF.... "
70 echo "ERROR: ps is not a directory"
78 echo "ERROR: pdf is not a directory"
84 #sed 's/gtk_tut_packbox1.jpg/gtk_tut_packbox1.eps/ ; s/gtk_tut_packbox2.jpg/gtk_tut_packbox2.eps/ ; s/gtk_tut_table.jpg/gtk_tut_table.eps/' gtk-tut.sgml > ps/gtk-tut.sgml
85 sed "s/images\/\(.*\)\.png/images\/\1.eps/g" gtk-tut.sgml > ps/gtk-tut.sgml
87 (cd ps ; db2dvi gtk-tut.sgml ; dvips gtk-tut.dvi -o gtk-tut.ps ; dvipdf gtk-tut.dvi ../pdf/gtk-tut.pdf) > /dev/null 2>&1
88 #sed 's/gtk_tut_packbox1.jpg/gtk_tut_packbox1.eps/ ; s/gtk_tut_packbox2.jpg/gtk_tut_packbox2.eps/ ; s/gtk_tut_table.jpg/gtk_tut_table.eps/' gtk-tut.sgml > ps/gtk-tut.sgml
89 #sed "s/images\/\(.*\)\.png/images\/\1.eps/g" gtk-tut.sgml > ps/gtk-tut.sgml
91 (cd ps ; rm gtk-tut.aux gtk-tut.log gtk-tut.sgml gtk-tut.tex ; rm -Rf images) > /dev/null 2>&1
95 #echo -n "Formatting into PDF.... "
96 #if [ ! -d pdf ]; then
98 # echo "ERROR: pdf is not a directory"
104 #(db2pdf gtk-tut.sgml ; mv gtk-tut.pdf pdf) > /dev/null
108 echo -n "Formatting into RTF.... "
109 if [ ! -d rtf ]; then
111 echo "ERROR: rtf is not a directory"
117 (db2rtf gtk-tut.sgml ; mv gtk-tut.rtf rtf) > /dev/null
122 echo -n "Copying examples"
124 (cd examples ; make clean ; rm -rf CVS */CVS */.cvsignore README.1ST extract.awk extract.sh find-examples.sh)
131 echo -n "Creating packages.... "
133 tar cvfz gtk-tutorial.$DATE.tar.gz gtk-tutorial.$DATE
136 rm -rf gtk-tutorial.$DATE
139 echo Package gtk-tutorial.$DATE.tar.gz created.