diff --git a/install_update_dovecot-2.4.sh b/install_update_dovecot-2.4.sh index 81f75e4..b8b152c 100755 --- a/install_update_dovecot-2.4.sh +++ b/install_update_dovecot-2.4.sh @@ -2639,6 +2639,58 @@ if $_new ; then fi +# Dovecot's configure script queries pkg-config for "systemd" and expects +# the variable "systemdsystemunitdir" to be defined. +# On minimal Debian(13)-based systems, only libsystemd.pc is provided and +# no systemd.pc (and often no systemd binary) exists. +# This pkg-config wrapper provides the missing metadata so configure +# can auto-detect the correct systemd unit installation directory. +# +if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 13 ]] ; then + echononl " Create '/usr/lib/x86_64-linux-gnu/pkgconfig/systemd.pc'." + if [[ ! -f "/usr/lib/x86_64-linux-gnu/pkgconfig/systemd.pc" ]] ; then + cat <<'EOF' > /usr/lib/x86_64-linux-gnu/pkgconfig/systemd.pc 2>>${_log_dir}/debian-install.log +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib/x86_64-linux-gnu +includedir=/usr/include + +# Some build systems (incl. Dovecot's configure) query this to decide where +# to install systemd service/unit files: +systemdsystemunitdir=/usr/lib/systemd/system + +Name: systemd +Description: systemd (pkg-config compatibility wrapper) +Version: 0 +Requires: libsystemd +EOF + + if [[ $? -gt 0 ]] ; then + echo -e "$rc_failed" + error "$(cat $log_file)" + + echo "" + echo " command was:" + echo " ln -s libsystemd.pc /usr/lib/x86_64-linux-gnu/pkgconfig/systemd.pc" + echo "" + + echononl " continue anyway [yes/no]: " + read OK + OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')" + while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do + echononl "Wrong entry! - repeat [yes/no]: " + read OK + done + [[ $OK = "yes" ]] || fatal "Abbruch durch User" + else + echo -e "$rc_done" + fi + else + echo -e "$rc_skipped" + fi +fi + + ## ----------------- ## - Create Users/groups needed for dovecot @@ -2778,6 +2830,11 @@ if $systemd_support ; then fi #--with-systemdsystemunitdir=/etc/systemd/system/" +#if [[ "${os_dist,,}" = "debian" ]] && [[ "$os_version" -ge 13 ]] ; then +# config_params="$config_params systemdsystemunitdir=/lib/systemd/system" +#fi + + echononl " Configure Dovecot.." #./configure \ # --prefix=/usr/local/dovecot-${_version} \ @@ -3151,12 +3208,12 @@ EOF echononl " Create empty file '$(basename "${_conf_file}")'.." if [[ ! -f "${_conf_file}" ]] ; then _failed=false - cat <<'EOF' > "${_conf_file}" 2> "${log_file}" + cat < "${_conf_file}" 2> "${log_file}" ## ## Settings for the Sieve interpreter ## -# see also: https://doc.dovecot.org/2.4.1/core/plugins/sieve.html +# see also: https://doc.dovecot.org/${_version}/core/plugins/sieve.html # To use Sieve, you will first need to make sure you are using Dovecot LDA or LMTP Server # for delivering incoming mail to users' mailboxes. @@ -3221,12 +3278,12 @@ EOF echononl " Create empty file '$(basename "${_conf_file}")'.." if [[ ! -f "${_conf_file}" ]] ; then _failed=false - cat <<'EOF' > "${_conf_file}" 2> "${log_file}" + cat < "${_conf_file}" 2> "${log_file}" ## ## Settings for the Sieve Vacation Extension ## -# see also: https://doc.dovecot.org/2.4.1/core/config/sieve/extensions/vacation.html +# see also: https://doc.dovecot.org/${_version}/core/config/sieve/extensions/vacation.html # The Sieve vacation extension (RFC 5230) defines a mechanism to generate automatic # replies to incoming email messages. It takes various precautions to make sure replies @@ -6291,7 +6348,7 @@ EOF # same as IMAP's LOGIN command. The LOGIN command is internally handled using PLAIN # mechanism. # -# see https://doc.dovecot.org/2.4.1/core/config/auth/mechanisms/overview.html for +# see https://doc.dovecot.org/${_version}/core/config/auth/mechanisms/overview.html for # further (non-rcCleartext) Authentication. auth_mechanisms = ${auth_mechanisms} EOF @@ -6417,11 +6474,11 @@ if [[ $dovecot_major_version -gt 2 ]] \ if [[ "$db_driver" = "pgsql" ]]; then - read -r -d '' NEW_BLOCK <<'EOF' + read -r -d '' NEW_BLOCK <