aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--network/ctorrent/ctorrent.SlackBuild31
1 files changed, 16 insertions, 15 deletions
diff --git a/network/ctorrent/ctorrent.SlackBuild b/network/ctorrent/ctorrent.SlackBuild
index 87685d7704e59..18edf4e438e50 100644
--- a/network/ctorrent/ctorrent.SlackBuild
+++ b/network/ctorrent/ctorrent.SlackBuild
@@ -22,21 +22,25 @@
# -----------------------------------------------------------------------------
# Slightly modified by the SlackBuilds.org project
-# Exit on most errors
-set -e
-
-# Essential variables:
PRGNAM=ctorrent
VERSION=${VERSION:-3.3.2}
-PKGVERSION=dnh${VERSION}
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+PKGVERSION=dnh${VERSION}
+
+iif [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
-TAG=${TAG:-_SBo} # the "_SBo" is required
CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo} # For consistency's sake, use this
-PKG=$TMP/package-$PRGNAM # We build stuff here
-OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
DOCS="AUTHORS ChangeLog* COPYING NEWS README* UserGuide VERSION"
@@ -51,7 +55,8 @@ elif [ "$ARCH" = "x86_64" ]; then
LIBDIRSUFFIX="64"
fi
-# Prepare build environment:
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -77,20 +82,16 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install DESTDIR=$PKG
-# Add documentation:
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
-# Strip binaries
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-# Add the slack-desc:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-# Assemble the package:
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKGVERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}