Package: mairix
Version: 0.24-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu stonking

Dear Maintainer,

In configure, the Makefile is generated using:

  sed -e "s%@cc@%${MYCC}%; ... s%@LDFLAGS@%${MYLDFLAGS}%; ..." < Makefile.in > 
Makefile

using '%' as the delimiter. When build flags contain '%' (such as URL-encoded 
parameters in -Wl,--package-metadata or custom flags), the substitution breaks:

  sed: -e expression #1, char 777: unknown option to `s'

Fix:
Switch the delimiter from '%' to '|' in configure across the sed substitution 
lines.
The patch is attached.
Description: Switch sed delimiter from '%' to '|' in configure
 Hand-written configure uses '%' as delimiter for Makefile substitutions.
 If compiler or linker flags contain '%' (such as -Wl,--package-metadata
 or URL-encoded options), sed parsing breaks. Switch the delimiter to '|'
 across the substitutions.
Author: Viktor Pashaiev <[email protected]>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mairix/+bug/2170632
Forwarded: no
Last-Update: 2026-10-13

--- a/configure
+++ b/configure
@@ -392,17 +392,17 @@ if [ "x" = "x${DOCDIR}" ]; then DOCDIR=$
 echo "Generating Makefile"
 
 rm -f Makefile
-sed -e "s%@cc@%${MYCC}%; \
-        s%@defs@%${DEFS}%; \
-        s%@cflags@%${MYCFLAGS}%; \
-        s%@prefix@%${PREFIX}%; \
-        s%@bindir@%${BINDIR}%; \
-        s%@mandir@%${MANDIR}%; \
-        s%@infodir@%${INFODIR}%; \
-        s%@docdir@%${DOCDIR}%; \
-        s%@LIBS@%${LIBS}%; \
-        s%@CPPFLAGS@%${MYCPPFLAGS}%; \
-        s%@LDFLAGS@%${MYLDFLAGS}%; \
+sed -e "s|@cc@|${MYCC}|; \
+        s|@defs@|${DEFS}|; \
+        s|@cflags@|${MYCFLAGS}|; \
+        s|@prefix@|${PREFIX}|; \
+        s|@bindir@|${BINDIR}|; \
+        s|@mandir@|${MANDIR}|; \
+        s|@infodir@|${INFODIR}|; \
+        s|@docdir@|${DOCDIR}|; \
+        s|@LIBS@|${LIBS}|; \
+        s|@CPPFLAGS@|${MYCPPFLAGS}|; \
+        s|@LDFLAGS@|${MYLDFLAGS}|; \
        " < Makefile.in > Makefile
 
 # Avoid editing Makefile instead of Makefile.in

Reply via email to