From 97cd9d9b0f6abb3d7e9b2dce020c7b24f10d8a5b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 24 Feb 2017 05:30:01 -0500 Subject: [PATCH] desktop/wmmon: Fix doinst.sh. Signed-off-by: B. Watson --- desktop/wmmon/README | 2 ++ desktop/wmmon/doinst.sh | 14 +++++++++++- desktop/wmmon/wmmon.SlackBuild | 39 +++++++++++++++++++++++++++++----- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/desktop/wmmon/README b/desktop/wmmon/README index ef5a14b94d..a9a52453c6 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 0d298a369b..3bfcee2d02 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 55a590755d..3de7dccf81 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