2004-06-14 15:53:50 -04:00
|
|
|
#!/bin/bash
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Build the wxPython source RPMs on a Linux box. This is normally called
|
|
|
|
# from build-all but it should be able to be used standalone too...
|
|
|
|
#
|
|
|
|
# The command line must have the following parameters:
|
|
|
|
#
|
2004-07-06 16:58:16 -04:00
|
|
|
# 1. the path of the build dir. The src RPMs will be here when we start
|
|
|
|
# and the binary RPMs will be left here when we're done.
|
|
|
|
# 2. skipclean flag (yes|no)
|
|
|
|
# 3. the VERSION
|
|
|
|
# 4. the remaining args are the versions of Python to build for
|
2004-06-14 15:53:50 -04:00
|
|
|
#
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
#set -o xtrace
|
|
|
|
|
|
|
|
echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
|
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
if [ $# -lt 5 ]; then
|
|
|
|
echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER CHARTYPE"
|
2004-06-14 15:53:50 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2004-08-04 18:27:18 -04:00
|
|
|
RELEASE=$1
|
2004-07-06 16:58:16 -04:00
|
|
|
SKIPCLEAN=$2
|
|
|
|
VERSION=$3
|
2006-07-12 22:40:46 -04:00
|
|
|
PYVER=$4
|
|
|
|
CHARTYPE=$5
|
2004-06-14 15:53:50 -04:00
|
|
|
|
2004-08-04 18:27:18 -04:00
|
|
|
rpmtop=_rpm_top
|
|
|
|
|
2004-11-04 16:56:10 -05:00
|
|
|
if which rpmbuild > /dev/null 2>&1; then
|
|
|
|
RPMBUILD=rpmbuild
|
|
|
|
else
|
|
|
|
RPMBUILD=rpm
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2004-08-04 18:27:18 -04:00
|
|
|
function DoRPMBuild {
|
2004-10-14 21:13:02 -04:00
|
|
|
# $1 : python version
|
|
|
|
# $2 : port
|
|
|
|
# $3 : unicode
|
2004-11-08 18:55:25 -05:00
|
|
|
|
|
|
|
echo "-=-=-=-=-=-=-=-=-=-=-"
|
|
|
|
echo $1 $2 $3
|
|
|
|
echo "-=-=-=-=-=-=-=-=-=-=-"
|
|
|
|
|
2004-11-04 16:56:10 -05:00
|
|
|
$RPMBUILD --define "_topdir $PWD/$rpmtop" \
|
2004-08-04 18:27:18 -04:00
|
|
|
--define "_tmppath $PWD/$rpmtop/tmp" \
|
2004-10-14 21:13:02 -04:00
|
|
|
--define "release ${RELEASE}_py$1" \
|
|
|
|
--define "pyver $1" \
|
|
|
|
--define "port $2" \
|
|
|
|
--define "unicode $3" \
|
|
|
|
-bb wxPython.spec
|
2004-08-04 18:27:18 -04:00
|
|
|
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
return $?
|
|
|
|
fi
|
2004-10-14 21:13:02 -04:00
|
|
|
}
|
2004-08-04 18:27:18 -04:00
|
|
|
|
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
|
2004-10-14 21:13:02 -04:00
|
|
|
echo "*** Setting up RPM build dirs"
|
|
|
|
for dir in SPECS BUILD RPMS SOURCES SRPMS tmp; do
|
|
|
|
if [ ! -d $rpmtop/$dir ]; then
|
|
|
|
mkdir -p $rpmtop/$dir
|
|
|
|
fi
|
|
|
|
done
|
2004-06-14 15:53:50 -04:00
|
|
|
|
2006-06-01 23:43:46 -04:00
|
|
|
cp wxPython-src-$VERSION.tar.bz2 $rpmtop/SOURCES
|
2004-06-14 15:53:50 -04:00
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
echo "************************************************"
|
|
|
|
echo "Building the RPMs for Python $PYVER, $CHARTYPE"
|
2005-02-28 13:37:29 -05:00
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
## for now let's just do the gtk2 builds
|
|
|
|
##if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
|
|
|
|
## DoRPMBuild $ver gtk 0
|
|
|
|
##fi
|
2005-02-28 13:37:29 -05:00
|
|
|
|
2006-07-12 22:40:46 -04:00
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = ansi ]; then
|
|
|
|
DoRPMBuild $PYVER gtk2 0
|
|
|
|
fi
|
|
|
|
if [ $CHARTYPE = both -o $CHARTYPE = unicode ]; then
|
|
|
|
DoRPMBuild $PYVER gtk2 1
|
|
|
|
fi
|
2004-06-14 15:53:50 -04:00
|
|
|
|
|
|
|
|
2004-10-14 21:13:02 -04:00
|
|
|
echo "*** Moving RPMs to ."
|
|
|
|
find $rpmtop -name "*.rpm"
|
|
|
|
mv -f `find $rpmtop -name "*.rpm"` .
|
|
|
|
|
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
if [ $SKIPCLEAN != yes ]; then
|
2004-10-14 21:13:02 -04:00
|
|
|
echo "*** Cleaning up $rpmtop"
|
|
|
|
rm -rf $rpmtop
|
|
|
|
|
2004-06-14 15:53:50 -04:00
|
|
|
echo "Cleaning up..."
|
2006-06-01 23:43:46 -04:00
|
|
|
rm *.spec *.tar.bz2
|
2004-06-14 15:53:50 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-=-=-=- Goodbye! -=-=-=-"
|