From cc455451b72f5b2f28c0ac315fc99c94d39151b3 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Wed, 2 Jul 2008 21:45:31 +0000 Subject: Make the script work with SVN snapshots. Add python version check --- wicd/build/wicd.SlackBuild | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'wicd') diff --git a/wicd/build/wicd.SlackBuild b/wicd/build/wicd.SlackBuild index 286f8b58..58a8cb2f 100755 --- a/wicd/build/wicd.SlackBuild +++ b/wicd/build/wicd.SlackBuild @@ -30,8 +30,10 @@ # URL: http://wicd.net/ # Needs: # Changelog: -# 1.5.0rc3-1: 29/Jun/2008 by Eric Hameleers +# 1.5.0rc3-1: 29/jun/2008 by Eric Hameleers # * Initial build. +# r325-1: 02/jul/2008 by Eric Hameleers +# * The SVN version has important fixes # # Run 'sh wicd.SlackBuild --cleanup' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -42,13 +44,16 @@ # Set initial variables: PRGNAM=wicd -VERSION=${VERSION:-1.5.0rc3} +VERSION=${VERSION:-"r325"} # SVN snapshot or official release +BRANCH=${BRANCH:-"testing-1.5.0"} # SVN 'testing' branch is where it happens ARCH=noarch BUILD=${BUILD:-1} TAG=${TAG:-alien} DOCS="AUTHORS INSTALL LICENSE README" +PYTHONREQ=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.) + # Where do we look for sources? SRCDIR=$(cd $(dirname $0); pwd) @@ -58,7 +63,9 @@ PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" -SRCURL="http://downloads.sourceforge.net/wicd/wicd_1.5.0rc3-1.tar.gz" +# If SRCURL is empty, a SVN snapshot will be downloaded instead: +#SRCURL="http://downloads.sourceforge.net/wicd/wicd_1.5.0rc3-1.tar.gz" +SRCURL="" # This function checks out sources from SVN/CVS and creates a tarball of them. src_checkout() { @@ -68,12 +75,20 @@ src_checkout() { else REV="{${VERSION}}" fi + # Determine the tarball extension: + PEXT=`echo "${1}" | sed -r -e 's/.*[^.].(tar.gz|tar.bz2|tgz).*/\1/'` + if [ "$PEXT" == "${1}" ]; then # we did not find a allowed extension + echo "Archive can only have extension '.tar.gz' '.tar.bz2' or '.tgz'" + exit 1 + else + [ "$PEXT" = "tar.bz2" ] && TARCOMP="j" || TARCOMP="z" + fi mkdir $PRGNAM-${VERSION} \ && cd $PRGNAM-${VERSION} \ - && svn checkout --revision $REV https://wicd.svn.sourceforge.net/svnroot/wicd . \ + && svn checkout --revision $REV https://wicd.svn.sourceforge.net/svnroot/wicd/${BRANCH} . \ && chown -R root:root . \ && cd .. \ - && tar -jcf ${1} $PRGNAM-${VERSION} \ + && tar -${TARCOMP}cf ${1} $PRGNAM-${VERSION} \ && rm -rf $PRGNAM-${VERSION} } @@ -141,9 +156,9 @@ chown -R root:root . chmod -R u+w,go+r-w,a-s . echo Building ... -# Fix missing KDE4 location of kdesu: -cat $SRCDIR/wicd-1.5.0rc3_misc.py_kde4.patch | patch -p1 \ - 2>&1 | tee $OUTPUT/patch-$PRGNAM.log +## Fix missing KDE4 location of kdesu: +#cat $SRCDIR/wicd-1.5.0rc3_misc.py_kde4.patch | patch -p1 \ +# 2>&1 | tee $OUTPUT/patch-$PRGNAM.log # Fix the version hardcoding in the setup script: sed -i -e "/\/etc\/slackware-version/,/elif os.access/s#/usr/doc/wicd-1.5.0/#/usr/doc/$PRGNAM-$VERSION/#" setup.py # Use our own Slackware rc script, overwriting what is in the source: @@ -205,6 +220,13 @@ if [ -x usr/bin/update-desktop-database ]; then chroot . /usr/bin/update-desktop-database /usr/share/applications > /dev/null 2>&1 fi +PYTHON=\$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.) +if [ \$(echo \$PYTHON | tr -d '.') -ne $PYTHONREQ ]; then + echo "" + echo "Your Python is version \$PYTHON but this package requires $PYTHONREQ" + echo "" +fi + EOINS # Add documentation: -- cgit v1.2.3