]>
Commit | Line | Data |
---|---|---|
36e91097 RD |
1 | #!/bin/bash |
2 | # --------------------------------------------------------------------------- | |
3 | # Build the wxPython source RPMs on a Linux box. This is normally called | |
4 | # from build-all but it should be able to be used standalone too... | |
5 | # | |
6 | # The command line must have the following parameters: | |
7 | # | |
d6624155 RD |
8 | # 1. the path of the build dir. The src RPMs will be here when we start |
9 | # and the binary RPMs will be left here when we're done. | |
10 | # 2. skipclean flag (yes|no) | |
11 | # 3. the VERSION | |
12 | # 4. the remaining args are the versions of Python to build for | |
36e91097 RD |
13 | # |
14 | # --------------------------------------------------------------------------- | |
15 | ||
16 | set -o errexit | |
17 | #set -o xtrace | |
18 | ||
19 | echo "-=-=-=- Hello from $HOSTNAME -=-=-=-" | |
20 | ||
5797a657 | 21 | if [ $# -lt 4]; then |
36e91097 RD |
22 | echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..." |
23 | exit 1 | |
24 | fi | |
25 | ||
afbe4a55 | 26 | RELEASE=$1 |
d6624155 RD |
27 | SKIPCLEAN=$2 |
28 | VERSION=$3 | |
29 | shift;shift;shift | |
36e91097 RD |
30 | PYVER=$@ |
31 | ||
afbe4a55 RD |
32 | rpmtop=_rpm_top |
33 | ||
34 | function DoRPMBuild { | |
35 | echo "*** Setting up RPM build dirs" | |
36 | for dir in SPECS BUILD RPMS SRPMS tmp; do | |
37 | if [ ! -d $rpmtop/$dir ]; then | |
38 | mkdir -p $rpmtop/$dir | |
39 | fi | |
40 | done | |
41 | if [ ! -e $rpmtop/SOURCES ]; then | |
42 | ln -s $PWD $rpmtop/SOURCES | |
43 | fi | |
44 | ||
45 | rpmbuild --define "_topdir $PWD/$rpmtop" \ | |
46 | --define "_tmppath $PWD/$rpmtop/tmp" \ | |
47 | --define "release $RELEASE" \ | |
48 | $@ | |
49 | ||
50 | if [ $? != 0 ]; then | |
51 | return $? | |
52 | fi | |
53 | ||
54 | echo "*** Moving RPMs to ." | |
55 | find $rpmtop -name "*.rpm" | |
56 | mv -f `find $rpmtop -name "*.rpm"` . | |
57 | ||
58 | echo "*** Cleaning up $rpmtop" | |
59 | rm -rf $rpmtop | |
60 | } | |
36e91097 RD |
61 | |
62 | ||
36e91097 RD |
63 | |
64 | for ver in $PYVER; do | |
65 | echo "Building the RPMs for Python $ver..." | |
afbe4a55 RD |
66 | for port in GTK GTK2; do |
67 | rpm2cpio wxPython$port-py$ver-$VERSION-1.src.rpm | \ | |
68 | cpio --extract -R root. | |
69 | DoRPMBuild -ba wxPython$port.spec | |
70 | done | |
36e91097 RD |
71 | done |
72 | ||
73 | ||
36e91097 RD |
74 | if [ $SKIPCLEAN != yes ]; then |
75 | echo "Cleaning up..." | |
d6624155 | 76 | for ver in $PYVER; do |
afbe4a55 RD |
77 | rm wxPythonGTK-py$ver-$VERSION-*.src.rpm |
78 | rm wxPythonGTK2-py$ver-$VERSION-*.src.rpm | |
d6624155 | 79 | done |
afbe4a55 | 80 | rm *.spec *.tar.gz |
36e91097 RD |
81 | fi |
82 | ||
83 | echo "-=-=-=- Goodbye! -=-=-=-" |