92 lines
2.2 KiB
Bash
92 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
# Slackware build script for stressapptest
|
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
# 20231120 bkw: update for v1.0.11.
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
PRGNAM=stressapptest
|
|
VERSION=${VERSION:-1.0.11}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-_SBo}
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i586 ;;
|
|
arm*) ARCH=arm ;;
|
|
*) ARCH=$( uname -m ) ;;
|
|
esac
|
|
fi
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
exit 0
|
|
fi
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
PKG=$TMP/package-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
# The -O2 that's normally here is removed, because upstream puts -O3
|
|
# after our supplied flags. I assume they know what they're doing.
|
|
if [ "$ARCH" = "i586" ]; then
|
|
SLKCFLAGS="-march=i586 -mtune=i686"
|
|
PATCH=yes
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
SLKCFLAGS="-march=i686 -mtune=i686"
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
SLKCFLAGS="-fPIC"
|
|
else
|
|
SLKCFLAGS=""
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
cd $PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
|
|
|
patch -p1 < $CWD/support_i586.diff
|
|
autoreconf -if
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
./configure \
|
|
--prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--localstatedir=/var \
|
|
--mandir=/usr/man \
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
--build=$ARCH-slackware-linux
|
|
|
|
make
|
|
make install-strip DESTDIR=$PKG
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
# There are 2 slightly different copies of the Apache license (COPYING
|
|
# and NOTICE). Not being a lawyer, I'm just going to punt and include
|
|
# them both in the doc dir. Also, MODULE_LICENSE_APACHE2 looks like it
|
|
# belongs in the doc dir, but it's 0 bytes long. *Shrug*.
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
cp -a COPYING NOTICE *.md $PKG/usr/doc/$PRGNAM-$VERSION
|
|
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
|