2010-05-11 14:05:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for valgrind
|
|
|
|
# Written by Kyle Guinn <elyk03@gmail.com>
|
2010-05-13 00:25:42 +02:00
|
|
|
# Updated by Peter Wang <novalazy@gmail.com>
|
2012-09-15 12:13:30 +02:00
|
|
|
# Updated by Willy Sudiarto Raharjo <willysr@slackware-id.org>
|
2010-05-11 14:05:53 +02:00
|
|
|
|
|
|
|
PRGNAM=valgrind
|
2014-10-05 10:31:26 +02:00
|
|
|
VERSION=${VERSION:-3.10.0}
|
2011-12-09 02:11:31 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-11 14:05:53 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 19:44:23 +02:00
|
|
|
|
2010-06-04 07:03:48 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-11 19:44:23 +02:00
|
|
|
CWD=$(pwd)
|
2010-05-11 14:05:53 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 00:25:42 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 14:05:53 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 00:25:42 +02:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
2011-12-09 02:11:31 +01:00
|
|
|
# The valgrind build system already passes -fpic
|
|
|
|
# and forcing -fPIC results in a build failure.
|
|
|
|
SLKCFLAGS="-O2"
|
2010-05-13 00:25:42 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:03:48 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2011-09-06 03:30:16 +02:00
|
|
|
fi
|
2010-05-11 14:05:53 +02:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP || exit 1
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-11 19:44:23 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1
|
2010-05-11 14:05:53 +02:00
|
|
|
cd $PRGNAM-$VERSION || exit 1
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2012-09-15 12:13:30 +02:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
2010-05-11 14:05:53 +02:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:25:42 +02:00
|
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \
|
2010-05-11 14:05:53 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
2010-03-25 23:35:53 +01:00
|
|
|
--mandir=/usr/man \
|
2010-05-11 14:05:53 +02:00
|
|
|
|| exit 1
|
|
|
|
|
|
|
|
make || exit 1
|
2011-12-09 02:11:31 +01:00
|
|
|
make install DESTDIR=$PKG || exit 1
|
|
|
|
|
|
|
|
# Do NOT strip the shared objects, as recommended by the developers.
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-11 14:05:53 +02:00
|
|
|
|
2011-12-09 02:11:31 +01:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
2010-05-11 14:05:53 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-12-09 02:11:31 +01:00
|
|
|
cp -a AUTHORS COPYING* FAQ.txt NEWS README* \
|
2010-05-11 14:05:53 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
mv $PKG/usr/share/doc/valgrind/html $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
# The doc directory is the only thing in $PKG/usr/share, and the only things
|
2011-09-06 03:30:16 +02:00
|
|
|
# left in it now are pdf and a ps doc files. They are large, so we won't keep
|
2010-05-11 14:05:53 +02:00
|
|
|
# them around. If you still want them, uncomment the line below.
|
|
|
|
# mv $PKG/usr/share/doc/valgrind/*.{ps,pdf} $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
rm -rf $PKG/usr/share
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:25:42 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|