]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/distrib/all/do-build-rpm
Build and distrib tweaks ported over from the 2.6 branch
[wxWidgets.git] / wxPython / distrib / all / do-build-rpm
... / ...
CommitLineData
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#
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
13#
14# ---------------------------------------------------------------------------
15
16set -o errexit
17#set -o xtrace
18
19echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
20
21if [ $# -lt 4 ]; then
22 echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
23 exit 1
24fi
25
26RELEASE=$1
27SKIPCLEAN=$2
28VERSION=$3
29shift;shift;shift
30PYVER=$@
31
32rpmtop=_rpm_top
33
34if which rpmbuild > /dev/null 2>&1; then
35 RPMBUILD=rpmbuild
36else
37 RPMBUILD=rpm
38fi
39
40
41function DoRPMBuild {
42 # $1 : python version
43 # $2 : port
44 # $3 : unicode
45
46 echo "-=-=-=-=-=-=-=-=-=-=-"
47 echo $1 $2 $3
48 echo "-=-=-=-=-=-=-=-=-=-=-"
49
50 $RPMBUILD --define "_topdir $PWD/$rpmtop" \
51 --define "_tmppath $PWD/$rpmtop/tmp" \
52 --define "release ${RELEASE}_py$1" \
53 --define "pyver $1" \
54 --define "port $2" \
55 --define "unicode $3" \
56 -bb wxPython.spec
57
58 if [ $? != 0 ]; then
59 return $?
60 fi
61}
62
63
64
65echo "*** Setting up RPM build dirs"
66for dir in SPECS BUILD RPMS SOURCES SRPMS tmp; do
67 if [ ! -d $rpmtop/$dir ]; then
68 mkdir -p $rpmtop/$dir
69 fi
70done
71
72cp wxPython-src-$VERSION.tar.bz2 $rpmtop/SOURCES
73
74echo "******************** PYVER = " $PYVER
75for ver in $PYVER; do
76 echo "Building the RPMs for Python $ver..."
77
78 ## for now let's just do the gtk2 builds
79 ##DoRPMBuild $ver gtk 0
80
81 DoRPMBuild $ver gtk2 0
82 DoRPMBuild $ver gtk2 1
83done
84
85
86echo "*** Moving RPMs to ."
87find $rpmtop -name "*.rpm"
88mv -f `find $rpmtop -name "*.rpm"` .
89
90
91if [ $SKIPCLEAN != yes ]; then
92 echo "*** Cleaning up $rpmtop"
93 rm -rf $rpmtop
94
95 echo "Cleaning up..."
96 rm *.spec *.tar.bz2
97fi
98
99echo "-=-=-=- Goodbye! -=-=-=-"