aboutsummaryrefslogtreecommitdiff
path: root/games/mrrescue/mrrescue.SlackBuild
blob: bcb9ee7117c8ed8e452024989aa77890430fc3ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh

# Slackware build script for mrrescue

# Written by B. Watson (yalhcru@gmail.com)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# 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).

PRGNAM=mrrescue
VERSION=${VERSION:-1.02e+20180818_a5be73c}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

SRCVER=${VERSION%%+*}
DIFFVER=${VERSION##*+}

ARCH=noarch

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION

# 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 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
# with the gimp.
mkdir -p $PKG/usr/share/pixmaps
cat $CWD/$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 *.md LICENSE $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
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}