diff -pruN 2.2.6-1/debian/changelog 2.2.6-1ubuntu1/debian/changelog
--- 2.2.6-1/debian/changelog	2019-07-12 18:53:47.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/changelog	2020-10-10 19:43:07.000000000 +0000
@@ -1,3 +1,9 @@
+discount (2.2.6-1ubuntu1) groovy; urgency=medium
+
+  * Really honour CPPFLAGS and also LDFLAGS during the build
+
+ -- Balint Reczey <rbalint@ubuntu.com>  Sat, 10 Oct 2020 21:43:07 +0200
+
 discount (2.2.6-1) unstable; urgency=medium
 
   * New upstream release
diff -pruN 2.2.6-1/debian/control 2.2.6-1ubuntu1/debian/control
--- 2.2.6-1/debian/control	2019-07-12 18:53:47.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/control	2020-10-10 19:43:07.000000000 +0000
@@ -1,7 +1,8 @@
 Source: discount
 Section: text
 Priority: optional
-Maintainer: Alessandro Ghedini <ghedo@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Alessandro Ghedini <ghedo@debian.org>
 Build-Depends: debhelper (>= 12)
 Standards-Version: 4.4.0
 Vcs-Git: https://salsa.debian.org/debian/discount.git
diff -pruN 2.2.6-1/debian/patches/0001-Honor-CPPFLAGS.patch 2.2.6-1ubuntu1/debian/patches/0001-Honor-CPPFLAGS.patch
--- 2.2.6-1/debian/patches/0001-Honor-CPPFLAGS.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/patches/0001-Honor-CPPFLAGS.patch	2020-10-10 19:43:07.000000000 +0000
@@ -0,0 +1,42 @@
+From: Balint Reczey <balint.reczey@canonical.com>
+Date: Sat, 10 Oct 2020 20:28:28 +0200
+Subject: [PATCH 1/2] Honor CPPFLAGS
+Forwarded: https://github.com/Orc/discount/pull/230
+
+---
+ Makefile.in   | 3 ++-
+ configure.inc | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 750d9b7..84c6695 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1,4 +1,5 @@
+ CC=@CC@
++CPPFLAGS=@CPPFLAGS@
+ CFLAGS=@CFLAGS@
+ LDFLAGS=@LDFLAGS@
+ AR=@AR@
+@@ -7,7 +8,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@
+ INSTALL_DIR=@INSTALL_DIR@
+ INSTALL_DATA=@INSTALL_DATA@
+ 
+-BUILD=$(CC) -I. $(CFLAGS)
++BUILD=$(CC) -I. $(CPPFLAGS) $(CFLAGS)
+ LINK=$(CC) -L. $(LDFLAGS)
+ 
+ .c.o:
+diff --git a/configure.inc b/configure.inc
+index fd0c9ba..d297685 100755
+--- a/configure.inc
++++ b/configure.inc
+@@ -231,7 +231,7 @@ EOF
+ 
+     LOGN "looking for the $B function"
+ 
+-    if $AC_CC $AC_CFLAGS $AC_LDFLAGS -o ngc$$ ngc$$.c $LIBS; then
++    if $AC_CC $AC_CPPFLAGS $AC_CFLAGS $AC_LDFLAGS -o ngc$$ ngc$$.c $LIBS; then
+ 	AC_DEFINE `echo ${2:-HAVE_$B} | $AC_UPPERCASE` 1
+ 	TLOG " (found)"
+ 	rc=0
diff -pruN 2.2.6-1/debian/patches/0002-Honor-system-s-LDFLAGS-in-librarian.sh.patch 2.2.6-1ubuntu1/debian/patches/0002-Honor-system-s-LDFLAGS-in-librarian.sh.patch
--- 2.2.6-1/debian/patches/0002-Honor-system-s-LDFLAGS-in-librarian.sh.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/patches/0002-Honor-system-s-LDFLAGS-in-librarian.sh.patch	2020-10-10 19:43:07.000000000 +0000
@@ -0,0 +1,32 @@
+From: Balint Reczey <balint.reczey@canonical.com>
+Date: Sat, 10 Oct 2020 21:21:48 +0200
+Subject: [PATCH 2/2] Honor system's LDFLAGS in librarian.sh
+Fixes #228.
+
+Forwarded: https://github.com/Orc/discount/pull/230
+---
+ configure.inc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.inc b/configure.inc
+index d297685..7139f67 100755
+--- a/configure.inc
++++ b/configure.inc
+@@ -1428,7 +1428,7 @@ LIBNAME=\$LIBRARY.dylib
+ FULLNAME=\$LIBNAME
+ 
+ case "\$ACTION" in
+-make)   FLAGS="$AC_CFLAGS -dynamiclib"
++make)   FLAGS="$AC_CFLAGS $AC_LDFLAGS -dynamiclib"
+ 	VFLAGS="-current_version \$VERSION -compatibility_version \$MAJOR"
+ 
+ 	rm -f \$LIBRARY
+@@ -1484,7 +1484,7 @@ LIBNAME=\$LIBRARY.so
+ FULLNAME=\$LIBNAME.\$VERSION
+ 
+ case "\$ACTION" in
+-make)   FLAGS="$AC_CFLAGS -shared"
++make)   FLAGS="$AC_CFLAGS $AC_LDFLAGS -shared"
+ 	unset VFLAGS
+ 	test "$USE_SONAME" && VFLAGS="-Wl,-soname,\$LIBNAME.\$MAJOR"
+ 
diff -pruN 2.2.6-1/debian/patches/series 2.2.6-1ubuntu1/debian/patches/series
--- 2.2.6-1/debian/patches/series	2019-07-12 18:53:47.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/patches/series	2020-10-10 19:43:07.000000000 +0000
@@ -1 +1,3 @@
+0001-Honor-CPPFLAGS.patch
+0002-Honor-system-s-LDFLAGS-in-librarian.sh.patch
 03_fix-typo.patch
diff -pruN 2.2.6-1/debian/rules 2.2.6-1ubuntu1/debian/rules
--- 2.2.6-1/debian/rules	2019-07-12 18:53:47.000000000 +0000
+++ 2.2.6-1ubuntu1/debian/rules	2020-10-10 19:43:07.000000000 +0000
@@ -4,7 +4,6 @@
 %:
 	dh $@ --no-parallel
 
-CFLAGS += $(dpkg-buildflags --get CPPFLAGS)
 
 override_dh_auto_configure:
 	./configure.sh --shared                     \
