aboutsummaryrefslogtreecommitdiff
path: root/development/ltrace/ltrace.SlackBuild
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2014-12-21 09:44:11 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-12-21 09:44:11 +0700
commit3279ab2b7019f7a6fef52acab4fc6fffcc73e3fe (patch)
tree1c9414fa4a18181c647ac220731abfd8d5451c55 /development/ltrace/ltrace.SlackBuild
parent62b476dae607d3537201615b9f3f370fd8447384 (diff)
development/ltrace: Added (library call trace utility).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/ltrace/ltrace.SlackBuild')
-rw-r--r--development/ltrace/ltrace.SlackBuild97
1 files changed, 97 insertions, 0 deletions
diff --git a/development/ltrace/ltrace.SlackBuild b/development/ltrace/ltrace.SlackBuild
new file mode 100644
index 0000000000000..52102401812cf
--- /dev/null
+++ b/development/ltrace/ltrace.SlackBuild
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# Slackware build script for ltrace
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=ltrace
+VERSION=${VERSION:-0.7.3_4}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -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 -e
+
+# VERSION is upstream's plus Debian's (since we use their patchset)
+SRCVER=$( echo $VERSION | cut -d_ -f1 )
+DEBVER=$( echo $VERSION | cut -d_ -f2 )
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$SRCVER
+tar xvf $CWD/${PRGNAM}_$SRCVER.orig.tar.bz2
+cd $PRGNAM-$SRCVER
+tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.gz debian/patches
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# apply Debian's patches, which fix a few bugs.
+for i in $( cat debian/patches/series ); do
+ patch -p1 < debian/patches/$i
+done
+
+# Slackware's gelf.h lives in /usr/include/libelf. Normally not a problem,
+# but ltrace is old enough that it doesn't use pkg-config.
+SLKCFLAGS="$SLKCFLAGS -I/usr/include/libelf"
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make
+make install-strip DESTDIR=$PKG
+
+gzip $PKG/usr/man/man?/*
+mv $PKG/etc/$PRGNAM.conf $PKG/etc/$PRGNAM.conf.new
+
+# docs already installed in right place, we don't need this one:
+rm -f $PKG/usr/doc/$PRGNAM-$VERSION/INSTALL
+
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+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}