mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-21 19:42:24 +01:00
ac0a38410a
Signed-off-by: David Somero <xgizzmo@slackbuilds.org>
87 lines
2.3 KiB
Bash
87 lines
2.3 KiB
Bash
#!/bin/sh
|
|
|
|
# Slackware build script for valgrind
|
|
# Written by Kyle Guinn <elyk03@gmail.com>
|
|
# Updated by Peter Wang <novalazy@gmail.com>
|
|
|
|
PRGNAM=valgrind
|
|
VERSION=3.5.0
|
|
BUILD=${BUILD:-2}
|
|
TAG=${TAG:-_SBo}
|
|
|
|
# Automatically determine the architecture we're building on:
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i486 ;;
|
|
arm*) ARCH=arm ;;
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
*) 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
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
cd $TMP || exit 1
|
|
rm -rf $PRGNAM-$VERSION
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1
|
|
cd $PRGNAM-$VERSION || exit 1
|
|
chown -R root:root .
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
# For compatibility with -current; thanks to Arne Welzel for the report.
|
|
patch -p0 < $CWD/valgrind-3.5.0-glibc-2.11.patch || exit 1
|
|
autoconf || exit 1
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
./configure \
|
|
--prefix=/usr \
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \
|
|
--sysconfdir=/etc \
|
|
--localstatedir=/var \
|
|
--mandir=/usr/man \
|
|
|| exit 1
|
|
|
|
make || exit 1
|
|
make install-strip DESTDIR=$PKG || exit 1
|
|
|
|
( cd $PKG/usr/man
|
|
find . -type f -exec gzip -9 {} \;
|
|
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
|
|
)
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
cp -a AUTHORS COPYING FAQ.txt NEWS README* \
|
|
$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
|
|
# left in it now are pdf and a ps doc files. They are large, so we won't keep
|
|
# 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
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|