aboutsummaryrefslogtreecommitdiff
path: root/games/scribble/scribble.SlackBuild
blob: 84c500dfb52098871c0dc1ba8d2d10fed0c3855e (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
#!/bin/bash

# Maintained by Gwenhael Le Moine <gwenhael.le.moine@gmail.com>

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=scribble
VERSION=${VERSION:-1.11_1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}

ARCH=noarch

SRCVERS=$(printf $VERSION | tr _ -)

# 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

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e 

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

tar xf $CWD/${PRGNAM}_$SRCVERS.tar.gz
cd $PRGNAM
chown -R root.root *
find . -perm 777 -exec chmod 755 {} \;

make prefix=$PKG/usr mandir=$PKG/usr/man
gzip -9 $PKG/usr/man/man6/scribble.6

# Racket also has a 'scribble' binary in /usr/bin
# Scribble's scribble is in /usr/games but Racket's steal its place in $PATH
( cd $PKG/usr/games/ ; ln -s scribble scribble-scrabble )
( cd $PKG/usr/man/man6/ ; ln -s scribble.6.gz scribble-scrabble.6.gz )

chmod -R o-w $PKG
chown -R root:root $PKG

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

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