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