From 235bd272bd261b66e28fede5282933ed008a8876 Mon Sep 17 00:00:00 2001
From: Aki Tuomi <aki.tuomi@open-xchange.com>
Date: Tue, 25 Jun 2024 11:24:49 +0300
Subject: [PATCH] doc: Get man page assets from version dependant location

---
 configure.ac    | 3 +++
 doc/Makefile.am | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 190f2d6e3..adfa386e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,9 @@ AC_CONFIG_SRCDIR([src])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 
+PIGEONHOLE_ASSET_VERSION=regexp(AC_PACKAGE_VERSION, [^\([0-9]+\)\.\([0-9]+\)], [\1.\2])
+AC_SUBST(PIGEONHOLE_ASSET_VERSION)
+
 # Autoheader is not needed and does more harm than good for this package. However, it is
 # tightly integrated in autoconf/automake and therefore it is difficult not to use it. As
 # a workaround we give autoheader a dummy config header to chew on and we handle the
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 18e89226d..3d41505f3 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -14,7 +14,7 @@ endif
 
 BUILT_SOURCES = pigeonhole-man
 
-MAN_URL=https://doc.dovecot.org/assets/3.0/pigeonhole-man.txz
+MAN_URL=https://doc.dovecot.org/assets/$(PIGEONHOLE_ASSET_VERSION)/pigeonhole.txz
 
 AM_V_Q = $(am__v_Q_$(V))
 am__v_Q_ = $(am__v_Q_$(AM_DEFAULT_VERBOSITY))
-- 
GitLab