games/smashbattle: Script cleanup.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Dimitris Zlatanidis 2014-04-30 13:19:58 +07:00 committed by Willy Sudiarto Raharjo
parent e067fc0e00
commit c93ddced1c

View file

@ -24,8 +24,8 @@
PRGNAM=smashbattle
SRCVER=${SRCVER:-110224-src}
VERSION=$(echo $SRCVER | grep -o "110224")
BUILD=${BUILD:-1}
VERSION=$(echo $SRCVER | cut -c1-6)
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -70,28 +70,27 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
make
make # compile source code
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# fix launcher paths
sed -i 's/\/local//' $TMP/battle/Battle/linux/smashbattle.desktop
sed -i 's/\/local//' $TMP/battle/Battle/linux/smashbattlefs.desktop
mkdir -p $PKG/usr/share/games/$PRGNAM \
$PKG/usr/share/games/$PRGNAM/gfx \
$PKG/usr/share/games/$PRGNAM/sfx \
$PKG/usr/share/games/$PRGNAM/music \
$PKG/usr/share/games/$PRGNAM/stage \
$PKG/usr/bin
# install data game
DATADIRS="gfx sfx music stage"
for i in $DATADIRS; do
mkdir -p $PKG/usr/share/games/$PRGNAM/$i
cp -rf $i/* $PKG/usr/share/games/$PRGNAM/$i
done
cp -R gfx/* $PKG/usr/share/games/$PRGNAM/gfx/
cp -R sfx/* $PKG/usr/share/games/$PRGNAM/sfx/
cp -R music/* $PKG/usr/share/games/$PRGNAM/music/
cp -R stage/* $PKG/usr/share/games/$PRGNAM/stage/
# install the game executable and launcher
mkdir -p $PKG/usr/bin
install -D -m755 battle $PKG/usr/share/games/$PRGNAM/
cd linux
install -D -m755 smashbattle $PKG/usr/bin/smashbattle
install -D -m755 $PRGNAM $PKG/usr/bin/$PRGNAM
mkdir -p $PKG/usr/share/applications
install -D -m644 $PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop