]> Pileus Git - ~andy/gtk/blob - docs/package_tutorial.sh
upgrade to libtool 1.3.2 (BeOS changes merged)
[~andy/gtk] / docs / package_tutorial.sh
1 #! /bin/sh
2 # package_tutorial.sh - Package up the tutorial into various formats
3 # Copyright (C) Tony Gale 1999
4 # Contact: gale@gtk.org
5 #
6 # NOTE: This script requires the following to be installed:
7 #            o SGML Tools
8 #            o Latex
9 #            o DVI tools
10
11 TARGET=`pwd`/gtk_tut.sgml
12 GIFS="`pwd`/*.gif"
13 EXAMPLES=`pwd`/../examples
14
15 PATH=`pwd`:$PATH
16
17 DATE=`date '+%y%m%d'`
18
19 # Check top level directory
20 if [ ! -d gtk_tutorial ]; then
21   if [ -e gtk_tutorial ]; then
22     echo "ERROR: gtk_tutorial is not a directory"
23     exit
24   fi
25   mkdir gtk_tutorial.$DATE
26 fi 
27
28 cd gtk_tutorial.$DATE
29
30 # SGML Format
31 echo -n "Copy SGML and GIF's.... "
32 if [ ! -d sgml ]; then
33   if [ -e sgml ]; then
34     echo "ERROR: html is not a directory"
35     exit
36   fi
37   mkdir sgml
38 fi
39
40 (cd sgml ; cp $TARGET . ; cp $GIFS .)
41 echo "done"
42
43 # HTML Format
44 echo -n "Formatting into HTML.... " 
45 if [ ! -d html ]; then
46   if [ -e html ]; then
47     echo "ERROR: html is not a directory"
48     exit
49   fi
50   mkdir html
51 fi
52
53 (cd html ; sgml2html $TARGET ; cp $GIFS .)
54 echo "done"
55
56 # Text Format
57 echo -n "Formatting into Text.... "
58 if [ ! -d txt ]; then
59   if [ -e txt ]; then
60     echo "ERROR: txt is not a directory"
61     exit
62   fi
63   mkdir txt
64 fi
65
66 (cd txt ; sgml2txt -f $TARGET 2>&1 > /dev/null )
67 echo "done"
68
69 # PS and DVI Format
70 echo -n "Formatting into PS and DVI.... "
71 if [ ! -d ps ]; then
72   if [ -e ps ]; then
73     echo "ERROR: ps is not a directory"
74     exit
75   fi
76   mkdir ps
77 fi
78
79 (cd ps ; sgml2latex --output=ps $TARGET > /dev/null)
80 (cd ps ; sgml2latex $TARGET > /dev/null)
81 echo "done"
82
83 # Copy examples
84 echo -n "Copying examples"
85 cp -R $EXAMPLES .
86 (cd examples ; make clean ; rm -rf CVS */CVS)
87 echo "done"
88
89 # Package it all up
90 echo -n "Creating packages.... "
91 cd ..
92 tar cvfz gtk_tutorial.$DATE.tar.gz gtk_tutorial.$DATE
93 echo "done"
94
95 rm -rf gtk_tutorial.$DATE
96
97 echo
98 echo Package gtk_tutorial.$DATE.tar.gz created.
99 echo