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 -=-=-=-"
|
|
|
|
|
2004-07-15 20:02:49 -04:00
|
|
|
if [ $# -lt 4]; then
|
2004-06-14 15:53:50 -04:00
|
|
|
echo "Usage: $0 WXDIR DESTDIR SKIPCLEAN VERSION PYVER..."
|
|
|
|
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
|
|
|
|
shift;shift;shift
|
2004-06-14 15:53:50 -04:00
|
|
|
PYVER=$@
|
|
|
|
|
2004-08-04 18:27:18 -04:00
|
|
|
rpmtop=_rpm_top
|
|
|
|
|
|
|
|
function DoRPMBuild {
|
|
|
|
echo "*** Setting up RPM build dirs"
|
|
|
|
for dir in SPECS BUILD RPMS SRPMS tmp; do
|
|
|
|
if [ ! -d $rpmtop/$dir ]; then
|
|
|
|
mkdir -p $rpmtop/$dir
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ ! -e $rpmtop/SOURCES ]; then
|
|
|
|
ln -s $PWD $rpmtop/SOURCES
|
|
|
|
fi
|
|
|
|
|
|
|
|
rpmbuild --define "_topdir $PWD/$rpmtop" \
|
|
|
|
--define "_tmppath $PWD/$rpmtop/tmp" \
|
|
|
|
--define "release $RELEASE" \
|
|
|
|
$@
|
|
|
|
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
return $?
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "*** Moving RPMs to ."
|
|
|
|
find $rpmtop -name "*.rpm"
|
|
|
|
mv -f `find $rpmtop -name "*.rpm"` .
|
|
|
|
|
|
|
|
echo "*** Cleaning up $rpmtop"
|
|
|
|
rm -rf $rpmtop
|
|
|
|
}
|
2004-06-14 15:53:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ver in $PYVER; do
|
|
|
|
echo "Building the RPMs for Python $ver..."
|
2004-08-04 18:27:18 -04:00
|
|
|
for port in GTK GTK2; do
|
|
|
|
rpm2cpio wxPython$port-py$ver-$VERSION-1.src.rpm | \
|
|
|
|
cpio --extract -R root.
|
|
|
|
DoRPMBuild -ba wxPython$port.spec
|
|
|
|
done
|
2004-06-14 15:53:50 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
if [ $SKIPCLEAN != yes ]; then
|
|
|
|
echo "Cleaning up..."
|
2004-07-06 16:58:16 -04:00
|
|
|
for ver in $PYVER; do
|
2004-08-04 18:27:18 -04:00
|
|
|
rm wxPythonGTK-py$ver-$VERSION-*.src.rpm
|
|
|
|
rm wxPythonGTK2-py$ver-$VERSION-*.src.rpm
|
2004-07-06 16:58:16 -04:00
|
|
|
done
|
2004-08-04 18:27:18 -04:00
|
|
|
rm *.spec *.tar.gz
|
2004-06-14 15:53:50 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "-=-=-=- Goodbye! -=-=-=-"
|