summaryrefslogtreecommitdiff
path: root/source/d/binutils/binutils.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/binutils/binutils.SlackBuild')
-rwxr-xr-xsource/d/binutils/binutils.SlackBuild41
1 files changed, 32 insertions, 9 deletions
diff --git a/source/d/binutils/binutils.SlackBuild b/source/d/binutils/binutils.SlackBuild
index c83c2921..b0ffefb6 100755
--- a/source/d/binutils/binutils.SlackBuild
+++ b/source/d/binutils/binutils.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,14 +21,21 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=2.18.50.0.9
-ARCH=${ARCH:-x86_64}
-NUMJOBS=${NUMJOBS:-" -j7 "}
-BUILD=${BUILD:-2}
+PKGNAM=binutils
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
-PKG=$TMP/package-binutils
+# 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
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -41,13 +48,18 @@ elif [ "$ARCH" = "x86_64" ]; then
LIBDIRSUFFIX="64"
fi
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-binutils
+
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf binutils-$VERSION
-tar xvf $CWD/binutils-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/binutils-$VERSION.tar.?z* || exit 1
cd binutils-$VERSION
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -60,6 +72,8 @@ CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
--with-docdir=/usr/doc/binutils-$VERSION \
--enable-shared \
--enable-multilib \
@@ -110,6 +124,15 @@ cp \
$CWD/release.binutils-* \
COPYING* ChangeLog.linux MAI* README* \
$PKG/usr/doc/binutils-$VERSION
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
chown -R root:root $PKG/usr/doc/binutils-$VERSION
# Add slack-desc: