diff --git a/python/python-pypolicyd-spf/doinst.sh b/python/python-pypolicyd-spf/doinst.sh new file mode 100644 index 0000000000..f5328ded2a --- /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 ebf7c517bd..9ca9404c29 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}