wxWidgets/wxPython/distrib/all/do-build-rpm
Robin Dunn 2bf6b425b4 Build/distrib updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-02-28 18:37:29 +00:00

100 lines
2.1 KiB
Bash
Executable File

#!/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:
#
# 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
#
# ---------------------------------------------------------------------------
set -o errexit
#set -o xtrace
echo "-=-=-=- Hello from $HOSTNAME -=-=-=-"
if [ $# -lt 4 ]; then
echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
exit 1
fi
RELEASE=$1
SKIPCLEAN=$2
VERSION=$3
shift;shift;shift
PYVER=$@
rpmtop=_rpm_top
if which rpmbuild > /dev/null 2>&1; then
RPMBUILD=rpmbuild
else
RPMBUILD=rpm
fi
function DoRPMBuild {
# $1 : python version
# $2 : port
# $3 : unicode
echo "-=-=-=-=-=-=-=-=-=-=-"
echo $1 $2 $3
echo "-=-=-=-=-=-=-=-=-=-=-"
$RPMBUILD --define "_topdir $PWD/$rpmtop" \
--define "_tmppath $PWD/$rpmtop/tmp" \
--define "release ${RELEASE}_py$1" \
--define "pyver $1" \
--define "port $2" \
--define "unicode $3" \
-bb wxPython.spec
if [ $? != 0 ]; then
return $?
fi
}
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
cp wxPython-src-$VERSION.tar.gz $rpmtop/SOURCES
echo "******************** PYVER = " $PYVER
for ver in $PYVER; do
echo "Building the RPMs for Python $ver..."
## for now let's just do the gtk2 builds
##DoRPMBuild $ver gtk 0
DoRPMBuild $ver gtk2 0
DoRPMBuild $ver gtk2 1
done
echo "*** Moving RPMs to ."
find $rpmtop -name "*.rpm"
mv -f `find $rpmtop -name "*.rpm"` .
if [ $SKIPCLEAN != yes ]; then
echo "*** Cleaning up $rpmtop"
rm -rf $rpmtop
echo "Cleaning up..."
rm *.spec *.tar.gz
fi
echo "-=-=-=- Goodbye! -=-=-=-"