From efed9d8012e8ce0b91a8f3c5eda7e959e0c39890 Mon Sep 17 00:00:00 2001 From: Thomas Butter Date: Thu, 1 Jun 2023 10:50:31 +0200 Subject: [PATCH] Dovecot: compile `fts_xapian` from source to match Dovecot ABI (#3373) Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Co-authored-by: Casper --- Dockerfile | 49 ++++++++++++++++++++++++++------ target/scripts/build/compile.sh | 30 +++++++++++++++++++ target/scripts/build/packages.sh | 19 +++---------- 3 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 target/scripts/build/compile.sh diff --git a/Dockerfile b/Dockerfile index a9095e9b..b5c5ba39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ # syntax=docker.io/docker/dockerfile:1 -# This Dockerfile provides two stages: stage-base and stage-final +# This Dockerfile provides four stages: stage-base, stage-compile, stage-main and stage-final # This is in preparation for more granular stages (eg ClamAV and Fail2Ban split into their own) -# -# Base stage provides all packages, config, and adds scripts -# - -FROM docker.io/debian:11-slim AS stage-base - ARG DEBIAN_FRONTEND=noninteractive ARG DOVECOT_COMMUNITY_REPO=1 ARG LOG_LEVEL=trace +FROM docker.io/debian:11-slim AS stage-base + +ARG DEBIAN_FRONTEND +ARG DOVECOT_COMMUNITY_REPO +ARG LOG_LEVEL + SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] # ----------------------------------------------- @@ -25,11 +25,37 @@ RUN <&1 +} + +_compile_dovecot_fts_xapian diff --git a/target/scripts/build/packages.sh b/target/scripts/build/packages.sh index 9f863899..40e7365e 100644 --- a/target/scripts/build/packages.sh +++ b/target/scripts/build/packages.sh @@ -94,26 +94,12 @@ function _install_dovecot() { declare -a DOVECOT_PACKAGES DOVECOT_PACKAGES=( - dovecot-core dovecot-fts-xapian dovecot-imapd + dovecot-core dovecot-imapd dovecot-ldap dovecot-lmtpd dovecot-managesieved dovecot-pop3d dovecot-sieve dovecot-solr ) if [[ ${DOVECOT_COMMUNITY_REPO} -eq 1 ]]; then - # The package dovecot-fts-xapian is installed from the debian repository. - # Starting with version 1.4.9a-1+deb11u1, a new dependency was added: dovecot-abi-2.3.abiv13 - # dovecot-abi-2.3.abiv13 is a virtual package provided by dovecot-core (from the debian repository). - # However dovecot-core from the community repository provides dovecot-abi-2.3.abiv19. - _log 'trace' "Create and install dummy package 'dovecot-abi-2.3.abiv13' to satisfy 'dovecot-fts-xapian' dependency" - apt-get "${QUIET}" --no-install-recommends install checkinstall - echo -e 'install:\n\t@true' > Makefile - echo 'Dummy package to satisfy dovecot-fts-xapian dependency' > description-pak - checkinstall -y --install=yes --pkgname="dovecot-abi-2.3.abiv13" --pkgversion=1 --maintainer=Nobody --pkggroup=mail - # Cleanup - rm description-pak dovecot-abi-2.3.abiv13*.deb Makefile - apt-get "${QUIET}" purge checkinstall - apt-get "${QUIET}" autoremove - _log 'trace' 'Using Dovecot community repository' curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import gpg --export ED409DA1 > /etc/apt/trusted.gpg.d/dovecot.gpg @@ -125,6 +111,9 @@ function _install_dovecot() { _log 'debug' 'Installing Dovecot' apt-get "${QUIET}" --no-install-recommends install "${DOVECOT_PACKAGES[@]}" + + # dependency for fts_xapian + apt-get "${QUIET}" --no-install-recommends install libxapian30 } function _install_rspamd() {