Use mysql_config to find proper libs for multi-arch mysql (closes: #649938)
authorEmmanuel Lacour <elacour@home-dn.net>
Wed, 18 Apr 2012 09:26:52 +0000 (11:26 +0200)
committerEmmanuel Lacour <elacour@home-dn.net>
Wed, 18 Apr 2012 09:26:52 +0000 (11:26 +0200)
debian/control
debian/patches/05_fix_acinclude [new file with mode: 0644]
debian/patches/series
debian/rules

index 6fd5792..5458f69 100644 (file)
@@ -2,7 +2,7 @@ Source: libnss-mysql-bg
 Section: admin
 Priority: optional
 Maintainer: Emmanuel Lacour <elacour@home-dn.net>
-Build-Depends: debhelper (>= 7.0.50~), libmysqlclient15-dev, quilt (>= 0.40), autotools-dev
+Build-Depends: debhelper (>= 7.0.50~), libmysqlclient15-dev, quilt (>= 0.40), autotools-dev, dh-autoreconf
 Standards-Version: 3.9.3
 
 Package: libnss-mysql-bg
diff --git a/debian/patches/05_fix_acinclude b/debian/patches/05_fix_acinclude
new file mode 100644 (file)
index 0000000..357314b
--- /dev/null
@@ -0,0 +1,32 @@
+Index: libnss-mysql-bg-1.5/acinclude.m4
+===================================================================
+--- libnss-mysql-bg-1.5.orig/acinclude.m4      2012-04-18 10:20:01.205313859 +0200
++++ libnss-mysql-bg-1.5/acinclude.m4   2012-04-18 11:18:19.681344131 +0200
+@@ -50,6 +50,7 @@
+ fi
+ AC_MSG_CHECKING([for MySQL libraries])
++
+ dnl Check for share first, then static, such that static
+ dnl will take precedence
+ for f in $baselist; do
+@@ -80,6 +81,19 @@
+     fi
+ done
++dnl Get dir from mysql_config (for multi-arch libs)
++MYSQL_CONFIG=`which mysql_config`
++if test -n "$MYSQL_CONFIG" -a -x "$MYSQL_CONFIG"
++then
++    MYSQL_LIB_DIR=`$MYSQL_CONFIG --variable=pkglibdir`
++dnl Old versions of mysql_config does not have "--variable" option
++    if test $? -ne 0
++    then
++        MYSQL_LIB_DIR=`mysql_config --libs | sed 's/^.*-L\([^ ]\+\).*$/\1/'`
++    fi
++fi
++
++
+ if test -n "$MYSQL_LIB_DIR"
+ then
+     AC_MSG_RESULT([$MYSQL_LIB_DIR])
index 41e5de9..923f9e5 100644 (file)
@@ -1,3 +1,4 @@
 01_mkinstalldirs.diff
 03_config.diff
 04_shadow.diff
+05_fix_acinclude
index 2e20033..16c84bf 100755 (executable)
@@ -10,7 +10,7 @@
 #export DH_VERBOSE=1
 
 %:
-       dh $@  --with quilt,autotools-dev
+       dh $@  --with quilt,autotools-dev,autoreconf
 
 override_dh_install:
        dh_install