2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2011-07-04 01:34:25 +02:00
|
|
|
|
|
|
|
# Slackware build script for gargoyle
|
2012-02-20 14:39:16 +01:00
|
|
|
# Written by Dugan Chen (thedoogster@gmail.com)
|
2019-09-07 14:49:07 +02:00
|
|
|
# Yth | Pont-en-Royans, France | yth@ythogtha.org
|
2011-07-04 01:34:25 +02:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2013-11-22 08:34:22 +01:00
|
|
|
PRGNAM=gargoyle
|
2019-12-05 21:20:20 +01:00
|
|
|
VERSION=${VERSION:-2019.1.1}
|
2012-02-20 14:39:16 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2011-07-04 01:34:25 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2011-07-04 01:34:25 +02:00
|
|
|
|
2017-12-30 23:57:07 +01:00
|
|
|
SRCNAM=garglk
|
2019-11-07 23:15:40 +01:00
|
|
|
SRCVER=${VERSION}
|
2017-12-30 23:57:07 +01:00
|
|
|
|
2011-07-04 01:34:25 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-12-30 23:57:07 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2011-07-04 01:34:25 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
|
|
|
# the name of the created package would be, and then exit. This information
|
|
|
|
# could be useful to other scripts.
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2011-07-04 01:34:25 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-12-30 23:57:07 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2011-07-04 01:34:25 +02:00
|
|
|
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
|
2017-12-30 23:57:07 +01:00
|
|
|
rm -rf $SRCNAM-$SRCVER
|
|
|
|
tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz
|
|
|
|
cd $SRCNAM-$SRCVER
|
2011-07-04 01:34:25 +02:00
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2011-07-04 01:34:25 +02:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
2017-12-30 23:57:07 +01:00
|
|
|
env -u BUILD \
|
2011-07-04 01:34:25 +02:00
|
|
|
jam -s DESTDIR=$PKG \
|
|
|
|
-s _BINDIR=/usr/libexec/gargoyle \
|
|
|
|
-s _APPDIR=/usr/libexec/gargoyle \
|
|
|
|
-s _LIBDIR=/usr/lib$LIBDIRSUFFIX/gargoyle \
|
2018-06-26 21:36:40 +02:00
|
|
|
-s CCFLAGS="$SLKCFLAGS -fgnu89-inline -fpermissive" \
|
2011-07-04 01:34:25 +02:00
|
|
|
-dx \
|
|
|
|
install
|
|
|
|
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/bin
|
2012-02-20 14:39:16 +01:00
|
|
|
install -m755 $CWD/gargoyle.sh $PKG/usr/bin/gargoyle
|
2011-07-04 01:34:25 +02:00
|
|
|
|
2012-02-20 14:39:16 +01:00
|
|
|
ln -s gargoyle/libgarglk.so $PKG/usr/lib${LIBDIRSUFFIX}/libgarglk.so
|
2011-07-04 01:34:25 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/etc
|
|
|
|
cp garglk/garglk.ini $PKG/etc/garglk.ini.new
|
|
|
|
|
2012-02-20 14:39:16 +01:00
|
|
|
mkdir -p $PKG/usr/share/pixmaps
|
|
|
|
cp garglk/gargoyle-house.png $PKG/usr/share/pixmaps
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/share/applications
|
|
|
|
cp garglk/gargoyle.desktop $PKG/usr/share/applications
|
|
|
|
|
2011-07-04 01:34:25 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2012-02-20 14:39:16 +01:00
|
|
|
cp -a INSTALL $PKG/usr/doc/$PRGNAM-$VERSION
|
2011-07-04 01:34:25 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
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
|