From 891a1aa3d29b98c81bf065f28d3af26518bc8fd29fb0fc34e83ecc24ca4aac02 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 12 Jan 2023 11:54:01 +0000 Subject: [PATCH] update deb data OBS-URL: https://build.opensuse.org/package/show/server:mail/gromox?expand=0&rev=26 --- debian.changelog | 2 +- debian.gromox.postinst | 47 +++++++++++++++++++++++++++++++++--------- debian.rules | 4 +++- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/debian.changelog b/debian.changelog index b97ecd7..0380384 100644 --- a/debian.changelog +++ b/debian.changelog @@ -1,4 +1,4 @@ -gromox (1.28) unstable; urgency=low +gromox (1.36.23.3447095) unstable; urgency=low * Initial package. diff --git a/debian.gromox.postinst b/debian.gromox.postinst index e459293..d07df6c 100644 --- a/debian.gromox.postinst +++ b/debian.gromox.postinst @@ -1,10 +1,24 @@ #!/bin/sh -# %files -chown root:gromox /etc/gromox || : -chmod 0770 /etc/gromox || : -vd="/var/lib/gromox \ - /var/lib/gromox/domain \ +set -e +. /usr/share/debconf/confmodule + +set_perms() +{ + USER="$1" + GROUP="$2" + MODE="$3" + FILE="$4" + if ! dpkg-statoverride --list "$FILE" >/dev/null 2>&1; then + chown -R "$USER:$GROUP" "$FILE" + chmod -R $MODE "$FILE" + fi +} + +xpostinst() +{ +set_perms root gromox 0770 /etc/gromox || : +for i in /var/lib/gromox \ /var/lib/gromox/queue \ /var/lib/gromox/queue/cache \ /var/lib/gromox/queue/clone \ @@ -12,11 +26,9 @@ vd="/var/lib/gromox \ /var/lib/gromox/queue/mess \ /var/lib/gromox/queue/save \ /var/lib/gromox/queue/timer \ - /var/lib/gromox/user \ - /var/log/gromox" -chown gromox:gromox $vd || : -chmod 0770 $vd || : -chmod 0770 /var/lib/gromox /var/log/gromox || : + /var/log/gromox; do + set_perms gromox gromox 0770 "$i" || : +done # %post if test -x /usr/bin/systemd-tmpfiles; then @@ -32,5 +44,20 @@ if test -x /usr/bin/systemctl; then gromox-pop3.service gromox-timer.service gromox-zcore.service \ grommunio-chat.service \ php7.4-fpm.service php8.0-fpm.service php8.1-fpm.service \ + php8.2-fpm.service \ saslauthd.service 2>/dev/null || : fi +} + + +case "$1" in +configure|reconfigure) + xpostinst + ;; +abort-upgrade|abort-remove|abort-deconfigure) + ;; +*) + echo "postinst called with unknown argument \"$1\"" >&2 + exit 1 + ;; +esac diff --git a/debian.rules b/debian.rules index abd8565..2a9c083 100644 --- a/debian.rules +++ b/debian.rules @@ -1,13 +1,15 @@ #!/usr/bin/make -f export DH_VERBOSE=1 phpdir := $(shell readlink -f $$(php-config --ini-path)/..) +INSTDIR := debian/gromox %: dh $@ --parallel --with autoreconf override_dh_auto_install: dh_auto_install - find ${INSTDIR} -type f -name "*.la" -delete + find ${INSTDIR} -type f -name "*.la" -print -delete + perl -i -lpe 's{Type=simple}{Type=simple\nRestart=on-failure}' ${INSTDIR}/lib/systemd/system/*.service for i in /etc/gromox /var/lib/gromox /var/lib/gromox/domain \ /var/lib/gromox/queue /var/lib/gromox/queue/clone \ /var/lib/gromox/queue/mess /var/lib/gromox/queue/save \