aboutsummaryrefslogtreecommitdiff
path: root/patches/sudo/sudo.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'patches/sudo/sudo.SlackBuild')
-rwxr-xr-xpatches/sudo/sudo.SlackBuild18
1 files changed, 11 insertions, 7 deletions
diff --git a/patches/sudo/sudo.SlackBuild b/patches/sudo/sudo.SlackBuild
index 9aeb5144..355b813f 100755
--- a/patches/sudo/sudo.SlackBuild
+++ b/patches/sudo/sudo.SlackBuild
@@ -21,6 +21,7 @@ ARCH=${ARCH:=x86_64}
BUILD=${BUILD:=1rha}
SRC_DIR=${SRC:=$CWD}
TMP=${TMP:=/tmp}
+REPOS=${REPOS:=$TMP}
RTOOL="wget"
PACKAGE_EXT="gz"
@@ -33,6 +34,9 @@ else
tarflag="z"
fi
+SRC_DIR="$SRC_DIR/$PACKAGE"
+mkdir -p $SRC_DIR
+
if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
rm -f $SRC_DIR/$SRC.sig
wget "$URL" -O "$SRC_DIR/$SRC"
@@ -68,13 +72,9 @@ EOGPG
gpg --verify $SRC.sig $SRC || echo WARNING: Could not check signature or WRONG signature found.
+TMP="$TMP/$PACKAGE"
PKG=$TMP/package-sudo
-
-if [ ! -d $TMP ]; then
- mkdir -p $TMP # location to build the source
-fi
-
-rm -rf $PKG
+rm -rf $TMP
mkdir -p $PKG
if [ "$ARCH" = "i386" ]; then
@@ -121,5 +121,9 @@ zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Build the package:
cd $PKG
-makepkg -l y -c n $TMP/sudo-$VERSION-$ARCH-$BUILD.tgz
+makepkg -l y -c n $REPOS/sudo-$VERSION-$ARCH-$BUILD.tgz
+
+if [ "$CLEANUP" == "yes" ]; then
+ rm -rf $TMP
+fi