summaryrefslogtreecommitdiffstats
path: root/wicd
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2008-07-02 21:45:31 +0000
committer Eric Hameleers <alien@slackware.com>2008-07-02 21:45:31 +0000
commitcc455451b72f5b2f28c0ac315fc99c94d39151b3 (patch)
tree5e54fad243ee7bf5a55ea923612d1a6a097201a0 /wicd
parent99d005f040382230b792be6a06ccebb659808cbb (diff)
downloadasb-cc455451b72f5b2f28c0ac315fc99c94d39151b3.tar.gz
asb-cc455451b72f5b2f28c0ac315fc99c94d39151b3.tar.xz
Make the script work with SVN snapshots. Add python version check
Diffstat (limited to 'wicd')
-rwxr-xr-xwicd/build/wicd.SlackBuild38
1 files changed, 30 insertions, 8 deletions
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 <alien@slackware.com>
+# 1.5.0rc3-1: 29/jun/2008 by Eric Hameleers <alien@slackware.com>
# * Initial build.
+# r325-1: 02/jul/2008 by Eric Hameleers <alien@slackware.com>
+# * 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: