Package: libauthen-krb5-perl
Version: 1.9-2
Severity: normal
Tags: patch
User: vor...@debian.org
Usertags: multiarch

Hi folks,

Switching krb5 to multiarch will cause libauthen-krb5-perl to begin to fail
to build, because it has hard-coded checks for library paths on the
filesystem.  Rather than walking the filesystem, it would be much better if
it could use an interface like krb5-config to query the necessary library
options.

A patch to do this has now been pushed to Ubuntu.  Please see the attached
patch.

I think krb5-config is now ubiquitous enough that this can be used reliably
(and, therefore, pushed upstream as well).  Please let me know if I'm
mistaken.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru libauthen-krb5-perl-1.9/debian/patches/better-compiler-flags libauthen-krb5-perl-1.9/debian/patches/better-compiler-flags
--- libauthen-krb5-perl-1.9/debian/patches/better-compiler-flags	2010-01-05 11:07:35.000000000 -0800
+++ libauthen-krb5-perl-1.9/debian/patches/better-compiler-flags	2011-04-09 23:37:07.000000000 -0700
@@ -6,8 +6,10 @@
 Reviewed-By: Jonathan Yu <jaw...@cpan.org>
 Origin: vendor
 Forwarded: not-needed
---- a/Makefile.PL
-+++ b/Makefile.PL
+Index: libauthen-krb5-perl-1.9/Makefile.PL
+===================================================================
+--- libauthen-krb5-perl-1.9.orig/Makefile.PL
++++ libauthen-krb5-perl-1.9/Makefile.PL
 @@ -8,7 +8,8 @@
  # any extra libraries?
  # add -lresolv here if you get errors like the following (usually on linux):
@@ -18,20 +20,28 @@
  
  # location of Kerberos 5 includes
  my $KRB5_INCDIR = '/usr/include';
-@@ -30,10 +31,14 @@
- 	$cryptolib = '-lcrypto';
- }
+@@ -18,22 +19,10 @@
  
-+# Don't add -L/usr/lib or -I/usr/include; they can cause problems.
-+my $ldflags  = ($KRB5_LIBDIR eq '/usr/lib')     ? '' : "-L${KRB5_LIBDIR}";
-+my $cppflags = ($KRB5_INCDIR eq '/usr/include') ? '' : "-I${KRB5_INCDIR}";
-+
+ ##### DO NOT CHANGE ANYTHING BELOW HERE #####
+ 
+-# check for libk5crypto -- only in krb5-1.1 and above
+-print "Checking for libk5crypto...";
+-my $cryptolib;
+-if ( -r "${KRB5_LIBDIR}/libk5crypto.a" || -r "${KRB5_LIBDIR}/libk5crypto.so" ) {
+-	print "yes\n";
+-	$cryptolib = '-lk5crypto';
+-}
+-else {
+-	print "no.  I'll use libcrypto instead.\n";
+-	$cryptolib = '-lcrypto';
+-}
+-
  WriteMakefile(
      'NAME'	=> 'Authen::Krb5',
      'VERSION_FROM' => 'Krb5.pm',
 -    'LIBS'	=> ["-L${KRB5_LIBDIR} -lkrb5 ${cryptolib} -lcom_err $KRB5_EXTRALIBS"],
-+    'LIBS'     => ["$ldflags -lkrb5 ${cryptolib} -lcom_err $KRB5_EXTRALIBS"],
++    'LIBS'     => [`krb5-config --libs`],
      'DEFINE'	=> '',
 -    'INC'	=> "-I${KRB5_INCDIR} $KRB5_EXTRAINCS"
-+    'INC'      => "$cppflags $KRB5_EXTRAINCS"
++    'INC'      => `krb5-config --cflags`
  );

Reply via email to