]> git.saurik.com Git - wxWidgets.git/blame_incremental - distrib/tar-o-matic.sh
cleanup - heavy reformatting
[wxWidgets.git] / distrib / tar-o-matic.sh
... / ...
CommitLineData
1#!/bin/sh
2
3# create wx tarballs automatically given a tag, or from CVS HEAD
4PROGNAME=$0
5VERSION=$1
6TAG=""
7STARTDIR=$PWD
8
9SPINWXX11=0
10SPINWXGTK=0
11SPINWXMOTIF=0
12SPINWXMAC=0
13SPINWXBASE=0
14SPINWXMGL=0
15SPINDOCS=0
16SPINEVERYTHING=0
17REBAKE=0
18
19SILENTFLAG=""
20
21about()
22{
23 # sorry folks, I couldn't resist. :-)
24
25 echo "It's the tar-o-matic 2000! It slices! It dices! It..."
26 echo "Grabs CVS revisions and generates complete tarballs from them!!"
27 echo ""
28 echo "WARNING:"
29 echo "- Do not use tar-o-matic while intoxicated."
30 echo "- Do not use tar-o-matic while driving."
31 echo "- Do not use tar-o-matic while driving intoxicated."
32 echo "- Keep tar-o-matic away from small children. Large ones too."
33 echo "- Tar-o-matic is not for use as a life-saving device."
34 echo "- Do not call tar-o-matic nasty names. It really hates that."
35 echo "- Avoid developing strong emotional attachment to tar-o-matic."
36 echo "- Keep tar-o-matic away from unmonitored internet connections."
37 echo "- Don't say we didn't warn you."
38 echo ""
39 echo "In case of malfunction, let tar-o-matic know that it is special."
40}
41
42usage()
43{
44 echo Usage: $PROGNAME " version-number cvs-revision [ options ]"
45 echo Options:
46 echo " --help Display this help message"
47 echo " --wxgtk Spin wxGTK"
48 echo " --wxbase Spin wxBase"
49 echo " --wxx11 Spin wxX11"
50 echo " --wxmotif Spin wxMotif"
51 echo " --wxmac Spin wxMac"
52 echo " --wxmgl Spin wxMGL"
53 echo " --docs Spin docs"
54 echo " --all Spin EVERYTHING"
55 echo " --updatecvs Update from CVS"
56 echo " --silent Don't prompt whenever possible"
57 echo " only for use with revisions > 2.6.1"
58 echo " --about about $PROGNAME"
59 echo ""
60 echo "NOTES:"
61 echo "- Set EXTRASDIR environment variable to have any zip files"
62 echo " in that directory copied into deliver/extra for inclusion."
63 echo "- Set WXDISTDIR environment variable to have completed "
64 echo " tarballs put in that directory. This allows for things like"
65 echo " setting a network path for all machines to send files to."
66 echo "- EXTRASDIR defaults to ./extra and WXDISTDIR defaults to ./deliver"
67
68 exit 1
69}
70
71if [ "$1" = "" ] || [ "$1" = "--help" ]; then
72 usage
73 exit
74fi
75
76if [ "$1" = "--about" ]; then
77 about
78 exit
79fi
80
81shift 1
82
83FINDTAG=`echo "$1" | sed /\-\-/p`
84if [ FINDTAG != "" ]; then
85 TAG=$1
86 shift 1
87fi
88
89for i in "$@"; do
90 case "$i" in
91 --wxx11) SPINWXX11=1 ;;
92 --wxgtk) SPINWXGTK=1 ;;
93 --wxmac) SPINWXMAC=1 ;;
94 --wxbase) SPINWXBASE=1 ;;
95 --wxmgl) SPINWXMGL=1 ;;
96 --wxmotif) SPINWXMOTIF=1 ;;
97 --docs) SPINDOCS=1 ;;
98 --all) SPINEVERYTHING=1 ;;
99 --rebake) REBAKE=1 ;;
100 --silent) SILENTFLAG="--silent" ;;
101 --clean-build) CLEANBUILD=1 ;;
102 *)
103 usage
104 exit
105 ;;
106 esac
107done
108
109# checkout wx sources to this tree
110if [ -d ./temp-wx ]; then
111 rm -rf ./temp-wx
112fi
113
114mkdir $STARTDIR/temp-wx
115WXDIR="$STARTDIR/temp-wx/wxWidgets"
116
117TAGNAME=""
118if [ "$TAG" != "" ]; then
119 echo "Checking out wxWidgets revision: $TAG"
120 TAGNAME="-r $TAG"
121else
122 echo "Checking out wxWidgets HEAD sources..."
123fi
124echo "" # add a blank line for readability
125
126# TODO: look into whether or not we need to keep anonymous password, and if so
127# add support for something like expect to at least offer the possibility
128# of automatically entering the password if such a tool is installed
129# on the user's computer. For now people have to type the password manually...
130echo "Grabbing source tree, please use 'anoncvs' for the password when prompted..."
131cd $STARTDIR/temp-wx
132cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
133
134cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout $TAGNAME wxWidgets
135
136#if [ "$REBAKE" = "1" ]; then
137#
138#fi
139
140# Copy extra .zips over to deliver/extra so they'll get picked up...
141if [ ! -d $WXDIR/deliver ]; then
142 mkdir $WXDIR/deliver
143fi
144
145if [ ! -d $WXDIR/deliver/extra ]; then
146 mkdir $WXDIR/deliver/extra
147fi
148
149# allow the user to specify extras dir in an environment variable
150EXTRA_DIR=$STARTDIR/extra
151if [ "$EXTRASDIR" != "" ]; then
152 EXTRA_DIR="$EXTRASDIR"
153fi
154
155for filename in $EXTRA_DIR/*.zip
156do
157 cp $filename $WXDIR/deliver/extra
158done
159
160if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
161 cd $WXDIR
162 sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxmac
163fi
164
165if [ "$SPINEVERYTHING" = "1" ]; then
166 cd $WXDIR
167 sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxall
168fi
169
170if [ "$SPINWXMSW" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
171 cd $WXDIR
172 sh $WXDIR/distrib/msw/makesetup.sh --wxmsw
173fi
174
175if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
176 cd $WXDIR
177 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxbase $SILENTFLAG
178fi
179
180if [ "$SPINWXOS2" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
181 cd $WXDIR
182 sh $WXDIR/distrib/msw/makesetup.sh --wxos2
183fi
184
185if [ "$SPINWXGTK" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
186 cd $WXDIR
187 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxgtk $SILENTFLAG
188fi
189
190if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
191 cd $WXDIR
192 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmotif $SILENTFLAG
193fi
194
195if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
196 cd $WXDIR
197 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmgl $SILENTFLAG
198fi
199
200if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
201 cd $WXDIR
202 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxx11 $SILENTFLAG
203fi
204
205DISTDIR="$STARTDIR/deliver"
206if [ "$WXDISTDIR" != "" ] && [ -d $WXDISTDIR ]; then
207 DISTDIR="$WXDISTDIR"
208fi
209
210# delete any old tarballs
211if [ -d $DISTDIR ]; then
212 rm -rf $DISTDIR
213fi
214
215mkdir $DISTDIR
216
217# copy over the created tarballs
218cp $WXDIR/deliver/*.gz $DISTDIR
219cp $WXDIR/deliver/*.bz2 $DISTDIR
220cp $WXDIR/deliver/*.zip $DISTDIR