]> git.decadent.org.uk Git - ion3.git/blob - doc/predist.sh
31e740541b375f88a35ed14834496f1b4845f598
[ion3.git] / doc / predist.sh
1 #!/bin/sh
2
3 ##
4 ## Versioning
5 ##
6
7 pwd=`pwd`
8 dir=`basename "$pwd"`
9
10 release=`echo "$dir"|sed 's/^.\+-\([^-]\+-[0-9]\+\)$/\1/p; d'`
11
12 if test "$release" == ""; then
13     echo "Invalid package name $dir."
14     exit 1
15 fi
16
17 ##
18 ## Ion path
19 ##
20
21 if test "$ION_PATH" = ""; then
22     ION_PATH="../ion-${release}"
23 fi
24
25 ##
26 ## Build
27 ##
28
29 set -e
30
31 d=`echo $release|sed 's/[^-]\+-\(....\)\(..\)\(..\)/\1-\2-\3/'`
32
33 perl -p -i -e "s/%%DATE/\\\\date{$d}/" ionconf.tex
34 sed "s:^TOPDIR=.*:TOPDIR=${ION_PATH}:" Makefile > Makefile.tmp
35 make -f Makefile.tmp all
36 make -f Makefile.tmp all-ps
37 make -f Makefile.tmp clean
38 rm Makefile.tmp
39 gzip *.dvi *.ps