summaryrefslogtreecommitdiffstats
path: root/system/rar/rar.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/rar/rar.SlackBuild')
-rw-r--r--system/rar/rar.SlackBuild48
1 files changed, 30 insertions, 18 deletions
diff --git a/system/rar/rar.SlackBuild b/system/rar/rar.SlackBuild
index ebf1574027..7e4d692908 100644
--- a/system/rar/rar.SlackBuild
+++ b/system/rar/rar.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for rar
@@ -6,18 +6,40 @@
# Modified by Ozan Türkyılmaz <ozan.turkyilmaz@gmail.com>
# Modified by Mario Preksavec <mario@slackware.hr>
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=rar
VERSION=${VERSION:-5.5.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+# 2023-05-17 DW: move all the ARCH stuff above PRINT_PACKAGE_NAME
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
-case "$( uname -m )" in
- i?86) ARCH=i386 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
-esac
+if [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+ x64FIX="x64-"
+elif [[ $ARCH =~ i?86 ]]; then
+ LIBDIRSUFFIX=""
+else
+ printf "\n$ARCH is not supported...\n\n" ; exit 1
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
-CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -27,16 +49,6 @@ UNRAR=${UNRAR:-no} # disabled by default since unrar is available on SBo
set -e
-if [ "$ARCH" = "x86_64" ]; then
- LIBDIRSUFFIX="64"
- x64FIX="x64-"
-elif [ "$ARCH" = "i386" ]; then
- ARCH=i386
- LIBDIRSUFFIX=""
-else
- printf "\n$ARCH is not supported...\n\n" ; exit 1
-fi
-
rm -rf $TMP/$PRGNAM $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -76,4 +88,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE