aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authordsomero <xgizzmo@slackbuilds.org>2012-09-30 01:13:28 -0400
committerRobby Workman <rworkman@slackbuilds.org>2012-09-30 20:01:06 -0500
commitebc138379a8ff9c8f4d9a3baead9334dd0ead8f3 (patch)
treeea80811f083bb87358dbf89e31e7801e4aee9668 /python
parent932b788044853a1ad1775e222977ec05d7df7feb (diff)
python/python-pypolicyd-spf: Fixed (Don't clobber config files)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'python')
-rw-r--r--python/python-pypolicyd-spf/doinst.sh15
-rw-r--r--python/python-pypolicyd-spf/python-pypolicyd-spf.SlackBuild8
2 files changed, 20 insertions, 3 deletions
diff --git a/python/python-pypolicyd-spf/doinst.sh b/python/python-pypolicyd-spf/doinst.sh
new file mode 100644
index 0000000000000..f5328ded2aff7
--- /dev/null
+++ b/python/python-pypolicyd-spf/doinst.sh
@@ -0,0 +1,15 @@
+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/python-policyd-spf/policyd-spf.conf.new
+
diff --git a/python/python-pypolicyd-spf/python-pypolicyd-spf.SlackBuild b/python/python-pypolicyd-spf/python-pypolicyd-spf.SlackBuild
index ebf7c517bd7d7..9ca9404c29245 100644
--- a/python/python-pypolicyd-spf/python-pypolicyd-spf.SlackBuild
+++ b/python/python-pypolicyd-spf/python-pypolicyd-spf.SlackBuild
@@ -24,7 +24,7 @@
PRGNAM=python-pypolicyd-spf
VERSION=${VERSION:-0.8.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
ORIGNAM=$(echo $PRGNAM | cut -f2- -d-)
@@ -79,21 +79,23 @@ find . \
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+mv $PKG/etc/python-policyd-spf/policyd-spf.conf \
+ $PKG/etc/python-policyd-spf/policyd-spf.conf.new
+
# Move man-pages to correct location
mv $PKG/usr/share/man $PKG/usr/
rm -rf $PKG/usr/share
find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-
cp -a \
CHANGES LICENSE README README.per_user_whitelisting TODO \
$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}