2000-07-21 15:38:08 +00:00
|
|
|
#! /bin/sh
|
2002-11-26 18:32:07 +00:00
|
|
|
# package-db-tutorial.sh - Package up the tutorial into various formats
|
|
|
|
# Copyright (C) Tony Gale 2000-2002
|
2000-07-21 15:38:08 +00:00
|
|
|
# Contact: gale@gtk.org
|
|
|
|
#
|
|
|
|
# NOTE: This script requires the following to be installed:
|
|
|
|
# o DocBook
|
2002-11-26 18:32:07 +00:00
|
|
|
# o DocBook-Utils
|
2000-07-21 15:38:08 +00:00
|
|
|
# o Jade
|
|
|
|
# o Jadetex
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
TARGETDIR=`pwd`/2.0/
|
|
|
|
|
|
|
|
SOURCE=`pwd`/gtk-tut.sgml
|
2002-08-25 11:28:42 +00:00
|
|
|
IMAGES="`pwd`/images"
|
2002-08-26 11:35:57 +00:00
|
|
|
IMAGESDIR="images"
|
2000-07-21 15:38:08 +00:00
|
|
|
EXAMPLES=`pwd`/../../examples
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
DATE=`date '+%Y%m%d'`
|
|
|
|
BUILDDIR=gtk-tutorial.$DATE
|
|
|
|
|
2000-07-21 15:38:08 +00:00
|
|
|
PATH=`pwd`:$PATH
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
# Check target directory
|
|
|
|
if [ ! -d $TARGETDIR ]; then
|
|
|
|
if [ -e $TARGETDIR ]; then
|
|
|
|
echo "ERROR: target directory is not a directory"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
if ! mkdir $TARGETDIR; then
|
|
|
|
echo "mkdir for target directory failed"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
2000-07-21 15:38:08 +00:00
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
# Check top level build directory
|
|
|
|
if [ ! -d $BUILDDIR ]; then
|
|
|
|
if [ -e $BUILDDIR ]; then
|
|
|
|
echo "ERROR: build directory is not a directory"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit
|
|
|
|
fi
|
2002-11-26 18:32:07 +00:00
|
|
|
if ! mkdir $BUILDDIR; then
|
|
|
|
echo "mkdir of build directory failed"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
if ! cd $BUILDDIR; then
|
|
|
|
echo "cd to build directory failed"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
cp $SOURCE .
|
2002-08-25 11:28:42 +00:00
|
|
|
cp -R $IMAGES .
|
2000-07-21 15:38:08 +00:00
|
|
|
|
|
|
|
# SGML Format
|
|
|
|
echo -n "Copy SGML and images.... "
|
2002-11-26 18:32:07 +00:00
|
|
|
if [ ! -d gtk-tutorial.sgml ]; then
|
|
|
|
if [ -e gtk-tutorial.sgml ]; then
|
|
|
|
echo "ERROR: gtk-tutorial.sgml is not a directory"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit
|
|
|
|
fi
|
2002-11-26 18:32:07 +00:00
|
|
|
mkdir gtk-tutorial.sgml
|
2000-07-21 15:38:08 +00:00
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
(cd gtk-tutorial.sgml && cp $SOURCE . && cp -R $IMAGES . && rm -rf $IMAGESDIR/CVS)
|
|
|
|
tar cvfz $TARGETDIR/gtk-tutorial.sgml.tgz gtk-tutorial.sgml
|
2000-07-21 15:38:08 +00:00
|
|
|
echo "done"
|
|
|
|
|
|
|
|
# HTML Format
|
|
|
|
echo -n "Formatting into HTML.... "
|
2002-11-26 18:32:07 +00:00
|
|
|
if [ ! -d gtk-tutorial.html ]; then
|
|
|
|
if [ -e gtk-tutorial.html ]; then
|
|
|
|
echo "ERROR: gtk-tutorial.html is not a directory"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit
|
|
|
|
fi
|
2002-11-26 18:32:07 +00:00
|
|
|
mkdir gtk-tutorial.html
|
2000-07-21 15:38:08 +00:00
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
(db2html -o gtk-tutorial.html $SOURCE && cp -R $IMAGES gtk-tutorial.html && rm gtk-tutorial.html/$IMAGESDIR/*.eps) > /dev/null
|
|
|
|
(cd gtk-tutorial.html && rm -rf $IMAGESDIR/CVS && ln -s book1.html index.html)
|
|
|
|
tar cvfz $TARGETDIR/gtk-tutorial.html.tgz gtk-tutorial.html
|
2000-07-21 15:38:08 +00:00
|
|
|
echo "done"
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
# PS and PDF Format
|
|
|
|
echo -n "Formatting into PS and PDF.... "
|
|
|
|
if [ ! -d gtk-tutorial.ps ]; then
|
|
|
|
if [ -e gtk-tutorial.ps ]; then
|
|
|
|
echo "ERROR: gtk-tutorial.ps is not a directory"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit
|
|
|
|
fi
|
2002-11-26 18:32:07 +00:00
|
|
|
mkdir gtk-tutorial.ps
|
2000-07-21 15:38:08 +00:00
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
if [ ! -d gtk-tutorial.pdf ]; then
|
|
|
|
if [ -e gtk-tutorial.pdf ]; then
|
|
|
|
echo "ERROR: gtk-tutorial.pdf is not a directory"
|
2000-07-21 15:38:08 +00:00
|
|
|
exit
|
|
|
|
fi
|
2002-11-26 18:32:07 +00:00
|
|
|
mkdir gtk-tutorial.pdf
|
2000-07-21 15:38:08 +00:00
|
|
|
fi
|
|
|
|
|
2002-11-26 18:32:07 +00:00
|
|
|
sed "s/images\/\(.*\)\.png/images\/\1.eps/g" $SOURCE > gtk-tutorial.ps/gtk-tut.sgml
|
|
|
|
cp -R $IMAGES gtk-tutorial.ps
|
|
|
|
(cd gtk-tutorial.ps && db2dvi gtk-tut.sgml && dvips gtk-tut.dvi -o gtk-tut.ps && dvipdf gtk-tut.dvi ../gtk-tutorial.pdf/gtk-tut.pdf)
|
|
|
|
gzip -c gtk-tutorial.ps/gtk-tut.ps > $TARGETDIR/gtk-tutorial.ps.gz
|
|
|
|
gzip -c gtk-tutorial.pdf/gtk-tut.pdf > $TARGETDIR/gtk-tutorial.pdf.gz
|
2000-07-21 15:38:08 +00:00
|
|
|
echo "done"
|
|
|
|
|
2002-08-25 11:28:42 +00:00
|
|
|
# RTF Format
|
2002-11-26 18:32:07 +00:00
|
|
|
#echo -n "Formatting into RTF.... "
|
|
|
|
#if [ ! -d gtk-tutorial.rtf ]; then
|
|
|
|
# if [ -e gtk-tutorial.rtf ]; then
|
|
|
|
# echo "ERROR: is not a directory"
|
|
|
|
# exit
|
|
|
|
# fi
|
|
|
|
# mkdir gtk-tutorial.rtf
|
|
|
|
#fi
|
|
|
|
|
|
|
|
#cp -R $IMAGES gtk-tutorial.rtf
|
|
|
|
#(cd gtk-tutorial.rtf && db2rtf $SOURCE) # > /dev/null
|
|
|
|
#gzip -c gtk-tutorial.rtf/gtk-tut.rtf > $TARGETDIR/gtk-tutorial.rtf.gz
|
|
|
|
#echo "done"
|
2000-07-21 15:38:08 +00:00
|
|
|
|
|
|
|
# Copy examples
|
|
|
|
echo -n "Copying examples"
|
|
|
|
cp -R $EXAMPLES .
|
2002-11-26 18:32:07 +00:00
|
|
|
(cd examples && make clean && rm -rf CVS */CVS */.cvsignore README.1ST extract.awk extract.sh find-examples.sh)
|
|
|
|
tar cfz $TARGETDIR/examples.tgz examples
|
2000-07-21 15:38:08 +00:00
|
|
|
echo "done"
|
|
|
|
|
|
|
|
cd ..
|
2002-11-26 18:32:07 +00:00
|
|
|
rm -rf $BUILDDIR
|
2000-07-21 15:38:08 +00:00
|
|
|
|
|
|
|
echo
|
2002-11-26 18:32:07 +00:00
|
|
|
echo Packages created.
|
2000-07-21 15:38:08 +00:00
|
|
|
echo
|