]> git.saurik.com Git - wxWidgets.git/blame - distrib/tar-o-matic.sh
Typo. Who puts vowels in 'makedirs'? ;-)
[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
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
c4295812 126cd $STARTDIR/temp-wx
e069db2d 127cvs -d:pserver:anoncvs:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login
c4295812
KO
128
129cvs -d :pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets checkout $TAGNAME wxWidgets
130
e069db2d
KO
131if [ "$REBAKE" = "1" ]; then
132 echo "TODO! Implement re-baking..."
133fi
c4295812
KO
134
135# Copy extra .zips over to deliver/extra so they'll get picked up...
136if [ ! -d $WXDIR/deliver ]; then
137 mkdir $WXDIR/deliver
138fi
139
140if [ ! -d $WXDIR/deliver/extra ]; then
141 mkdir $WXDIR/deliver/extra
142fi
143
144# allow the user to specify extras dir in an environment variable
145EXTRA_DIR=$STARTDIR/extra
146if [ "$EXTRASDIR" != "" ]; then
147 EXTRA_DIR="$EXTRASDIR"
148fi
149
150for filename in $EXTRA_DIR/*.zip
151do
152 cp $filename $WXDIR/deliver/extra
153done
154
155if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
156 cd $WXDIR
157 sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxmac
158fi
159
160if [ "$SPINEVERYTHING" = "1" ]; then
161 cd $WXDIR
162 sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxall
163fi
164
165if [ "$SPINWXMSW" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
166 cd $WXDIR
167 sh $WXDIR/distrib/msw/makesetup.sh --wxmsw
168fi
169
170if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
171 cd $WXDIR
172 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxbase $SILENTFLAG
173fi
174
175if [ "$SPINWXOS2" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
176 cd $WXDIR
177 sh $WXDIR/distrib/msw/makesetup.sh --wxos2
178fi
179
180if [ "$SPINWXGTK" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
181 cd $WXDIR
182 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxgtk $SILENTFLAG
183fi
184
185if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
186 cd $WXDIR
187 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmotif $SILENTFLAG
188fi
189
190if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
191 cd $WXDIR
192 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmgl $SILENTFLAG
193fi
194
195if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
196 cd $WXDIR
197 sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxx11 $SILENTFLAG
198fi
199
200DISTDIR="$STARTDIR/deliver"
201if [ "$WXDISTDIR" != "" ] && [ -d $WXDISTDIR ]; then
202 DISTDIR="$WXDISTDIR"
203fi
204
205# delete any old tarballs
206if [ -d $DISTDIR ]; then
207 rm -rf $DISTDIR
208fi
209
210mkdir $DISTDIR
211
212# copy over the created tarballs
213cp $WXDIR/deliver/*.gz $DISTDIR
214cp $WXDIR/deliver/*.bz2 $DISTDIR
215cp $WXDIR/deliver/*.zip $DISTDIR