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
14 EXAMPLES=`pwd`/../../examples
20 # Check top level directory
21 if [ ! -d gtk-tutorial.$DATE ]; then
22 if [ -e gtk-tutorial.$DATE ]; then
23 echo "ERROR: gtk-tutorial is not a directory"
26 if ! mkdir gtk-tutorial.$DATE; then
32 if ! cd gtk-tutorial.$DATE; then
42 echo -n "Copy SGML and images.... "
43 if [ ! -d sgml ]; then
45 echo "ERROR: html is not a directory"
51 (cd sgml ; cp $TARGET . ; cp $JPGS .)
55 echo -n "Formatting into HTML.... "
56 if [ ! -d html ]; then
58 echo "ERROR: html is not a directory"
64 (db2html gtk-tut.sgml ; mv gtk-tut/* html ; cp $JPGS html ; rm -rf gtk-tut) > /dev/null
67 # Text, PS and DVI Format
68 echo -n "Formatting into Text, PS and DVI.... "
71 echo "ERROR: ps is not a directory"
79 echo "ERROR: ps is not a directory"
85 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
86 (cd ps ; db2ps gtk-tut.sgml ; ps2pdf gtk-tut.ps gtk-tut.pdf ; pdftotext gtk-tut.pdf ; mv gtk-tut.txt ../txt ; rm -f *) > /dev/null 2>&1
87 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
88 (cp *.eps ps ; cd ps ; db2ps gtk-tut.sgml ; rm gtk-tut.aux gtk-tut.log gtk-tut.sgml gtk-tut.tex *.eps) > /dev/null 2>&1
92 echo -n "Formatting into PDF.... "
95 echo "ERROR: pdf is not a directory"
101 (db2pdf gtk-tut.sgml ; mv gtk-tut.pdf pdf) > /dev/null
105 echo -n "Copying examples"
107 (cd examples ; make clean ; rm -rf CVS */CVS)
113 echo -n "Creating packages.... "
115 tar cvfz gtk-tutorial.$DATE.tar.gz gtk-tutorial.$DATE
118 rm -rf gtk-tutorial.$DATE
121 echo Package gtk-tutorial.$DATE.tar.gz created.