aboutsummaryrefslogtreecommitdiff
path: root/util-vserver/beecrypt.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'util-vserver/beecrypt.SlackBuild')
-rwxr-xr-xutil-vserver/beecrypt.SlackBuild55
1 files changed, 21 insertions, 34 deletions
diff --git a/util-vserver/beecrypt.SlackBuild b/util-vserver/beecrypt.SlackBuild
index b65b0145..df60e9a8 100755
--- a/util-vserver/beecrypt.SlackBuild
+++ b/util-vserver/beecrypt.SlackBuild
@@ -21,13 +21,6 @@ fi
CWD="`pwd`"
-# default settings
-PACKAGE="beecrypt"
-_VERSION="4.1.2"
-_ARCH="x86_64"
-_BUILD="1rha"
-_TMP="/tmp"
-
if [ -f "/etc/slackbuildrc" ]; then
source /etc/slackbuildrc
fi
@@ -36,17 +29,14 @@ if [ -f "~/.slackbuildrc" ]; then
source ~/.slackbuildrc
fi
-if [ -z "$VERSION" ]; then
- VERSION="$_VERSION"
-fi
-
-if [ -z "$ARCH" ]; then
- ARCH="$_ARCH"
-fi
-
-if [ -z "$BUILD" ]; then
- BUILD="$_BUILD"
-fi
+# default settings
+PACKAGE="beecrypt"
+ARCH=${ARCH:=x86_64}
+VERSION=${VERSION:=4.1.2}
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC:=$CWD}
+TMP=${TMP:=/tmp}
+REPOS=${REPOS:=$TMP}
if [ "$ARCH" == "x86_64" ]; then
LIBDIR=/usr/lib64
@@ -54,16 +44,6 @@ else
LIBDIR=/usr/lib
fi
-if [ -z "$SRC" ]; then
- SRC_DIR="$CWD"
-else
- SRC_DIR="$SRC"
-fi
-
-if [ -z "$TMP" ]; then
- TMP="$_TMP"
-fi
-
RTOOL="wget"
PACKAGE_EXT="gz"
SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
@@ -77,6 +57,9 @@ else
tarflag="z"
fi
+SRC_DIR="$SRC_DIR/$PACKAGE"
+mkdir -p $SRC_DIR
+
if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
wget "$URL" -O "$SRC_DIR/$SRC"
wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"
@@ -89,20 +72,20 @@ fi
gpg --verify $SRC_DIR/$SRC.sig $SRC || echo WARNING: Could not check signature or WRONG signature found.
+TMP="$TMP/$PACKAGE"
+rm -rf $TMP
+mkdir -p $TMP
cd $TMP
-rm -rf package-$PACKAGE
-mkdir package-$PACKAGE
-cd package-$PACKAGE
tar xvf$tarflag $SRC_DIR/$SRC
cd $PACKAGE-$VERSION
./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR
make
-make DESTDIR=$TMP/package-$PACKAGE/$PACKAGE install
+make DESTDIR=$TMP/package-$PACKAGE install
CWD="`pwd`"
-cd $TMP/package-$PACKAGE/$PACKAGE
+cd $TMP/package-$PACKAGE
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
@@ -137,5 +120,9 @@ for file in AUTHORS BENCHMARKS BUGS CONTRIBUTORS COPYING ChangeLog INSTALL NEWS
cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/
done
-makepkg -c y -l y $TMP/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+
+if [ "$CLEANUP" == "yes" ]; then
+ rm -rf $TMP
+fi