summaryrefslogtreecommitdiff
path: root/debian/patches/0008-Debian-Use-dpkg-architecture-in-cups-config-to-make-.patch
blob: 7f508d999039ca1ff1f962ece28552c3f8ff0395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:49 +0200
Subject: Debian: Use dpkg-architecture in cups-config to make it
 architecture-independant

 Also filter -L/usr/lib/(triplet) out of LDFLAGS.
 Also strip unnecessary libs from --libs.
 Also launch krb5-config at runtime to avoid getting usr/lib/(triplet) from krb5-config

Bug-Debian: https://bugs.debian.org/741519
Bug-Debian: https://bugs.debian.org/727058
Bug-Debian: https://bugs.debian.org/730838
Bug-Debian: https://bugs.debian.org/751157
---
 cups-config.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cups-config.in b/cups-config.in
index 9dd094d..b073a07 100755
--- a/cups-config.in
+++ b/cups-config.in
@@ -17,7 +17,7 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
 includedir=@includedir@
-libdir=@libdir@
+libdir=${prefix}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
 datarootdir=@datadir@
 datadir=@datadir@
 sysconfdir=@sysconfdir@
@@ -29,7 +29,8 @@ INSTALLSTATIC=@INSTALLSTATIC@
 # flags for compiler and linker...
 CFLAGS=""
 LDFLAGS="@EXPORT_LDFLAGS@"
-LIBS="@LIBGSSAPI@ @DNSSDLIBS@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
+LIBGSSAPI=`[ ! -x /usr/bin/krb5-config ] || /usr/bin/krb5-config --libs`
+LIBS="$LIBGSSAPI @DNSSDLIBS@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@"
 
 # Check for local invocation...
 selfdir=`dirname $0`
@@ -43,7 +44,7 @@ else
 	CFLAGS="$CFLAGS -I$includedir"
     fi
 
-    if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then
+    if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64 -a $libdir != /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH); then
 	LDFLAGS="$LDFLAGS -L$libdir"
     fi
 fi