summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorpomfland <pomfland@tfwno.gf>2018-09-21 22:16:01 +0100
committerDavid Spencer <idlemoor@slackbuilds.org>2018-09-21 22:16:01 +0100
commit0b5f135aa8437538afd759304b08009cefe9ad20 (patch)
tree72d2ec3b459f43b65b0d2fa5d9e09c2d76c858ae /games
parent556f1589c5e9b52fab6e33584ff6a895a315a235 (diff)
downloadslackbuilds-0b5f135aa8437538afd759304b08009cefe9ad20.tar.gz
games/xlennart: Updated for version 1.1.1.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r--games/xlennart/README12
-rw-r--r--games/xlennart/doinst.sh17
-rw-r--r--games/xlennart/xlennart.SlackBuild52
3 files changed, 78 insertions, 3 deletions
diff --git a/games/xlennart/README b/games/xlennart/README
index 40771b0375..dfb96bb894 100644
--- a/games/xlennart/README
+++ b/games/xlennart/README
@@ -1,3 +1,15 @@
xlennart is a modification of XBill in which you're defending your
network from spread of SystenD[TM] virus which cleverly disguises
itself as an init process.
+
+You can control which widget sets are compiled in. By default all
+of them are enabled but you can disable them by passing ATHENA=no,
+MOTIF=no or GTK=no to the script. However at least one needs to
+be enabled!
+
+The script has support for making the scoreboard file work across
+different users but this is disabled by default since it might
+pose a local security risk. You can enable it by passing
+SCOREBOARD=yes to the script - it will make the scorefile in
+/var/games writeable by users in games group. The file will be
+preserved on updates but will also remain on package removal!
diff --git a/games/xlennart/doinst.sh b/games/xlennart/doinst.sh
new file mode 100644
index 0000000000..1035dae126
--- /dev/null
+++ b/games/xlennart/doinst.sh
@@ -0,0 +1,17 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
+
+NEW="var/games/xlennart.scores.new"
+OLD="$(dirname $NEW)/$(basename $NEW .new)"
+if [ -r $NEW ] && [ ! -r $OLD ]; then
+ mv $NEW $OLD
+else
+ rm -f $NEW
+fi
diff --git a/games/xlennart/xlennart.SlackBuild b/games/xlennart/xlennart.SlackBuild
index de72197ba1..30531fb3f5 100644
--- a/games/xlennart/xlennart.SlackBuild
+++ b/games/xlennart/xlennart.SlackBuild
@@ -1,9 +1,9 @@
#!/bin/sh
# Slackware build script for xlennart
+# $Id: xlennart.SlackBuild,v 1.7 2018/09/18 03:58:01 pomf Exp pomf $
# Copyright 2018 pomfland
-# $Id: xlennart.SlackBuild,v 1.1 2018/09/08 17:23:24 pomf Exp pomf $
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,7 +25,7 @@
PRGNAM=xlennart
VERSION=${VERSION:-1.1.1}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -70,6 +70,34 @@ 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 {} \;
+MOTIF=${MOTIF:-yes}
+ATHENA=${ATHENA:-yes}
+GTK=${GTK:-yes}
+
+case "$MOTIF" in
+ [Yy][Ee][Ss]) motifopt="enable";;
+ [Nn][Oo]) motifopt="disable";;
+ *) echo 'Unknown parameter in $MOTIF, answer with yes or no.'; exit 1;;
+esac
+
+case "$ATHENA" in
+ [Yy][Ee][Ss]) athenaopt="enable";;
+ [Nn][Oo]) athenaopt="disable";;
+ *) echo 'Unknown parameter in $ATHENA, answer with yes or no.'; exit 1;;
+esac
+
+case "$GTK" in
+ [Yy][Ee][Ss]) gtkopt="enable";;
+ [Nn][Oo]) gtkopt="disable";;
+ *) echo 'Unknown parameter in $GTK, answer with yes or no.'; exit 1;;
+esac
+
+if [ "$MOTIF" = no ] && [ "$ATHENA" = no ] && [ "$GTK" = no ]; then
+ echo "what am I supposed to build? You want none of the three widget sets"
+ exit 1
+fi
+printf "Motif\tAthena\tGTK\tScoreboard\n$motifopt\t$athenaopt\t$gtkopt\t$SCOREBOARD\n"
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@@ -79,6 +107,9 @@ CXXFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
+ --${motifopt}-motif \
+ --${athenaopt}-athena \
+ --${gtkopt}-gtk \
--build=$ARCH-slackware-linux
make
@@ -90,12 +121,27 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+# make scoreboard writeable for users in games group
+if [ "${SCOREBOARD:-no}" = "yes" ]; then
+ cp $PKG/var/games/xlennart.scores.default $PKG/var/games/xlennart.scores.new
+ chown root:games $PKG/var/games/xlennart.scores.new
+ chmod 664 $PKG/var/games/xlennart.scores.new
+fi
+
+# .desktop and icon installation as per Ed Ender's suggestion
+mkdir -p $PKG/usr/share/applications
+cat $PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+mkdir -p $PKG/usr/share/icons/hicolor/64x64/apps
+cp xlennart.xpm $PKG/usr/share/icons/hicolor/64x64/apps
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE README.Credits README.md $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a LICENSE* README* \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}