aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil-vserver/beecrypt.SlackBuild55
-rwxr-xr-xutil-vserver/util-vserver.SlackBuild55
-rwxr-xr-xutil-vserver/vlan.SlackBuild55
3 files changed, 63 insertions, 102 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
diff --git a/util-vserver/util-vserver.SlackBuild b/util-vserver/util-vserver.SlackBuild
index 1073a3b0..cccdba5e 100755
--- a/util-vserver/util-vserver.SlackBuild
+++ b/util-vserver/util-vserver.SlackBuild
@@ -21,13 +21,6 @@ fi
CWD="`pwd`"
-# default settings
-PACKAGE="util-vserver"
-_VERSION="0.30.210"
-_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="util-vserver"
+ARCH=${ARCH:=x86_64}
+VERSION=${VERSION:=0.30.210}
+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="bz2"
SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
@@ -76,6 +56,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"
@@ -83,20 +66,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 --with-initrddir=/etc/rc.d --localstatedir=/var
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 @@ done
# install script
echo '( if [ ! -f "etc/vservers.conf" ]; then mv etc/vservers.conf.new etc/vservers.conf; fi )' > install/doinst.sh
-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
diff --git a/util-vserver/vlan.SlackBuild b/util-vserver/vlan.SlackBuild
index 778b7c66..841600ab 100755
--- a/util-vserver/vlan.SlackBuild
+++ b/util-vserver/vlan.SlackBuild
@@ -5,13 +5,6 @@
CWD="`pwd`"
-# default settings
-PACKAGE="vlan"
-_VERSION="1.9"
-_ARCH="x86_64"
-_BUILD="1rha"
-_TMP="/tmp"
-
if [ -f "/etc/slackbuildrc" ]; then
source /etc/slackbuildrc
fi
@@ -20,17 +13,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="vlan"
+ARCH=${ARCH:=x86_64}
+VERSION=${VERSION:=1.9}
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC:=$CWD}
+TMP=${TMP:=/tmp}
+REPOS=${REPOS:=$TMP}
if [ "$ARCH" == "x86_64" ]; then
LIBDIR=/usr/lib64
@@ -38,16 +28,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"
@@ -59,14 +39,17 @@ 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"
fi
+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
mv $PACKAGE $PACKAGE-$VERSION
@@ -76,8 +59,8 @@ make
CWD="`pwd`"
-mkdir $TMP/package-$PACKAGE/$PACKAGE
-cd $TMP/package-$PACKAGE/$PACKAGE
+mkdir $TMP/package-$PACKAGE
+cd $TMP/package-$PACKAGE
mkdir -p usr/bin
cp $CWD/vconfig usr/bin
@@ -112,5 +95,9 @@ for file in CHANGELOG README vlan.html howto.html; do
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