summaryrefslogtreecommitdiff
path: root/system/unace/unace.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/unace/unace.SlackBuild')
-rw-r--r--system/unace/unace.SlackBuild38
1 files changed, 35 insertions, 3 deletions
diff --git a/system/unace/unace.SlackBuild b/system/unace/unace.SlackBuild
index 88a6f8d1e3..da0c5f360e 100644
--- a/system/unace/unace.SlackBuild
+++ b/system/unace/unace.SlackBuild
@@ -2,6 +2,7 @@
#
# Slackware build script for unace
#
+# Copyright 2017 Jeremy Hansen <jebrhansen+SBo -at- gmail.com>
# Copyright 2009 Erik W. Hanson, Minneapolis, MN, USA
# All rights reserved.
#
@@ -24,15 +25,36 @@
PRGNAM=unace
VERSION=${VERSION:-2.5}
-ARCH=i586 # Static Binary
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
set -eu
rm -rf $PKG
@@ -41,7 +63,8 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
-tar xvf $CWD/lin${PRGNAM}${VERSION/./}.tgz
+tar xvf $CWD/${PRGNAM}-nonfree_${VERSION}.orig.tar.gz
+cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -49,6 +72,15 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Thanks to AUR for the patches
+patch -p1 < $CWD/01-makefiles.dpatch
+
+if [ "$ARCH" = "x86_64" ]; then
+ patch -p1 < $CWD/04-64bit.dpatch
+fi
+
+make
+
mkdir -p $PKG/usr/bin
install -m 0755 unace $PKG/usr/bin/unace