desktop/dunst: don't clobber config

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
С. С. Болоканаръ 2021-01-23 16:20:54 +02:00 committed by Willy Sudiarto Raharjo
parent e1bc132e99
commit 52dcad25c9
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 29 additions and 14 deletions

View file

@ -7,5 +7,5 @@ we all love to customize to perfection.
Configuration:
To customize dunst you have to copy /usr/share/dunst/dunstrc to
To customize dunst copy /etc/xdg/dunst/dunstrc to
~/.config/dunst/dunstrc and then modify it to your liking.

14
desktop/dunst/doinst.sh Normal file
View file

@ -0,0 +1,14 @@
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/xdg/dunst/dunstrc.new

View file

@ -1,6 +1,7 @@
#!/bin/sh
# Copyright (c) 2014-2016 Симонъ С. Болокановъ Бдинъ, България
# Copyright 2014-2021 S. S. Bolokanar, Bulgaria <sbolokanov@abv.bg>
# С. С. Болоканаръ, България
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -20,21 +21,14 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Written by Симонъ С. Болокановъ <sbolokanov@abv.bg>
# changelog:
# v1.0.0 - Simon Bolokanov
# v1.1.0 - revised for SBo - 09.10.2014
# 15.3.2015 - main site is down, fixed download url. Made some script clean ups
# 3.4.2016 - don't clobber the config
PRGNAM=dunst
VERSION=${VERSION:-1.5.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@ -45,8 +39,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@ -74,12 +68,18 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Fix config path
sed -i 's|${DATADIR}/dunst/dunstrc|/etc/xdg/dunst/dunstrc|g' Makefile
CFLAGS="$SLKCFLAGS" \
make DESTDIR=$PKG \
PREFIX=/usr \
MANPREFIX=/usr/man \
all install
# Don't clobber config
mv -v $PKG/etc/xdg/dunst/dunstrc $PKG/etc/xdg/dunst/dunstrc.new
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
@ -93,6 +93,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -pv $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}

View file

@ -6,5 +6,5 @@ MD5SUM="e42e7a53741066b137dcb92bb8c22020"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Симонъ С. Болокановъ"
MAINTAINER="S. S. Bolokanar"
EMAIL="sbolokanov@abv.bg"