slackbuilds_ponce/games/eduke32_hires_pack/eduke32_hires_pack.SlackBuild

64 lines
1.7 KiB
Bash

#!/bin/sh
# 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}