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