aboutsummaryrefslogtreecommitdiff
path: root/dopewars/dopewars.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'dopewars/dopewars.SlackBuild')
-rwxr-xr-xdopewars/dopewars.SlackBuild31
1 files changed, 15 insertions, 16 deletions
diff --git a/dopewars/dopewars.SlackBuild b/dopewars/dopewars.SlackBuild
index 42025670..b9e3fab4 100755
--- a/dopewars/dopewars.SlackBuild
+++ b/dopewars/dopewars.SlackBuild
@@ -23,6 +23,12 @@ SRC_DIR=${SRC:=$CWD}
TMP=${TMP:=/tmp}
REPOS=${REPOS:=$TMP}
+# ------- error codes for createpkg --------------
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40
+
if [ "$ARCH" == "x86_64" ]; then
LIBDIR=/usr/lib64
else
@@ -64,35 +70,28 @@ URL="http://easynews.dl.sourceforge.net/sourceforge/dopewars/$SRC"
SRC_DIR="$SRC_DIR/$PACKAGE"
mkdir -p $SRC_DIR
-if [ "$PACKAGE_EXT" == "bz2" ]; then
- tarflag="j"
-else
- tarflag="z"
-fi
-
if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
- wget "$URL" -O "$SRC_DIR/$SRC"
- wget "$URL.gpg" -O "$SRC_DIR/$SRC.gpg"
+ wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET
+ wget "$URL.gpg" -O "$SRC_DIR/$SRC.gpg" || exit $ERROR_WGET
fi
-gpg --verify $SRC_DIR/$SRC.gpg $SRC_DIR/$SRC || echo WARNING: Could not check signature or WRONG signature found.
-sleep 3
+gpg --verify $SRC_DIR/$SRC.gpg $SRC_DIR/$SRC || exit $ERROR_GPG
TMP="$TMP/$PACKAGE"
rm -rf $TMP
mkdir -p $TMP
cd $TMP
-tar xvf$tarflag $SRC_DIR/$SRC
+tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR
cd $PACKAGE-$VERSION
if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then
- patch -p1 < $CWD/$PACKAGE-$VERSION.diff
+ patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH
fi
-./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR
-make || exit 32
-make DESTDIR=$TMP/package-$PACKAGE install
+./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR || exit $ERROR_CONF
+make || exit $ERROR_MAKE
+make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL
CWD="`pwd`"
@@ -133,7 +132,7 @@ rmdir usr/share/doc
# cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/
# done
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
if [ "$CLEANUP" == "yes" ]; then
rm -rf $TMP