]>
Commit | Line | Data |
---|---|---|
db0834fa | 1 | #!/bin/sh |
77ffb593 | 2 | # Makes the wxWidgets RPMs |
db0834fa | 3 | |
42d9875b JS |
4 | RPMBUILDARGS= |
5 | PLATFORM= | |
6 | ||
db0834fa JS |
7 | doupdatecvs() |
8 | { | |
9 | cd $WXSRC | |
10 | echo Updating from CVS... | |
11 | cvswx update -d -P | |
12 | } | |
13 | ||
14 | dospinwxgtk() | |
15 | { | |
16 | echo Making wxGTK RPMs... | |
17 | RPM_ROOT=$WXDEST/wxgtk/rpm-root | |
18 | ||
19 | if [ ! -d $WXDEST ]; then | |
20 | mkdir $WXDEST | |
21 | fi | |
22 | ||
23 | rm -f -r $WXDEST/wxgtk | |
24 | mkdir $WXDEST/wxgtk | |
25 | mkdir $WXDEST/wxgtk/release | |
26 | mkdir $RPM_ROOT | |
27 | ||
28 | cd $WXSRC | |
29 | cd locale | |
30 | make allmo | |
31 | cd $WXDEST/wxgtk/release | |
32 | echo Configuring... | |
789f8e6a | 33 | $WXSRC/configure --with-gtk --no-recursion |
db0834fa JS |
34 | echo Making... |
35 | make -j1 dist bzip-dist-only | |
36 | ||
37 | echo Setting up RPM build dir $RPM_ROOT... | |
38 | rm -f -r $RPM_ROOT | |
39 | mkdir $RPM_ROOT | |
40 | mkdir $RPM_ROOT/BUILD | |
41 | mkdir $RPM_ROOT/RPMS | |
42 | mkdir $RPM_ROOT/RPMS/i386 | |
43 | mkdir $RPM_ROOT/RPMS/i686 | |
44 | mkdir $RPM_ROOT/RPMS/noarch | |
45 | mkdir $RPM_ROOT/SOURCES | |
46 | mkdir $RPM_ROOT/SPECS | |
47 | mkdir $RPM_ROOT/SRPMS | |
48 | ||
49 | echo %_topdir $RPM_ROOT > ~/.rpmmacros | |
50 | ||
51 | echo Copying wxGTK-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES... | |
52 | cp wxGTK-$WXVER.tar.bz2 $RPM_ROOT/SOURCES | |
53 | echo Copying wxGTK.spec to $RPM_ROOT/SPECS... | |
54 | cp $WXSRC/wxGTK.spec $RPM_ROOT/SPECS | |
55 | ||
42d9875b | 56 | echo Starting wxGTK RPM build, rpmbuild args=$RPMBUILDARGS... |
db0834fa | 57 | cd $RPM_ROOT |
42d9875b | 58 | rpmbuild -ba $RPMBUILDARGS SPECS/wxGTK.spec 2>&1 | tee wxGTK.out |
db0834fa | 59 | |
789f8e6a | 60 | echo Finished wxGTK RPM build, in $RPM_ROOT. |
db0834fa JS |
61 | echo "SRPMS:" |
62 | ls SRPMS | |
63 | echo "RPMS/i386:" | |
64 | ls RPMS/i386 | |
65 | ||
42d9875b | 66 | mkdir $WXDEST/$PLATFORM |
db0834fa | 67 | |
42d9875b JS |
68 | cp $RPM_ROOT/SRPMS/*.rpm $WXDEST/$PLATFORM |
69 | cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST/$PLATFORM | |
70 | cp $WXDEST/wxgtk/release/*.tar.gz $WXDEST/$PLATFORM | |
71 | cp $WXDEST/wxgtk/release/*.tar.bz2 $WXDEST/$PLATFORM | |
72 | ||
73 | # rm -f -r $WXDEST/wxgtk | |
789f8e6a JS |
74 | |
75 | echo Now try the RPMs with rpm -i. | |
76 | } | |
77 | ||
b2cef830 JS |
78 | dospinwxmgl() |
79 | { | |
80 | echo Making wxMGL RPMs... | |
81 | RPM_ROOT=$WXDEST/wxmgl/rpm-root | |
b2cef830 JS |
82 | |
83 | if [ ! -d $WXDEST ]; then | |
84 | mkdir $WXDEST | |
85 | fi | |
86 | ||
87 | rm -f -r $WXDEST/wxmgl | |
88 | mkdir $WXDEST/wxmgl | |
89 | mkdir $WXDEST/wxmgl/release | |
90 | mkdir $RPM_ROOT | |
91 | ||
92 | cd $WXSRC | |
93 | cd locale | |
94 | make allmo | |
95 | cd $WXDEST/wxmgl/release | |
96 | echo Configuring... | |
97 | $WXSRC/configure --with-mgl --no-recursion | |
98 | echo Making... | |
99 | make -j1 dist bzip-dist-only | |
100 | ||
101 | echo Setting up RPM build dir $RPM_ROOT... | |
102 | rm -f -r $RPM_ROOT | |
103 | mkdir $RPM_ROOT | |
104 | mkdir $RPM_ROOT/BUILD | |
105 | mkdir $RPM_ROOT/RPMS | |
106 | mkdir $RPM_ROOT/RPMS/i386 | |
107 | mkdir $RPM_ROOT/RPMS/i686 | |
108 | mkdir $RPM_ROOT/RPMS/noarch | |
109 | mkdir $RPM_ROOT/SOURCES | |
110 | mkdir $RPM_ROOT/SPECS | |
111 | mkdir $RPM_ROOT/SRPMS | |
112 | ||
113 | echo %_topdir $RPM_ROOT > ~/.rpmmacros | |
114 | ||
115 | echo Copying wxMGL-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES... | |
116 | cp wxMGL-$WXVER.tar.bz2 $RPM_ROOT/SOURCES | |
117 | echo Copying wxMGL.spec to $RPM_ROOT/SPECS... | |
118 | cp $WXSRC/wxMGL.spec $RPM_ROOT/SPECS | |
119 | ||
120 | echo Starting wxMGL RPM build... | |
121 | cd $RPM_ROOT | |
122 | rpmbuild -ba SPECS/wxMGL.spec 2>&1 | tee wxMGL.out | |
123 | ||
124 | echo Finished wxMGL RPM build, in $RPM_ROOT. | |
125 | echo "SRPMS:" | |
126 | ls SRPMS | |
127 | echo "RPMS/i386:" | |
128 | ls RPMS/i386 | |
129 | ||
130 | cp $RPM_ROOT/SRPMS/*.rpm $WXDEST | |
42d9875b | 131 | cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST |
b2cef830 JS |
132 | cp $WXDEST/wxmgl/release/*.tar.gz $WXDEST |
133 | cp $WXDEST/wxmgl/release/*.tar.bz2 $WXDEST | |
134 | ||
42d9875b | 135 | # rm -f -r $WXDEST/wxmgl |
b2cef830 JS |
136 | |
137 | echo Now try the RPMs with rpm -i. | |
138 | } | |
139 | ||
789f8e6a JS |
140 | dospinwxmotif() |
141 | { | |
142 | echo Making wxMotif RPMs... | |
143 | RPM_ROOT=$WXDEST/wxmotif/rpm-root | |
144 | ||
145 | if [ ! -d $WXDEST ]; then | |
146 | mkdir $WXDEST | |
147 | fi | |
148 | ||
149 | rm -f -r $WXDEST/wxmotif | |
150 | mkdir $WXDEST/wxmotif | |
151 | mkdir $WXDEST/wxmotif/release | |
152 | mkdir $RPM_ROOT | |
153 | ||
154 | cd $WXSRC | |
155 | cd locale | |
156 | make allmo | |
157 | cd $WXDEST/wxmotif/release | |
158 | echo Configuring... | |
159 | $WXSRC/configure --with-motif --no-recursion | |
160 | echo Making... | |
161 | make -j1 dist bzip-dist-only | |
162 | ||
163 | echo Setting up RPM build dir $RPM_ROOT... | |
164 | rm -f -r $RPM_ROOT | |
165 | mkdir $RPM_ROOT | |
166 | mkdir $RPM_ROOT/BUILD | |
167 | mkdir $RPM_ROOT/RPMS | |
168 | mkdir $RPM_ROOT/RPMS/i386 | |
169 | mkdir $RPM_ROOT/RPMS/i686 | |
170 | mkdir $RPM_ROOT/RPMS/noarch | |
171 | mkdir $RPM_ROOT/SOURCES | |
172 | mkdir $RPM_ROOT/SPECS | |
173 | mkdir $RPM_ROOT/SRPMS | |
174 | ||
175 | echo %_topdir $RPM_ROOT > ~/.rpmmacros | |
176 | ||
177 | echo Copying wxMOTIF-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES... | |
178 | cp wxMOTIF-$WXVER.tar.bz2 $RPM_ROOT/SOURCES | |
179 | echo Copying wxMotif.spec to $RPM_ROOT/SPECS... | |
180 | cp $WXSRC/wxMotif.spec $RPM_ROOT/SPECS | |
181 | ||
182 | echo Starting wxMotif RPM build... | |
183 | cd $RPM_ROOT | |
184 | rpmbuild -ba SPECS/wxMotif.spec 2>&1 | tee wxGTK.out | |
185 | ||
186 | echo Finished wxMotif RPM build, in $RPM_ROOT. | |
187 | echo "SRPMS:" | |
188 | ls SRPMS | |
189 | echo "RPMS/i386:" | |
190 | ls RPMS/i386 | |
191 | ||
192 | cp $RPM_ROOT/SRPMS/*.rpm $WXDEST | |
42d9875b | 193 | cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST |
789f8e6a JS |
194 | cp $WXDEST/wxmotif/release/*.tar.gz $WXDEST |
195 | cp $WXDEST/wxmotif/release/*.tar.bz2 $WXDEST | |
196 | ||
197 | echo Rearchiving wxMotif tarballs to change wxMOTIF to wxMotif... | |
198 | cd $WXDEST | |
199 | mkdir wxMotif.tmp | |
200 | cd wxMotif.tmp | |
201 | rm -f -r * | |
202 | tar xfz ../wxMOTIF-$WXVER.tar.gz | |
203 | mv wxMOTIF-$WXVER wxMotif-$WXVER | |
204 | rm -f ../wxMOTIF-$WXVER.tar.gz | |
205 | rm -f ../wxMOTIF-$WXVER.tar.bz2 | |
206 | tar cf ../wxMotif-$WXVER.tar * | |
207 | gzip -c ../wxMotif-$WXVER.tar > ../wxMotif-$WXVER.tar.gz | |
208 | bzip2 -f9 ../wxMotif-$WXVER.tar | |
209 | cd .. | |
210 | rm -f -r wxMotif.tmp | |
42d9875b | 211 | # rm -f -r $WXDEST/wxmotif |
789f8e6a JS |
212 | |
213 | echo Now try the RPMs with rpm -i. | |
214 | } | |
215 | ||
216 | dospinwxmac() | |
217 | { | |
218 | echo Making wxMac tarballs... | |
219 | echo Note that this must be done on a Mac. | |
220 | if [ ! -d $WXDEST ]; then | |
221 | mkdir $WXDEST | |
222 | fi | |
223 | ||
224 | rm -f -r $WXDEST/wxmac | |
225 | mkdir $WXDEST/wxmac | |
226 | mkdir $WXDEST/wxmac/release | |
227 | ||
228 | cd $WXSRC | |
229 | cd locale | |
230 | make allmo | |
231 | cd $WXDEST/wxmac/release | |
232 | echo Configuring... | |
233 | $WXSRC/configure --with-mac --no-recursion | |
234 | echo Making... | |
235 | make -j1 dist bzip-dist-only | |
236 | ||
237 | cp $WXDEST/wxmac/release/*.tar.gz $WXDEST | |
238 | cp $WXDEST/wxmac/release/*.tar.bz2 $WXDEST | |
239 | ||
240 | echo Rearchiving wxMac tarballs to change wxMAC to wxMAC... | |
241 | cd $WXDEST | |
242 | mkdir wxMac.tmp | |
243 | cd wxMac.tmp | |
244 | rm -f -r * | |
245 | tar xfz ../wxMac-$WXVER.tar.gz | |
246 | mv wxMAC-$WXVER wxMac-$WXVER | |
247 | rm -f ../wxMAC-$WXVER.tar.gz | |
248 | rm -f ../wxMAC-$WXVER.tar.bz2 | |
249 | tar cf ../wxMac-$WXVER.tar * | |
250 | gzip -c ../wxMac-$WXVER.tar > ../wxMac-$WXVER.tar.gz | |
251 | bzip2 -f9 ../wxMac-$WXVER.tar | |
252 | cd .. | |
253 | rm -f -r wxMac.tmp | |
254 | ||
255 | rm -f -r $WXDEST/wxmac | |
db0834fa JS |
256 | echo Now try the RPMs with rpm -i. |
257 | } | |
258 | ||
259 | dospinwxbase() | |
260 | { | |
261 | echo Making wxBase RPMs... | |
262 | RPM_ROOT=$WXDEST/wxbase/rpm-root | |
263 | ||
264 | if [ ! -d $WXDEST ]; then | |
265 | mkdir $WXDEST | |
266 | fi | |
267 | ||
268 | rm -f -r $WXDEST/wxbase | |
269 | mkdir $WXDEST/wxbase | |
270 | mkdir $WXDEST/wxbase/release | |
271 | mkdir $RPM_ROOT | |
272 | ||
273 | cd $WXSRC | |
274 | cd locale | |
275 | make allmo | |
276 | cd $WXDEST/wxbase/release | |
277 | echo Configuring... | |
278 | $WXSRC/configure --disable-gui --no-recursion | |
279 | echo Making... | |
280 | make -j1 dist bzip-dist-only | |
281 | ||
282 | echo Setting up RPM build dir $RPM_ROOT... | |
283 | rm -f -r $RPM_ROOT | |
284 | mkdir $RPM_ROOT | |
285 | mkdir $RPM_ROOT/BUILD | |
286 | mkdir $RPM_ROOT/RPMS | |
287 | mkdir $RPM_ROOT/RPMS/i386 | |
288 | mkdir $RPM_ROOT/RPMS/i686 | |
289 | mkdir $RPM_ROOT/RPMS/noarch | |
290 | mkdir $RPM_ROOT/SOURCES | |
291 | mkdir $RPM_ROOT/SPECS | |
292 | mkdir $RPM_ROOT/SRPMS | |
293 | ||
294 | echo %_topdir $RPM_ROOT > ~/.rpmmacros | |
295 | ||
296 | echo Copying wxBase-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES... | |
297 | cp wxBase-$WXVER.tar.bz2 $RPM_ROOT/SOURCES | |
298 | echo Copying wxBase.spec to $RPM_ROOT/SPECS... | |
299 | cp $WXSRC/wxBase.spec $RPM_ROOT/SPECS | |
300 | ||
301 | echo Starting wxBase RPM build... | |
302 | cd $RPM_ROOT | |
303 | rpmbuild -ba SPECS/wxBase.spec 2>&1 | tee wxBase.out | |
304 | ||
305 | echo Finished wxBase RPM build, in $RPM_ROOT. | |
306 | echo "SRPMS:" | |
307 | ls SRPMS | |
308 | echo "RPMS/i386:" | |
309 | ls RPMS/i386 | |
310 | ||
311 | cp $RPM_ROOT/SRPMS/*.rpm $WXDEST | |
42d9875b | 312 | cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST |
db0834fa JS |
313 | cp $WXDEST/wxbase/release/*.tar.gz $WXDEST |
314 | cp $WXDEST/wxbase/release/*.tar.bz2 $WXDEST | |
315 | ||
42d9875b | 316 | # rm -f -r $WXDEST/wxbase |
db0834fa JS |
317 | echo Now try the RPMs with rpm -i. |
318 | } | |
319 | ||
320 | dospinwxx11() | |
321 | { | |
322 | echo Making wxX11 RPMs... | |
323 | RPM_ROOT=$WXDEST/wxx11/rpm-root | |
324 | ||
325 | if [ ! -d $WXDEST ]; then | |
326 | mkdir $WXDEST | |
327 | fi | |
328 | ||
329 | rm -f -r $WXDEST/wxx11 | |
330 | mkdir $WXDEST/wxx11 | |
331 | mkdir $WXDEST/wxx11/release | |
332 | mkdir $RPM_ROOT | |
333 | ||
334 | cd $WXSRC | |
335 | cd locale | |
336 | make allmo | |
337 | cd $WXDEST/wxx11/release | |
338 | echo Configuring... | |
339 | $WXSRC/configure --with-x11 --no-recursion | |
340 | echo Making... | |
341 | make -j1 dist bzip-dist-only | |
342 | ||
343 | echo Setting up RPM build dir $RPM_ROOT... | |
344 | rm -f -r $RPM_ROOT | |
345 | mkdir $RPM_ROOT | |
346 | mkdir $RPM_ROOT/BUILD | |
347 | mkdir $RPM_ROOT/RPMS | |
348 | mkdir $RPM_ROOT/RPMS/i386 | |
349 | mkdir $RPM_ROOT/RPMS/i686 | |
350 | mkdir $RPM_ROOT/RPMS/noarch | |
351 | mkdir $RPM_ROOT/SOURCES | |
352 | mkdir $RPM_ROOT/SPECS | |
353 | mkdir $RPM_ROOT/SRPMS | |
354 | ||
355 | echo %_topdir $RPM_ROOT > ~/.rpmmacros | |
356 | ||
357 | echo Copying wxX11-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES... | |
358 | cp wxX11-$WXVER.tar.bz2 $RPM_ROOT/SOURCES | |
359 | echo Copying wxX11.spec to $RPM_ROOT/SPECS... | |
360 | cp $WXSRC/wxX11.spec $RPM_ROOT/SPECS | |
361 | ||
362 | echo Starting wxX11 RPM build... | |
363 | cd $RPM_ROOT | |
364 | rpmbuild -ba SPECS/wxX11.spec 2>&1 | tee wxX11.out | |
365 | ||
366 | echo Finished wxX11 RPM build, in $RPM_ROOT. | |
367 | echo "SRPMS:" | |
368 | ls SRPMS | |
369 | echo "RPMS/i386:" | |
370 | ls RPMS/i386 | |
371 | ||
372 | cp $RPM_ROOT/SRPMS/*.rpm $WXDEST | |
42d9875b | 373 | cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST |
db0834fa JS |
374 | cp $WXDEST/wxx11/release/*.tar.gz $WXDEST |
375 | cp $WXDEST/wxx11/release/*.tar.bz2 $WXDEST | |
376 | ||
42d9875b | 377 | # rm -f -r $WXDEST/wxx11 |
db0834fa JS |
378 | echo Now try the RPMs with rpm -i. |
379 | } | |
380 | ||
db0834fa JS |
381 | PROGNAME=$0 |
382 | WXSRC=$1 | |
383 | WXDEST=$2 | |
384 | WXVER=$3 | |
385 | ||
386 | SPINWXX11=0 | |
42d9875b JS |
387 | SPINWXGTK1=0 |
388 | SPINWXGTK2=0 | |
389 | SPINWXGTK2UNICODE=0 | |
789f8e6a JS |
390 | SPINWXMAC=0 |
391 | SPINWXMOTIF=0 | |
db0834fa | 392 | SPINWXBASE=0 |
b2cef830 | 393 | SPINWXMGL=0 |
db0834fa JS |
394 | SPINEVERYTHING=0 |
395 | UPDATECVS=0 | |
396 | ||
397 | usage() | |
398 | { | |
399 | echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]" | |
400 | echo Options: | |
42d9875b JS |
401 | echo " --help Display this help message" |
402 | echo " --wxgtk1 Spin wxGTK1 RPMs" | |
403 | echo " --wxgtk2 Spin wxGTK2 RPMs" | |
404 | echo " --wxgtk2unicode Spin wxGTK2 Unicode RPMs" | |
405 | echo " --wxbase Spin wxBase RPMs" | |
406 | echo " --wxx11 Spin wxX11 RPMs" | |
407 | echo " --wxmotif Spin wxMotif RPMs" | |
408 | echo " --wxmgl Spin wxMGL RPMs" | |
409 | echo " --wxmac Make wxMac tarball" | |
410 | echo " --all Spin EVERYTHING" | |
411 | echo " --updatecvs Update from CVS" | |
db0834fa JS |
412 | |
413 | exit 1 | |
414 | } | |
415 | ||
3885ccc5 JS |
416 | init="" |
417 | if [ "$1" = "" ] | |
418 | then | |
419 | usage | |
420 | exit | |
421 | fi | |
422 | ||
423 | if [ "$2" = "" ] | |
424 | then | |
425 | usage | |
426 | exit | |
427 | fi | |
428 | ||
429 | if [ "$3" = "" ] | |
430 | then | |
431 | usage | |
432 | exit | |
433 | fi | |
434 | ||
db0834fa JS |
435 | # Process command line options. |
436 | shift 3 | |
437 | for i in "$@"; do | |
438 | case "$i" in | |
439 | --wxx11) SPINWXX11=1 ;; | |
42d9875b JS |
440 | --wxgtk1) SPINWXGTK1=1 ;; |
441 | --wxgtk2) SPINWXGTK2=1 ;; | |
442 | --wxgtk2unicode) SPINWXGTK2UNICODE=1 ;; | |
789f8e6a | 443 | --wxmotif) SPINWXMOTIF=1 ;; |
b2cef830 | 444 | --wxmgl) SPINWXMGL=1 ;; |
789f8e6a | 445 | --wxmac) SPINWXMAC=1 ;; |
db0834fa JS |
446 | --wxbase) SPINWXBASE=1 ;; |
447 | --all) SPINEVERYTHING=1 ;; | |
448 | --updatecvs) UPDATECVS=1 ;; | |
449 | *) | |
450 | usage | |
451 | exit | |
452 | ;; | |
453 | esac | |
454 | done | |
455 | ||
77ffb593 | 456 | echo About to make wxWidgets RPMs: |
db0834fa JS |
457 | echo From $WXSRC |
458 | echo To $WXDEST | |
459 | echo Version $WXVER | |
460 | echo CTRL-C if this is not correct. | |
461 | read dummy | |
462 | ||
463 | if [ "$UPDATECVS" = "1" ]; then | |
464 | doupdatecvs | |
465 | fi | |
466 | ||
467 | if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
468 | dospinwxx11 | |
469 | fi | |
470 | ||
42d9875b JS |
471 | if [ "$SPINWXGTK1" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then |
472 | RPMBUILDARGS= | |
473 | PLATFORM=gtk1 | |
474 | dospinwxgtk | |
475 | fi | |
476 | ||
477 | if [ "$SPINWXGTK2" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
478 | RPMBUILDARGS="--with gtk2" | |
479 | PLATFORM=gtk2 | |
480 | dospinwxgtk | |
481 | fi | |
482 | ||
483 | if [ "$SPINWXGTK2UNICODE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
484 | RPMBUILDARGS="--with gtk2 --with unicode" | |
485 | PLATFORM=gtk2unicode | |
db0834fa JS |
486 | dospinwxgtk |
487 | fi | |
488 | ||
489 | if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then | |
490 | dospinwxbase | |
491 | fi | |
492 | ||
789f8e6a JS |
493 | if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then |
494 | dospinwxmotif | |
495 | fi | |
496 | ||
b2cef830 JS |
497 | if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then |
498 | dospinwxmgl | |
499 | fi | |
500 | ||
4c7848f1 | 501 | if [ "$SPINWXMAC" = "1" ]; then |
789f8e6a JS |
502 | dospinwxmac |
503 | fi | |
504 |