summaryrefslogtreecommitdiffstats
path: root/network/ctorrent/ctorrent.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'network/ctorrent/ctorrent.SlackBuild')
-rw-r--r--network/ctorrent/ctorrent.SlackBuild22
1 files changed, 16 insertions, 6 deletions
diff --git a/network/ctorrent/ctorrent.SlackBuild b/network/ctorrent/ctorrent.SlackBuild
index 42ef7c1fac..b08b075217 100644
--- a/network/ctorrent/ctorrent.SlackBuild
+++ b/network/ctorrent/ctorrent.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2007-2009 Eric Hameleers, Eindhoven, Netherlands
# All rights reserved.
#
@@ -22,10 +22,13 @@
# -----------------------------------------------------------------------------
# Slightly modified by the SlackBuilds.org project
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=ctorrent
VERSION=${VERSION:-3.3.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
PKGVERSION=dnh${VERSION}
@@ -37,7 +40,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -86,9 +96,9 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
-mkdir -p $PKG/usr/doc/$PRGNAM-$PKGVERSION
-cp -a $DOCS $PKG/usr/doc/$PRGNAM-$PKGVERSION || true
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKGVERSION/$PRGNAM.SlackBuild
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@@ -97,4 +107,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE