summaryrefslogtreecommitdiffstats
path: root/games/lmarbles/lmarbles.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/lmarbles/lmarbles.SlackBuild')
-rw-r--r--games/lmarbles/lmarbles.SlackBuild40
1 files changed, 25 insertions, 15 deletions
diff --git a/games/lmarbles/lmarbles.SlackBuild b/games/lmarbles/lmarbles.SlackBuild
index 72c27b5b29..0d9de0c265 100644
--- a/games/lmarbles/lmarbles.SlackBuild
+++ b/games/lmarbles/lmarbles.SlackBuild
@@ -2,15 +2,20 @@
# Slackware build script for lmarbles
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211022 bkw: BUILD=2
+# - new-style icons.
+# - /usr/share/lmarbles => /usr/share/games/lmarbles.
+# - better .desktop file.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lmarbles
VERSION=${VERSION:-1.0.8}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -22,9 +27,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
@@ -57,11 +59,11 @@ 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 640 -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 {} \+
+
+# 20211022 bkw: no way to set a variable for this.
+sed -i '/^inst_dir=/s,/lmarbles,/games&,' configure
# man page was locally modified (since it's inaccurate), use our version.
cat $CWD/$PRGNAM.6 > src/$PRGNAM.6
@@ -81,12 +83,20 @@ CXXFLAGS="$SLKCFLAGS" \
make
make install-strip DESTDIR=$PKG
-# icon converted from lmarbles48.gif (PNG icons are a bit more standard-ey),
-# update .desktop file to use it.
-rm -rf $PKG/usr/share/icons
+# 20211022 bkw: simpler to replace the desktop file than
+# include all the sed code to edit it here.
+cat $CWD/$PRGNAM.desktop > \
+ $PKG/usr/share/applications/$PRGNAM.desktop
+
+for px in 32 48; do
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ convert $PRGNAM$px.gif png32:$dir/$PRGNAM.png
+done
+
mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
-sed -i "/^Icon/s,=.*,=$PRGNAM," $PKG/usr/share/applications/$PRGNAM.desktop
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
gzip $PKG/usr/man/man6/$PRGNAM.6