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