2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2017-03-30 00:17:20 +02:00
|
|
|
|
|
|
|
# Slackware build script for bdfresize
|
|
|
|
|
|
|
|
# Written by B. Watson (yalhcru@gmail.com)
|
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2021-09-10 21:22:48 +02:00
|
|
|
# 20210910 bkw: BUILD=2
|
|
|
|
# - fix FONTBOUNDINGBIX typo.
|
|
|
|
# - add check_factor_args.diff.
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2017-03-30 00:17:20 +02:00
|
|
|
PRGNAM=bdfresize
|
|
|
|
VERSION=${VERSION:-1.5}
|
2021-09-10 21:22:48 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2017-03-30 00:17:20 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2017-03-30 00:17:20 +02:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i586 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-03-30 00:17:20 +02: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
|
|
|
|
|
|
|
|
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 .
|
2021-09-10 21:22:48 +02:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
2017-03-30 00:17:20 +02:00
|
|
|
|
2021-09-10 21:22:48 +02:00
|
|
|
# 20210910 bkw: this one-liner patch came from Debian
|
2017-03-30 00:17:20 +02:00
|
|
|
patch -p1 < $CWD/compilefix.diff
|
|
|
|
|
2021-09-10 21:22:48 +02:00
|
|
|
# 20210910 bkw: fix typo in docs
|
|
|
|
sed -i 's,FONTBOUNDINGBIX,FONTBOUNDINGBOX,g' README $PRGNAM.1
|
|
|
|
|
|
|
|
# 20210910 bkw: if someone tries to use a decimal as a factor,
|
|
|
|
# e.g. 1.5, bdfresize silently ignores the .5 and treats the argument
|
|
|
|
# as just 1. This patch adds a check to make sure the factors consist
|
|
|
|
# only of digits and 0 or 1 slashes. Patch is by the SlackBuild
|
|
|
|
# author, who keeps trying to say "-f 1.5" despite all sanity...
|
|
|
|
patch -p1 < $CWD/check_factor_args.diff
|
|
|
|
|
2017-03-30 00:17:20 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
make
|
|
|
|
make install-strip DESTDIR=$PKG
|
|
|
|
gzip $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a AUTHORS C* NEWS README $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 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|