aboutsummaryrefslogtreecommitdiff
path: root/games/freedoom/freedoom.SlackBuild
blob: 0a1f01bae125ade75ae806dd970c441c0a5d6b4d (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
#!/bin/sh

# Slackware build script for freedoom

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

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

PRGNAM=freedoom
VERSION=${VERSION:-0.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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

for zipfile in $PRGNAM-iwad $PRGNAM-ultimate freedm; do
  cd $TMP/$PRGNAM-$VERSION
  unzip $CWD/$zipfile-$VERSION.zip
  cd $TMP/$PRGNAM-$VERSION/$zipfile-$VERSION
  chown -R root:root .
  chmod 644 *
  mkdir -p $PKG/usr/share/games/doom $PKG/usr/doc/$PRGNAM-$VERSION/$zipfile
  cp ChangeLog COPYING README CREDITS NEWS *.html \
    $PKG/usr/doc/$PRGNAM-$VERSION/$zipfile
  cp *.wad $PKG/usr/share/games/doom
done

# Rename to avoid conflicts with id software's doom.wad and doom2.wad.
# zdoom will correctly find the files with these names, according to 
# http://remilia.zdoom.org/wiki/IWAD

cd $PKG/usr/share/games/doom
mv doom.wad freedoomu.wad
mv doom2.wad freedoom.wad

cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README

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:-tgz}