Package: courier-authlib-dev
Version: 0.73.1-2
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs
Control: affects -1 + src:maildrop

maildrop fails to cross build from source. It attempts to discover
libcourierauth.so using the courierauthconfig tool. courierauthconfig is
entirely unusable for cross compilation. It is an ELF binary, so what
currently happens is that running it fails with an "Exec format error".
Typically programs would be installed for the build architecture, but
doing that for courierauthconfig would be really bad as its output is
architecture-dependent. While the build architecture binary would run,
it would produce unsuitable parameters.

I think this is mostly unsolvable. However, if all that a user wants is
to link libcourierauth.so, we might provide another (cross compilation
compatible) mechanism to discover it. Enter pkg-config. You probably
know it as it effectively has become the standard for this kind of
thing. You'll find a patch for adding a very minimal courierauth.pc file
to courier-authlib-dev attached to this mail. Please do not just apply
it. Instead, please discuss the matter with upstream. Yes, that may take
longer. Thank you.

Helmut
diff -Nru courier-authlib-0.73.1/debian/changelog 
courier-authlib-0.73.1/debian/changelog
--- courier-authlib-0.73.1/debian/changelog     2026-07-16 04:55:42.000000000 
+0200
+++ courier-authlib-0.73.1/debian/changelog     2026-09-22 13:39:13.000000000 
+0200
@@ -1,3 +1,10 @@
+courier-authlib (0.73.1-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Provide a pkgconfig file for libcourierauth.so. (Closes: #-1)
+
+ -- Helmut Grohne <[email protected]>  Tue, 22 Sep 2026 13:39:13 +0200
+
 courier-authlib (0.73.1-2) unstable; urgency=medium
 
   * debian/control:  Add courier-authlib-dev Build-Depends on
diff -Nru courier-authlib-0.73.1/debian/courier-authlib-dev.install 
courier-authlib-0.73.1/debian/courier-authlib-dev.install
--- courier-authlib-0.73.1/debian/courier-authlib-dev.install   2026-05-26 
23:03:13.000000000 +0200
+++ courier-authlib-0.73.1/debian/courier-authlib-dev.install   2026-09-22 
13:07:33.000000000 +0200
@@ -35,3 +35,6 @@
 /usr/lib/*/courier-authlib/libcourierauthcommon.so
 /usr/lib/*/courier-authlib/libcourierauthsasl.so
 /usr/lib/*/courier-authlib/libcourierauthsaslclient.so
+
+# Install .pc files
+/usr/lib/*/pkgconfig/*.pc
diff -Nru courier-authlib-0.73.1/debian/patches/cross.patch 
courier-authlib-0.73.1/debian/patches/cross.patch
--- courier-authlib-0.73.1/debian/patches/cross.patch   1970-01-01 
01:00:00.000000000 +0100
+++ courier-authlib-0.73.1/debian/patches/cross.patch   2026-09-22 
13:18:59.000000000 +0200
@@ -0,0 +1,33 @@
+--- courier-authlib-0.73.1.orig/Makefile.am
++++ courier-authlib-0.73.1/Makefile.am
+@@ -24,6 +24,9 @@
+ sbin_PROGRAMS=authtest authenumerate authpasswd
+ bin_PROGRAMS=courierauthconfig
+ 
++pkgconfigdir=$(libdir)/pkgconfig
++pkgconfig_DATA = courierauth.pc
++
+ EXTRA_LTLIBRARIES=libauthuserdb.la \
+       libauthpam.la libauthpwd.la libauthshadow.la \
+       libauthpgsql.la \
+--- courier-authlib-0.73.1.orig/configure.ac
++++ courier-authlib-0.73.1/configure.ac
+@@ -1037,6 +1037,7 @@
+       README.authdebug.html
+       dbobj.config
+       dbobj.h
++      courierauth.pc
+       courier-authlib.spec
+       courier-authlib.sysvinit
+       courier-authlib.service
+--- /dev/null
++++ courier-authlib-0.73.1/courierauth.pc.in
+@@ -0,0 +1,8 @@
++prefix=@prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: courierauth
++Version: @PACKAGE_VERSION@
++Libs: -L${libdir}/@PACKAGE@ -lcourierauth
++Cflags: -I${includedir}
diff -Nru courier-authlib-0.73.1/debian/patches/series 
courier-authlib-0.73.1/debian/patches/series
--- courier-authlib-0.73.1/debian/patches/series        2026-06-26 
22:49:44.000000000 +0200
+++ courier-authlib-0.73.1/debian/patches/series        2026-09-22 
12:43:22.000000000 +0200
@@ -6,3 +6,4 @@
 
 # Limit the default active modules to authpam.
 limit-default-active-modules.patch
+cross.patch

Reply via email to