]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/makerpm
fix path for pdf
[wxWidgets.git] / distrib / msw / makerpm
1 #!/bin/sh
2 # Makes the wxWidgets RPMs
3
4 RPMBUILDARGS=
5 PLATFORM=
6
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...
33 $WXSRC/configure --with-gtk --no-recursion
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
56 echo Starting wxGTK RPM build, rpmbuild args=$RPMBUILDARGS...
57 cd $RPM_ROOT
58 rpmbuild -ba $RPMBUILDARGS SPECS/wxGTK.spec 2>&1 | tee wxGTK.out
59
60 echo Finished wxGTK RPM build, in $RPM_ROOT.
61 echo "SRPMS:"
62 ls SRPMS
63 echo "RPMS/i386:"
64 ls RPMS/i386
65
66 mkdir $WXDEST/$PLATFORM
67
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
74
75 echo Now try the RPMs with rpm -i.
76 }
77
78 dospinwxmgl()
79 {
80 echo Making wxMGL RPMs...
81 RPM_ROOT=$WXDEST/wxmgl/rpm-root
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
131 cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST
132 cp $WXDEST/wxmgl/release/*.tar.gz $WXDEST
133 cp $WXDEST/wxmgl/release/*.tar.bz2 $WXDEST
134
135 # rm -f -r $WXDEST/wxmgl
136
137 echo Now try the RPMs with rpm -i.
138 }
139
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
193 cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST
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
211 # rm -f -r $WXDEST/wxmotif
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
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, rpmbuild args=$RPMBUILDARGS...
302 cd $RPM_ROOT
303 rpmbuild -ba $RPMBUILDARGS 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 mkdir $WXDEST/$PLATFORM
312
313 cp $RPM_ROOT/SRPMS/*.rpm $WXDEST/$PLATFORM
314 cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST/$PLATFORM
315 cp $WXDEST/wxbase/release/*.tar.gz $WXDEST/$PLATFORM
316 cp $WXDEST/wxbase/release/*.tar.bz2 $WXDEST/$PLATFORM
317
318 # rm -f -r $WXDEST/wxbase
319 echo Now try the RPMs with rpm -i.
320 }
321
322 dospinwxx11()
323 {
324 echo Making wxX11 RPMs...
325 RPM_ROOT=$WXDEST/wxx11/rpm-root
326
327 if [ ! -d $WXDEST ]; then
328 mkdir $WXDEST
329 fi
330
331 rm -f -r $WXDEST/wxx11
332 mkdir $WXDEST/wxx11
333 mkdir $WXDEST/wxx11/release
334 mkdir $RPM_ROOT
335
336 cd $WXSRC
337 cd locale
338 make allmo
339 cd $WXDEST/wxx11/release
340 echo Configuring...
341 $WXSRC/configure --with-x11 --no-recursion
342 echo Making...
343 make -j1 dist bzip-dist-only
344
345 echo Setting up RPM build dir $RPM_ROOT...
346 rm -f -r $RPM_ROOT
347 mkdir $RPM_ROOT
348 mkdir $RPM_ROOT/BUILD
349 mkdir $RPM_ROOT/RPMS
350 mkdir $RPM_ROOT/RPMS/i386
351 mkdir $RPM_ROOT/RPMS/i686
352 mkdir $RPM_ROOT/RPMS/noarch
353 mkdir $RPM_ROOT/SOURCES
354 mkdir $RPM_ROOT/SPECS
355 mkdir $RPM_ROOT/SRPMS
356
357 echo %_topdir $RPM_ROOT > ~/.rpmmacros
358
359 echo Copying wxX11-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES...
360 cp wxX11-$WXVER.tar.bz2 $RPM_ROOT/SOURCES
361 echo Copying wxX11.spec to $RPM_ROOT/SPECS...
362 cp $WXSRC/wxX11.spec $RPM_ROOT/SPECS
363
364 echo Starting wxX11 RPM build...
365 cd $RPM_ROOT
366 rpmbuild -ba SPECS/wxX11.spec 2>&1 | tee wxX11.out
367
368 echo Finished wxX11 RPM build, in $RPM_ROOT.
369 echo "SRPMS:"
370 ls SRPMS
371 echo "RPMS/i386:"
372 ls RPMS/i386
373
374 cp $RPM_ROOT/SRPMS/*.rpm $WXDEST
375 cp $RPM_ROOT/RPMS/i386/*.rpm $WXDEST
376 cp $WXDEST/wxx11/release/*.tar.gz $WXDEST
377 cp $WXDEST/wxx11/release/*.tar.bz2 $WXDEST
378
379 # rm -f -r $WXDEST/wxx11
380 echo Now try the RPMs with rpm -i.
381 }
382
383 PROGNAME=$0
384 WXSRC=$1
385 WXDEST=$2
386 WXVER=$3
387
388 SPINWXX11=0
389 SPINWXGTK1=0
390 SPINWXGTK2=0
391 SPINWXGTK2UNICODE=0
392 SPINWXMAC=0
393 SPINWXMOTIF=0
394 SPINWXBASE=0
395 SPINWXBASEUNICODE=0
396 SPINWXMGL=0
397 SPINEVERYTHING=0
398 UPDATECVS=0
399
400 usage()
401 {
402 echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]"
403 echo Options:
404 echo " --help Display this help message"
405 echo " --wxgtk1 Spin wxGTK1 RPMs"
406 echo " --wxgtk2 Spin wxGTK2 RPMs"
407 echo " --wxgtk2unicode Spin wxGTK2 Unicode RPMs"
408 echo " --wxbase Spin wxBase RPMs"
409 echo " --wxbaseunicode Spin wxBase Unicode RPMs"
410 echo " --wxx11 Spin wxX11 RPMs"
411 echo " --wxmotif Spin wxMotif RPMs"
412 echo " --wxmgl Spin wxMGL RPMs"
413 echo " --wxmac Make wxMac tarball"
414 echo " --all Spin EVERYTHING"
415 echo " --updatecvs Update from CVS"
416
417 exit 1
418 }
419
420 init=""
421 if [ "$1" = "" ]
422 then
423 usage
424 exit
425 fi
426
427 if [ "$2" = "" ]
428 then
429 usage
430 exit
431 fi
432
433 if [ "$3" = "" ]
434 then
435 usage
436 exit
437 fi
438
439 # Process command line options.
440 shift 3
441 for i in "$@"; do
442 case "$i" in
443 --wxx11) SPINWXX11=1 ;;
444 --wxgtk1) SPINWXGTK1=1 ;;
445 --wxgtk2) SPINWXGTK2=1 ;;
446 --wxgtk2unicode) SPINWXGTK2UNICODE=1 ;;
447 --wxmotif) SPINWXMOTIF=1 ;;
448 --wxmgl) SPINWXMGL=1 ;;
449 --wxmac) SPINWXMAC=1 ;;
450 --wxbase) SPINWXBASE=1 ;;
451 --wxbaseunicode) SPINWXBASEUNICODE=1 ;;
452 --all) SPINEVERYTHING=1 ;;
453 --updatecvs) UPDATECVS=1 ;;
454 *)
455 usage
456 exit
457 ;;
458 esac
459 done
460
461 echo About to make wxWidgets RPMs:
462 echo From $WXSRC
463 echo To $WXDEST
464 echo Version $WXVER
465 echo CTRL-C if this is not correct.
466 read dummy
467
468 if [ "$UPDATECVS" = "1" ]; then
469 doupdatecvs
470 fi
471
472 if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
473 dospinwxx11
474 fi
475
476 if [ "$SPINWXGTK1" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
477 RPMBUILDARGS=
478 PLATFORM=gtk1
479 dospinwxgtk
480 fi
481
482 if [ "$SPINWXGTK2" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
483 RPMBUILDARGS="--with gtk2"
484 PLATFORM=gtk2
485 dospinwxgtk
486 fi
487
488 if [ "$SPINWXGTK2UNICODE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
489 RPMBUILDARGS="--with gtk2 --with unicode"
490 PLATFORM=gtk2unicode
491 dospinwxgtk
492 fi
493
494 if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
495 PLATFORM=base
496 dospinwxbase
497 fi
498
499 if [ "$SPINWXBASEUNICODE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
500 RPMBUILDARGS="--with unicode"
501 PLATFORM=baseunicode
502 dospinwxbase
503 fi
504
505 if [ "$SPINWXMOTIF" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
506 dospinwxmotif
507 fi
508
509 if [ "$SPINWXMGL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
510 dospinwxmgl
511 fi
512
513 if [ "$SPINWXMAC" = "1" ]; then
514 dospinwxmac
515 fi
516