desktop/wmmon: Fix doinst.sh.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2017-02-24 05:30:01 -05:00 committed by Willy Sudiarto Raharjo
parent e6ec80e84c
commit 97cd9d9b0f
3 changed files with 49 additions and 6 deletions

View file

@ -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.

View file

@ -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

View file

@ -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