summaryrefslogtreecommitdiff
path: root/source/d/oprofile/oprofile.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/oprofile/oprofile.SlackBuild')
-rwxr-xr-xsource/d/oprofile/oprofile.SlackBuild55
1 files changed, 47 insertions, 8 deletions
diff --git a/source/d/oprofile/oprofile.SlackBuild b/source/d/oprofile/oprofile.SlackBuild
index 28feae4a..8a9d2bef 100755
--- a/source/d/oprofile/oprofile.SlackBuild
+++ b/source/d/oprofile/oprofile.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2010 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,12 +21,21 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=0.9.4
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-$(echo oprofile-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-2}
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=""
@@ -52,8 +61,13 @@ rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP || exit 1
rm -rf oprofile-$VERSION
-tar xvf $CWD/oprofile-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/oprofile-$VERSION.tar.?z* || exit 1
cd oprofile-$VERSION
+
+zcat $CWD/oprofile.qt4.diff.gz | patch -p1 --verbose || exit 1
+
+./autogen.sh
+
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -72,21 +86,46 @@ CXXFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG
+# Strip binaries:
+( cd $PKG
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+)
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
# This seems misplaced, and isn't referenced by any binaries or other files.
# I'm tempted to think it shouldn't have been installed, but will just move it:
if [ -r $PKG/usr/share/mangled-name ]; then
mv $PKG/usr/share/mangled-name $PKG/usr/share/oprofile/mangled-name
fi
-( cd $PKG/usr/bin
- strip --strip-unneeded *
-)
+
mv $PKG/usr/share/doc $PKG/usr
mv $PKG/usr/doc/oprofile $PKG/usr/doc/oprofile-$VERSION
cp -a \
COPYING README TODO \
$PKG/usr/doc/oprofile-$VERSION
-gzip -9 $PKG/usr/man/man?/*
+# 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
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc