summaryrefslogtreecommitdiff
path: root/source/a/file/file.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/file/file.SlackBuild')
-rwxr-xr-xsource/a/file/file.SlackBuild38
1 files changed, 28 insertions, 10 deletions
diff --git a/source/a/file/file.SlackBuild b/source/a/file/file.SlackBuild
index aaa0ca41..04c47856 100755
--- a/source/a/file/file.SlackBuild
+++ b/source/a/file/file.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,12 +20,21 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=5.03
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo file-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j7}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
@@ -35,24 +44,21 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-file
+
rm -rf $PKG
mkdir -p $TMP $PKG
-
cd $TMP
rm -rf file-$VERSION
tar xvf $CWD/file-$VERSION.tar.?z* || exit 1
cd file-$VERSION || exit 1
-
-# Make the default data directory /etc/file like it has always been:
-zcat $CWD/file.etc.file.diff.gz | patch -p1 --verbose || exit 1
-# This is needed after the patch above:
-autoreconf || exit 1
-
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -60,6 +66,11 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Make the default data directory /etc/file like it has always been:
+zcat $CWD/file.etc.file.diff.gz | patch -p1 --verbose || exit 1
+# This is needed after the patch above:
+autoreconf || exit 1
+
# Don't spew warnings about using the flat text files
zcat $CWD/file.quiet.diff.gz | patch -p1 -E --verbose || exit 1
# I don't know what this one does
@@ -82,9 +93,16 @@ CFLAGS="$SLKCFLAGS" \
--disable-static \
--build=$ARCH-slackware-linux
+# The generated $TMP/file-$VERSION/libtool is buggy. I don't know if this is supposed
+# to work, but it certainly does, so... :-)
+cat $(which libtool) > libtool
+
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+# Seems --disable-static has been ignored lately:
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libmagic.a
+
# Is file really this much of a processing bottleneck? Doubtful.
#
# NOTE: Benchmarked flat files vs. .mgc June 2009, found no measurable