]>
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 | ||
f5ed42f8 RD |
21 | if [ $# -lt 5 ]; then |
22 | echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER CHARTYPE" | |
36e91097 RD |
23 | exit 1 |
24 | fi | |
25 | ||
afbe4a55 | 26 | RELEASE=$1 |
d6624155 RD |
27 | SKIPCLEAN=$2 |
28 | VERSION=$3 | |
f5ed42f8 RD |
29 | PYVER=$4 |
30 | CHARTYPE=$5 | |
36e91097 | 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 | |
e4bb5998 RD |
45 | |
46 | echo "-=-=-=-=-=-=-=-=-=-=-" | |
47 | echo $1 $2 $3 | |
48 | echo "-=-=-=-=-=-=-=-=-=-=-" | |
49 | ||
b8419d9a | 50 | $RPMBUILD --define "_topdir $PWD/$rpmtop" \ |
afbe4a55 | 51 | --define "_tmppath $PWD/$rpmtop/tmp" \ |
28d1454a RD |
52 | --define "release ${RELEASE}_py$1" \ |
53 | --define "pyver $1" \ | |
54 | --define "port $2" \ | |
55 | --define "unicode $3" \ | |
56 | -bb wxPython.spec | |
afbe4a55 RD |
57 | |
58 | if [ $? != 0 ]; then | |
59 | return $? | |
60 | fi | |
28d1454a | 61 | } |
afbe4a55 | 62 | |
afbe4a55 | 63 | |
36e91097 | 64 | |
28d1454a RD |
65 | echo "*** Setting up RPM build dirs" |
66 | for dir in SPECS BUILD RPMS SOURCES SRPMS tmp; do | |
67 | if [ ! -d $rpmtop/$dir ]; then | |
68 | mkdir -p $rpmtop/$dir | |
69 | fi | |
70 | done | |
36e91097 | 71 | |
bf158fe6 | 72 | cp wxPython-src-$VERSION.tar.bz2 $rpmtop/SOURCES |
36e91097 | 73 | |
f5ed42f8 RD |
74 | echo "************************************************" |
75 | echo "Building the RPMs for Python $PYVER, $CHARTYPE" | |
2bf6b425 | 76 | |
f5ed42f8 RD |
77 | ## for now let's just do the gtk2 builds |
78 | ##if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then | |
79 | ## DoRPMBuild $ver gtk 0 | |
80 | ##fi | |
2bf6b425 | 81 | |
f5ed42f8 RD |
82 | if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then |
83 | DoRPMBuild $PYVER gtk2 0 | |
84 | fi | |
85 | if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then | |
86 | DoRPMBuild $PYVER gtk2 1 | |
87 | fi | |
36e91097 RD |
88 | |
89 | ||
28d1454a RD |
90 | echo "*** Moving RPMs to ." |
91 | find $rpmtop -name "*.rpm" | |
92 | mv -f `find $rpmtop -name "*.rpm"` . | |
93 | ||
94 | ||
36e91097 | 95 | if [ $SKIPCLEAN != yes ]; then |
28d1454a RD |
96 | echo "*** Cleaning up $rpmtop" |
97 | rm -rf $rpmtop | |
98 | ||
36e91097 | 99 | echo "Cleaning up..." |
bf158fe6 | 100 | rm *.spec *.tar.bz2 |
36e91097 RD |
101 | fi |
102 | ||
103 | echo "-=-=-=- Goodbye! -=-=-=-" |