]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | ||
3 | # create wx tarballs automatically given a tag, or from CVS HEAD | |
4 | PROGNAME=$0 | |
5 | VERSION=$1 | |
6 | TAG="" | |
7 | STARTDIR=$PWD | |
8 | ||
9 | SPINWXX11=0 | |
10 | SPINWXGTK=0 | |
11 | SPINWXMOTIF=0 | |
12 | SPINWXMAC=0 | |
13 | SPINWXBASE=0 | |
14 | SPINWXMGL=0 | |
15 | SPINDOCS=0 | |
16 | SPINEVERYTHING=0 | |
17 | REBAKE=0 | |
18 | ||
19 | SILENTFLAG="" | |
20 | ||
21 | about() | |
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 | ||
42 | usage() | |
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 | ||
71 | if [ "$1" = "" ] || [ "$1" = "--help" ]; then | |
72 | usage | |
73 | exit | |
74 | fi | |
75 | ||
76 | if [ "$1" = "--about" ]; then | |
77 | about | |
78 | exit | |
79 | fi | |
80 | ||
81 | shift 1 | |
82 | ||
83 | FINDTAG=`echo "$1" | sed /\-\-/p` | |
84 | if [ FINDTAG != "" ]; then | |
85 | TAG=$1 | |
86 | shift 1 | |
87 | fi | |
88 | ||
89 | for 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 | |
107 | done | |
108 | ||
109 | # checkout wx sources to this tree | |
110 | if [ -d ./temp-wx ]; then | |
111 | rm -rf ./temp-wx | |
112 | fi | |
113 | ||
114 | mkdir $STARTDIR/temp-wx | |
115 | WXDIR="$STARTDIR/temp-wx/wxWidgets" | |
116 | ||
117 | TAGNAME="" | |
118 | if [ "$TAG" != "" ]; then | |
119 | echo "Checking out wxWidgets revision: $TAG" | |
120 | TAGNAME="-r $TAG" | |
121 | else | |
122 | echo "Checking out wxWidgets HEAD sources..." | |
123 | fi | |
124 | echo "" # 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... | |
130 | echo "Grabbing source tree, please use 'anoncvs' for the password when prompted..." | |
131 | cd $STARTDIR/temp-wx | |
132 | cvs -d:pserver:anoncvs@cvs.wxwidgets.org:/pack/cvsroots/wxwidgets login | |
133 | ||
134 | cvs -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... | |
141 | if [ ! -d $WXDIR/deliver ]; then | |
142 | mkdir $WXDIR/deliver | |
143 | fi | |
144 | ||
145 | if [ ! -d $WXDIR/deliver/extra ]; then | |
146 | mkdir $WXDIR/deliver/extra | |
147 | fi | |
148 | ||
149 | # allow the user to specify extras dir in an environment variable | |
150 | EXTRA_DIR=$STARTDIR/extra | |
151 | if [ "$EXTRASDIR" != "" ]; then | |
152 | EXTRA_DIR="$EXTRASDIR" | |
153 | fi | |
154 | ||
155 | for filename in $EXTRA_DIR/*.zip | |
156 | do | |
157 | cp $filename $WXDIR/deliver/extra | |
158 | done | |
159 | ||
160 | if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
161 | cd $WXDIR | |
162 | sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxmac | |
163 | fi | |
164 | ||
165 | if [ "$SPINEVERYTHING" = "1" ]; then | |
166 | cd $WXDIR | |
167 | sh $WXDIR/distrib/msw/tardist $WXDIR $WXDIR/deliver $VERSION --wxall | |
168 | fi | |
169 | ||
170 | if [ "$SPINWXMSW" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
171 | cd $WXDIR | |
172 | sh $WXDIR/distrib/msw/makesetup.sh --wxmsw | |
173 | fi | |
174 | ||
175 | if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
176 | cd $WXDIR | |
177 | sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxbase $SILENTFLAG | |
178 | fi | |
179 | ||
180 | if [ "$SPINWXOS2" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
181 | cd $WXDIR | |
182 | sh $WXDIR/distrib/msw/makesetup.sh --wxos2 | |
183 | fi | |
184 | ||
185 | if [ "$SPINWXGTK" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
186 | cd $WXDIR | |
187 | sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxgtk $SILENTFLAG | |
188 | fi | |
189 | ||
190 | if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
191 | cd $WXDIR | |
192 | sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmotif $SILENTFLAG | |
193 | fi | |
194 | ||
195 | if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
196 | cd $WXDIR | |
197 | sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxmgl $SILENTFLAG | |
198 | fi | |
199 | ||
200 | if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
201 | cd $WXDIR | |
202 | sh $WXDIR/distrib/msw/maketarballs $WXDIR $WXDIR/deliver $VERSION --wxx11 $SILENTFLAG | |
203 | fi | |
204 | ||
205 | DISTDIR="$STARTDIR/deliver" | |
206 | if [ "$WXDISTDIR" != "" ] && [ -d $WXDISTDIR ]; then | |
207 | DISTDIR="$WXDISTDIR" | |
208 | fi | |
209 | ||
210 | # delete any old tarballs | |
211 | if [ -d $DISTDIR ]; then | |
212 | rm -rf $DISTDIR | |
213 | fi | |
214 | ||
215 | mkdir $DISTDIR | |
216 | ||
217 | # copy over the created tarballs | |
218 | cp $WXDIR/deliver/*.gz $DISTDIR | |
219 | cp $WXDIR/deliver/*.bz2 $DISTDIR | |
220 | cp $WXDIR/deliver/*.zip $DISTDIR |