diff options
Diffstat (limited to 'games/mrrescue/mrrescue.SlackBuild')
-rw-r--r-- | games/mrrescue/mrrescue.SlackBuild | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/games/mrrescue/mrrescue.SlackBuild b/games/mrrescue/mrrescue.SlackBuild index 488bda4f29..7803da1cbf 100644 --- a/games/mrrescue/mrrescue.SlackBuild +++ b/games/mrrescue/mrrescue.SlackBuild @@ -1,19 +1,34 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for mrrescue -# Written by B. Watson (yalhcru@gmail.com) +# Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20211022 bkw: BUILD=2, new-style icons. +# 20200415 bkw: update to latest upstream git, commit a5be73c. Required +# for love-11.x support (someone upgraded love and didn't bother to tell +# me so this has been broken for ~2 year). + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=mrrescue -VERSION=${VERSION:-1.02e} -BUILD=${BUILD:-1} +VERSION=${VERSION:-1.02e+20180818_a5be73c} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +SRCVER=${VERSION%%+*} +DIFFVER=${VERSION##*+} ARCH=noarch -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -27,28 +42,39 @@ rm -rf $PRGNAM-$VERSION mkdir -p $PRGNAM-$VERSION cd $PRGNAM-$VERSION -# the source is also the binary. we only need to extract -# any documentation (which boilds down to one file): -unzip $CWD/$PRGNAM$VERSION.love LICENSE +# For releases, the source is also the binary: ".love" files are just +# zip archives full of lua source code. Since we have to apply a patch +# from upstream git, we have to extract it, then recreate it. +unzip $CWD/$PRGNAM$SRCVER.love +patch -p1 < $CWD/$DIFFVER.diff +zip -r tmp.zip * # no find/chmod boilerplate, explicit permissions mkdir -p $PKG/usr/games echo '#!/usr/bin/env love' > $PKG/usr/games/$PRGNAM -cat $CWD/$PRGNAM$VERSION.love >> $PKG/usr/games/$PRGNAM +cat tmp.zip >> $PKG/usr/games/$PRGNAM chmod 755 $PKG/usr/games/$PRGNAM -# icon is a piece of data/splash.png from the payload file, chopped up +# icons made from piece of data/splash.png from the payload file, chopped up # with the gimp. + +for px in 16 32 48 64 128; do + size=${px}x${px} + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + convert -resize $size $CWD/$PRGNAM.png $dir/$PRGNAM.png +done + mkdir -p $PKG/usr/share/pixmaps -cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png # .desktop written for this build mkdir -p $PKG/usr/share/applications cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -install -oroot -groot -m0644 LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +install -oroot -groot -m0644 *.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install @@ -56,4 +82,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |