2021-07-04 01:48:15 +08:00
|
|
|
#!/bin/bash
|
2018-08-08 23:57:14 +08:00
|
|
|
|
|
|
|
# Slackware build script for tweak
|
|
|
|
|
2022-06-09 00:27:02 +08:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2018-08-08 23:57:14 +08:00
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2021-09-08 02:31:51 +08:00
|
|
|
# 20210907 bkw: update for v3.02+20200601 (git commit ad97e13),
|
|
|
|
# which has a few bugfixes. The patch does *not* include the last git
|
|
|
|
# commit, d131fe2, which switches from a plain Makefile to autotools.
|
|
|
|
|
2021-07-04 17:41:06 +08:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2018-08-08 23:57:14 +08:00
|
|
|
PRGNAM=tweak
|
2021-09-08 02:31:51 +08:00
|
|
|
VERSION=${VERSION:-3.02+20200601}
|
2018-08-08 23:57:14 +08:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 18:23:38 +08:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2018-08-08 23:57:14 +08:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i586 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 18:23:38 +08:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-08-08 23:57:14 +08:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -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
|
|
|
|
|
2021-09-08 02:31:51 +08:00
|
|
|
TARVER=${VERSION/+*}
|
|
|
|
PATCH=${VERSION/*+}
|
|
|
|
|
2018-08-08 23:57:14 +08:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2021-09-08 02:31:51 +08:00
|
|
|
rm -rf $PRGNAM-$TARVER
|
|
|
|
tar xvf $CWD/$PRGNAM-$TARVER.tar.gz
|
|
|
|
cd $PRGNAM-$TARVER
|
2018-08-08 23:57:14 +08:00
|
|
|
chown -R root:root .
|
|
|
|
chmod 644 *
|
|
|
|
|
2021-09-08 02:31:51 +08:00
|
|
|
[ "$PATCH" != "$VERSION" ] && patch -p1 < $CWD/$PATCH.diff
|
|
|
|
|
2018-08-08 23:57:14 +08:00
|
|
|
make XFLAGS="$SLKCFLAGS"
|
|
|
|
install -D -s -m0755 $PRGNAM $PKG/usr/bin/$PRGNAM
|
|
|
|
mkdir -p $PKG/usr/man/man1
|
|
|
|
gzip -9c $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a *.html LICENCE $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
|
2021-07-04 18:23:38 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|