aboutsummaryrefslogtreecommitdiff
path: root/games/pom1/pom1.SlackBuild
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-27 01:17:26 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-29 17:07:25 +0700
commitced5f851e28d3fdb521dc0f83f7c662a24c80665 (patch)
tree377d40d075a7c5772d848d0fd13ed181a5ff22bf /games/pom1/pom1.SlackBuild
parent2b6fe88c16d9044b0c718d5debd227c734d29243 (diff)
games/pom1: New-style icons.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/pom1/pom1.SlackBuild')
-rw-r--r--games/pom1/pom1.SlackBuild54
1 files changed, 37 insertions, 17 deletions
diff --git a/games/pom1/pom1.SlackBuild b/games/pom1/pom1.SlackBuild
index a1000b542794f..7fe6c77e401df 100644
--- a/games/pom1/pom1.SlackBuild
+++ b/games/pom1/pom1.SlackBuild
@@ -7,11 +7,18 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/
# for details.
+# 20211027 bkw: BUILD=2
+# - new-style icons.
+# - binary in /usr/games.
+# - get rid of silly wrapper script.
+# - /usr/share/pom1 => /usr/share/games/pom1.
+# - man page.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pom1
VERSION=${VERSION:-1.0.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -23,9 +30,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# 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
@@ -58,18 +62,23 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+sed -i -e 's/Emulator;/&System;/' \
+ -e 's,Exec=,&/usr/games/,' \
+ src/$PRGNAM.desktop.in
-sed -i 's/Emulator;/&System;/' src/$PRGNAM.desktop.in
+# 20211027 bkw: we don't need a wrapper script that just sets one
+# environment variable and calls the real binary, when we can
+# set the default in the code.
+sed -i '/setRomDirectory/s,"roms","/usr/share/games/pom1/roms",' src/main.c
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
+ --bindir=/usr/games \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
@@ -80,24 +89,35 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install-strip DESTDIR=$PKG
-mv $PKG/usr/share/icons $PKG/usr/share/pixmaps
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+rm -rf $PKG/usr/share/icons
+mkdir -p $PKG/usr/share/games
+mv $PKG/usr/share/$PRGNAM $PKG/usr/share/games/$PRGNAM
+
+for px in 16 32 48 64 128; do
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ convert -resize $size $CWD/$PRGNAM.png $dir/$PRGNAM.png
+done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
# Why is there a fricken --docdir option when every configure
# script ignores it?!
mv $PKG/usr/share/doc/$PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION
rm -rf $PKG/usr/share/doc
+# man page written by SlackBuild author.
+mkdir -p $PKG/usr/man/man6
+gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
+
# Icon created by Creative Nerds, downloaded from:
# http://www.iconarchive.com/show/wooden-social-icons-by-creativenerds/apple-icon.html
mkdir -p $PKG/usr/share/pixmaps
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
-# I prefer not to clutter /usr/bin with binaries you're not supposed
-# to actually ever run, so:
-mkdir -p $PKG/usr/libexec
-mv $PKG/usr/bin/$PRGNAM-$VERSION $PKG/usr/libexec
-sed -i "s,^$PRGNAM-$VERSION,/usr/libexec/&," $PKG/usr/bin/$PRGNAM
+mv $PKG/usr/games/$PRGNAM-$VERSION $PKG/usr/games/$PRGNAM
cp -a COPYING $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild