]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/all/build-linux
Use $ on variables!!!
[wxWidgets.git] / wxPython / distrib / all / build-linux
CommitLineData
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
16set -o errexit
17#set -o xtrace
18
19echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
20
ba9a8985 21if [ $# -lt 4 ]; then
36e91097
RD
22 echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
23 exit 1
24fi
25
afbe4a55 26RELEASE=$1
d6624155
RD
27SKIPCLEAN=$2
28VERSION=$3
29shift;shift;shift
36e91097
RD
30PYVER=$@
31
afbe4a55
RD
32rpmtop=_rpm_top
33
34function DoRPMBuild {
28d1454a
RD
35 # $1 : python version
36 # $2 : port
37 # $3 : unicode
38
afbe4a55
RD
39 rpmbuild --define "_topdir $PWD/$rpmtop" \
40 --define "_tmppath $PWD/$rpmtop/tmp" \
28d1454a
RD
41 --define "release ${RELEASE}_py$1" \
42 --define "pyver $1" \
43 --define "port $2" \
44 --define "unicode $3" \
45 -bb wxPython.spec
afbe4a55
RD
46
47 if [ $? != 0 ]; then
48 return $?
49 fi
28d1454a 50}
afbe4a55 51
afbe4a55 52
36e91097 53
28d1454a
RD
54echo "*** Setting up RPM build dirs"
55for dir in SPECS BUILD RPMS SOURCES SRPMS tmp; do
56 if [ ! -d $rpmtop/$dir ]; then
57 mkdir -p $rpmtop/$dir
58 fi
59done
36e91097 60
28d1454a 61cp wxPython-src-$VERSION.tar.gz $rpmtop/SOURCES
36e91097 62
28d1454a 63echo "******************** PYVER = " $PYVER
36e91097
RD
64for ver in $PYVER; do
65 echo "Building the RPMs for Python $ver..."
28d1454a
RD
66 DoRPMBuild $ver gtk 0
67 DoRPMBuild $ver gtk2 1
68 DoRPMBuild $ver gtk2 0
36e91097
RD
69done
70
71
28d1454a
RD
72echo "*** Moving RPMs to ."
73find $rpmtop -name "*.rpm"
74mv -f `find $rpmtop -name "*.rpm"` .
75
76
36e91097 77if [ $SKIPCLEAN != yes ]; then
28d1454a
RD
78 echo "*** Cleaning up $rpmtop"
79 rm -rf $rpmtop
80
36e91097 81 echo "Cleaning up..."
afbe4a55 82 rm *.spec *.tar.gz
36e91097
RD
83fi
84
85echo "-=-=-=- Goodbye! -=-=-=-"