Browse Source

ap/monkeysphere: Protect configuration files.

slackware-14.2
Damien Goutte-Gattat 9 years ago
parent
commit
89dab2ab1c
  1. 13
      ap/monkeysphere/doinst.sh
  2. 7
      ap/monkeysphere/monkeysphere.SlackBuild

13
ap/monkeysphere/doinst.sh

@ -1,4 +1,17 @@
#!/bin/sh
config()
{
NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
rm $NEW
fi
}
config etc/monkeysphere/monkeysphere-authentication.conf.new
config etc/monkeysphere/monkeysphere-host.conf.new
config etc/monkeysphere/monkeysphere.conf.new
if ! grep ^monkeysphere /etc/group > /dev/null ; then
/usr/sbin/groupadd -g 290 monkeysphere

7
ap/monkeysphere/monkeysphere.SlackBuild

@ -33,7 +33,7 @@ WGET=${WGET:-http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monkeys
# Build infos
NAMEPKG=${NAMEPKG:-monkeysphere}
BUILD=${BUILD:-2GGD}
BUILD=${BUILD:-3GGD}
ARCH=noarch
EXT=${EXT:-txz}
@ -76,6 +76,11 @@ mv $PKG/usr/share/doc/monkeysphere $PKG/usr/doc/$NAME
rmdir $PKG/usr/share/doc
install -m 644 COPYING README $PKG/usr/doc/$NAME
# Protect configuration files
for f in "" -authentication -host ; do
mv $PKG/etc/monkeysphere/monkeysphere$f.conf $PKG/etc/monkeysphere/monkeysphere$f.conf.new
done
# Copy slack-desc and doinst.sh files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh

Loading…
Cancel
Save