2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2020-11-20 16:10:21 +01:00
|
|
|
|
|
|
|
# Slackware build script for sumeria
|
|
|
|
|
2022-06-08 18:28:03 +02:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2020-11-20 16:10:21 +01:00
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
|
|
|
# VERSION came from the server timestamp of the source file.
|
|
|
|
|
2023-05-30 21:43:31 +02:00
|
|
|
# 20230530 bkw: BUILD=2, actually use SLKCFLAGS.
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2020-11-20 16:10:21 +01:00
|
|
|
PRGNAM=sumeria
|
|
|
|
VERSION=${VERSION:-20020219}
|
2023-05-30 21:43:31 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2020-11-20 16:10:21 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2020-11-20 16:10:21 +01: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
|
|
|
|
|
2020-11-20 16:10:21 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG/usr/games $OUTPUT
|
|
|
|
cd $PKG/usr/games
|
2023-05-30 21:43:31 +02:00
|
|
|
gcc $SLKCFLAGS -include stdlib.h -Wl,-s -o $PRGNAM $CWD/$PRGNAM.c -lm
|
2020-11-20 16:10:21 +01:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
|
|
|
|
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
|