2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2010-05-13 00:58:06 +02:00
|
|
|
|
|
|
|
# Slackware build script for atari++
|
|
|
|
|
2022-06-08 18:27:08 +02:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2010-05-13 00:58:06 +02:00
|
|
|
|
2013-06-17 09:27:46 +02:00
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
2012-12-21 21:23:26 +01:00
|
|
|
|
2023-01-06 22:53:42 +01:00
|
|
|
# 20230106 bkw: update for 1.85
|
2021-10-07 23:36:40 +02:00
|
|
|
# 20211007 bkw: update for 1.84
|
2021-03-23 05:37:20 +01:00
|
|
|
# 20210323 bkw: BUILD=2
|
|
|
|
# - add option to patch out "Do you really want to quit?" because it's *annoying*
|
|
|
|
# - move binary to /usr/games
|
2020-10-24 19:20:09 +02:00
|
|
|
# 20170122 bkw: update for 1.83
|
2017-01-22 17:33:12 +01:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-13 00:58:06 +02:00
|
|
|
PRGNAM=atari++
|
2023-01-06 22:53:42 +01:00
|
|
|
VERSION=${VERSION:-1.85}
|
2010-05-13 00:58:06 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2010-05-13 00:58:06 +02:00
|
|
|
|
2010-06-04 07:04:02 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-19 10:59:36 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:04:02 +02:00
|
|
|
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
|
|
|
|
|
2010-05-13 00:58:06 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
# Do you want to force the package to be compiled with standard
|
|
|
|
# Slackware CFLAGS, as set below? The author's makefile includes
|
|
|
|
# a fancy set of flags, which the program has presumably been tested
|
|
|
|
# with, so it should be fine to use them. If you're a stickler about
|
|
|
|
# Slackware-ism, you can build with FORCE_SLACK_CFLAGS=yes to use
|
|
|
|
# $SLKCFLAGS instead of the author's.
|
|
|
|
FORCE_SLACK_CFLAGS=${FORCE_SLACK_CFLAGS:-no}
|
|
|
|
|
2016-08-19 10:59:36 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:58:06 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:04:02 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:58:06 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM
|
|
|
|
tar xvf $CWD/${PRGNAM}_$VERSION.tar.gz
|
|
|
|
cd $PRGNAM
|
|
|
|
chown -R root:root .
|
2021-03-23 05:37:20 +01:00
|
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
|
|
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
|
|
|
|
|
|
|
|
# 20210323 bkw: optional patch, disabled by default. Sorry, I can't
|
|
|
|
# stand the "Do you really want to quit?" prompt, and there's no
|
|
|
|
# config file or CLI option to disable it.
|
|
|
|
[ "${CONFIRM_QUIT:-yes}" = "no" ] && patch -p1 < $CWD/no_confirm_quit.diff
|
2010-05-13 00:58:06 +02:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
if [ "$FORCE_SLACK_CFLAGS" = "yes" ]; then
|
2014-03-19 07:10:50 +01:00
|
|
|
make OPTIMIZER="$SLKCFLAGS"
|
2010-05-13 00:58:06 +02:00
|
|
|
else
|
2014-03-19 07:10:50 +01:00
|
|
|
make
|
2010-05-13 00:58:06 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# no DESTDIR support, --mandir is ignored, docs go to /usr/share/doc,
|
|
|
|
# let's not use `make install' at all.
|
2021-03-23 05:37:20 +01:00
|
|
|
mkdir -p $PKG/usr/games $PKG/usr/man/man6 $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:58:06 +02:00
|
|
|
|
2021-03-23 05:37:20 +01:00
|
|
|
install -s -m0755 -o root -g root $PRGNAM $PKG/usr/games
|
2010-05-13 00:58:06 +02:00
|
|
|
|
2014-03-19 07:10:50 +01:00
|
|
|
gzip -9c < $PRGNAM.man > $PKG/usr/man/man6/$PRGNAM.6.gz
|
2010-05-13 00:58:06 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/{applications,pixmaps}
|
|
|
|
cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications
|
|
|
|
cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
COPYRIGHT CREDITS ARCHITECTURE README.History README.LEGAL README.licence \
|
2014-03-19 07:10:50 +01:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 00:58:06 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
|
|
|
|
cp manual/* $PKG/usr/doc/$PRGNAM-$VERSION/html
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|