aboutsummaryrefslogtreecommitdiff
path: root/desktop/dunst
diff options
context:
space:
mode:
authorС. С. Болоканаръ <sbolokanov@abv.bg>2021-01-23 16:20:54 +0200
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-01-24 00:04:25 +0700
commit52dcad25c97173bb64bf1966e3be69d9fcb0a47d (patch)
treed8b0b5fc7303b962662d7e17f69208e0ecc208d2 /desktop/dunst
parente1bc132e995bed646520a4d0a3c5efeb8b82767b (diff)
desktop/dunst: don't clobber config
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'desktop/dunst')
-rw-r--r--desktop/dunst/README2
-rw-r--r--desktop/dunst/doinst.sh14
-rw-r--r--desktop/dunst/dunst.SlackBuild25
-rw-r--r--desktop/dunst/dunst.info2
4 files changed, 29 insertions, 14 deletions
diff --git a/desktop/dunst/README b/desktop/dunst/README
index e6211b084e9a2..4ccb5add3361d 100644
--- a/desktop/dunst/README
+++ b/desktop/dunst/README
@@ -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.
diff --git a/desktop/dunst/doinst.sh b/desktop/dunst/doinst.sh
new file mode 100644
index 0000000000000..c3a0ab28b9952
--- /dev/null
+++ b/desktop/dunst/doinst.sh
@@ -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
diff --git a/desktop/dunst/dunst.SlackBuild b/desktop/dunst/dunst.SlackBuild
index cb82fa0e70022..62f7e5092b58e 100644
--- a/desktop/dunst/dunst.SlackBuild
+++ b/desktop/dunst/dunst.SlackBuild
@@ -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}
diff --git a/desktop/dunst/dunst.info b/desktop/dunst/dunst.info
index ec286e724b8ca..39b0e93474241 100644
--- a/desktop/dunst/dunst.info
+++ b/desktop/dunst/dunst.info
@@ -6,5 +6,5 @@ MD5SUM="e42e7a53741066b137dcb92bb8c22020"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Симонъ С. Болокановъ"
+MAINTAINER="S. S. Bolokanar"
EMAIL="sbolokanov@abv.bg"