]>
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 | ||
ba9a8985 | 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 | ||
b8419d9a RD |
34 | if which rpmbuild > /dev/null 2>&1; then |
35 | RPMBUILD=rpmbuild | |
36 | else | |
37 | RPMBUILD=rpm | |
38 | fi | |
39 | ||
40 | ||
afbe4a55 | 41 | function DoRPMBuild { |
28d1454a RD |
42 | # $1 : python version |
43 | # $2 : port | |
44 | # $3 : unicode | |
45 | ||
b8419d9a | 46 | $RPMBUILD --define "_topdir $PWD/$rpmtop" \ |
afbe4a55 | 47 | --define "_tmppath $PWD/$rpmtop/tmp" \ |
28d1454a RD |
48 | --define "release ${RELEASE}_py$1" \ |
49 | --define "pyver $1" \ | |
50 | --define "port $2" \ | |
51 | --define "unicode $3" \ | |
52 | -bb wxPython.spec | |
afbe4a55 RD |
53 | |
54 | if [ $? != 0 ]; then | |
55 | return $? | |
56 | fi | |
28d1454a | 57 | } |
afbe4a55 | 58 | |
afbe4a55 | 59 | |
36e91097 | 60 | |
28d1454a RD |
61 | echo "*** Setting up RPM build dirs" |
62 | for dir in SPECS BUILD RPMS SOURCES SRPMS tmp; do | |
63 | if [ ! -d $rpmtop/$dir ]; then | |
64 | mkdir -p $rpmtop/$dir | |
65 | fi | |
66 | done | |
36e91097 | 67 | |
28d1454a | 68 | cp wxPython-src-$VERSION.tar.gz $rpmtop/SOURCES |
36e91097 | 69 | |
28d1454a | 70 | echo "******************** PYVER = " $PYVER |
36e91097 RD |
71 | for ver in $PYVER; do |
72 | echo "Building the RPMs for Python $ver..." | |
28d1454a RD |
73 | DoRPMBuild $ver gtk 0 |
74 | DoRPMBuild $ver gtk2 1 | |
75 | DoRPMBuild $ver gtk2 0 | |
36e91097 RD |
76 | done |
77 | ||
78 | ||
28d1454a RD |
79 | echo "*** Moving RPMs to ." |
80 | find $rpmtop -name "*.rpm" | |
81 | mv -f `find $rpmtop -name "*.rpm"` . | |
82 | ||
83 | ||
36e91097 | 84 | if [ $SKIPCLEAN != yes ]; then |
28d1454a RD |
85 | echo "*** Cleaning up $rpmtop" |
86 | rm -rf $rpmtop | |
87 | ||
36e91097 | 88 | echo "Cleaning up..." |
afbe4a55 | 89 | rm *.spec *.tar.gz |
36e91097 RD |
90 | fi |
91 | ||
92 | echo "-=-=-=- Goodbye! -=-=-=-" |