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