aboutsummaryrefslogtreecommitdiff
path: root/desktop/wmmon
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2017-02-24 05:30:01 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-02-25 07:30:24 +0700
commit97cd9d9b0f6abb3d7e9b2dce020c7b24f10d8a5b (patch)
tree8dd240cacc42c73207d7d7ab1b76d233c1ef4f14 /desktop/wmmon
parente6ec80e84cf1fb1441b6db986112e0845872ca68 (diff)
desktop/wmmon: Fix doinst.sh.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'desktop/wmmon')
-rw-r--r--desktop/wmmon/README2
-rw-r--r--desktop/wmmon/doinst.sh14
-rw-r--r--desktop/wmmon/wmmon.SlackBuild39
3 files changed, 49 insertions, 6 deletions
diff --git a/desktop/wmmon/README b/desktop/wmmon/README
index ef5a14b94d729..a9a52453c6eab 100644
--- a/desktop/wmmon/README
+++ b/desktop/wmmon/README
@@ -1,3 +1,5 @@
+wmmon (windowmaker dockapp to monitor CPU, disk, and memory usage)
+
WMMon monitors the your CPU, Disk I/O, Memory and Swap usage, and shows
an average load for CPU and Disk I/O. It also displays your uptime. You
just click on it to toggle the display.
diff --git a/desktop/wmmon/doinst.sh b/desktop/wmmon/doinst.sh
index 0d298a369b7e4..3bfcee2d02562 100644
--- a/desktop/wmmon/doinst.sh
+++ b/desktop/wmmon/doinst.sh
@@ -1,2 +1,14 @@
-[ ! -r etc/wmmonrc ] && cat etc/wmmonrc.sample > etc/wmmonrc
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+config etc/wmmonrc.new
diff --git a/desktop/wmmon/wmmon.SlackBuild b/desktop/wmmon/wmmon.SlackBuild
index 55a590755dce9..3de7dccf81286 100644
--- a/desktop/wmmon/wmmon.SlackBuild
+++ b/desktop/wmmon/wmmon.SlackBuild
@@ -6,9 +6,40 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20170224 bkw:
+# - BUILD=2
+# - install /etc/wmmonrc as a proper .new config
+# - make doinst.sh treat /etc/wmmonrc.new correctly
+# - don't install INSTALL in package docdir
+# - added notes (to myself) about version numbers, to stop myself
+# from trying to "upgrade" to 1.2b1.
+# - actually mention windowmaker in the README (derp!)
+
+# Notes about versions:
+
+# The version number is from Debian. I don't know why they called it 1.1,
+# because:
+# $ wmmon -v
+# WMMon version 1.2.b2
+# Since I'm using their tarball, I'll stick with their version numbering.
+
+# http://www.dockapps.net/wmmon has a wmmon-1.2b1 release, which looks
+# like a higher version number than we use for VERSION here. However
+# it's really older (missing some options/bugfixes) and this is obvious
+# if you look at the output of wmmon -v (1.2.b1 < 1.2.b2).
+
+# I could package up a newer git commit (there are commits from 2015),
+# but they add complexity (a new libdockapp.so library, as a separate
+# source tree, which wmmon would require as a dependency) and don't fix
+# any bugs or add any features beyond what we've got here. Plus, we've
+# got the same version Debian uses, and Fedora uses effectively the
+# same version too (they include a commit "Remove trailing whitespace"
+# that doesn't change the actual code). Gentoo uses 1.2b1, but I'm not
+# using them for a role model :)
+
PRGNAM=wmmon
VERSION=${VERSION:-1.1+20131205}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -75,12 +106,10 @@ cd $PRGNAM
cd -
mkdir -p $PKG/etc
-cat $CWD/wmmonrc > $PKG/etc/wmmonrc.sample
+cat $CWD/wmmonrc > $PKG/etc/wmmonrc.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- BUGS CHANGES COPYING HINTS INSTALL README TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a BUGS CHANGES COPYING HINTS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install