summaryrefslogtreecommitdiff
path: root/games/eduke32_hires_pack/eduke32_hires_pack.SlackBuild
blob: b8b19c0fbdcc021bcfa89f5cd898b9142137cef3 (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
#!/bin/bash

# Slackware build script for Eduke32 HRP (High Res Pack)

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

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

PRGNAM=eduke32_hires_pack
VERSION=${VERSION:-4.0_321}
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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

VERMAJOR=$( echo $VERSION | cut -d_ -f1 )
VERMINOR=$( echo $VERSION | cut -d_ -f2 )
ZIPFILE="dn3d_hrp-${VERMAJOR}(${VERMINOR}).zip"

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
unzip $CWD/$ZIPFILE
chown -R root:root .
find . -type d | xargs chmod 755
find . -type f | xargs chmod 644

mkdir -p $PKG/usr/share/games/eduke32
mv autoload $PKG/usr/share/games/eduke32/autoload

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION

# If they have the music pack, include that too
if [ -r $CWD/duke3d_music-sc55.zip ]; then
  unzip -j $CWD/duke3d_music-sc55.zip readme/music_readme.txt
  cat music_readme.txt > $PKG/usr/doc/$PRGNAM-$VERSION/music_readme.txt
  cat $CWD/duke3d_music-sc55.zip > \
    $PKG/usr/share/games/eduke32/autoload/duke3d.grp/duke3d_music-sc55.zip
fi

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

# De-windows-ize the docs
sed -i -s -e "s/\\x92/'/g" \
          -e 's/\x96/-/g' \
          -e 's/\r//g' \
          $PKG/usr/doc/$PRGNAM-$VERSION/*.txt

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}