[pkg-bacula-commits] [SCM] Bacula, a network backup, recovery and verification program branch, master, updated. debian/5.0.3-1-17-gee975da

Luca Capello luca at pca.it
Thu May 17 18:31:15 UTC 2012


The following commit has been merged in the master branch:
commit ee975daf3993294c6957519f103942c961247d9f
Author: Luca Capello <luca at pca.it>
Date:   Thu May 17 19:46:18 2012 +0200

    debian/patches/fix-mysql-autoconf.patch: (#672765) for multi-arch

diff --git a/debian/changelog b/debian/changelog
index 1119ec4..a86fcbc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,14 @@ bacula (5.0.3-2) UNRELEASED; urgency=low
   * debian/patches/fix-binutils-gold-linking.patch (Closes: #553956)
     + fix linking with binutils-gold
 
+  [ Ben Hutchings ]
+  * debian/control:
+    + add autoconf to Build-Depends:.
+  * debian/patches/fix-build-with-multiarch-libmysql.patch:
+    + fix FTBFS with multi-arch libmysqlclient-dev (Closes: #672765).
+  * debian/rules:
+    + recreate configure script on build.
+
   [ Jan Hauke Rahm ]
   * debian/*:
     + rework patching to use 3.0 (quilt).
diff --git a/debian/control b/debian/control
index 1ed36d5..7792cd8 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: admin
 Priority: optional
 Maintainer: Debian Bacula packaging Group <pkg-bacula-devel at lists.alioth.debian.org>
 Uploaders: Jan Hauke Rahm <jhr at debian.org>
-Build-Depends: autotools-dev, debhelper (>= 6.0.7~), po-debconf (>= 0.8.2), 
+Build-Depends: autotools-dev, autoconf, debhelper (>= 6.0.7~), po-debconf (>= 0.8.2),
  zlib1g-dev, libreadline-dev, libjconv-dev,
  libsqlite3-dev, libmysqlclient-dev, libpq-dev (>= 9.1),
  postgresql-server-dev-all,
diff --git a/debian/patches/fix-mysql-autoconf.patch b/debian/patches/fix-mysql-autoconf.patch
new file mode 100644
index 0000000..ef2fc54
--- /dev/null
+++ b/debian/patches/fix-mysql-autoconf.patch
@@ -0,0 +1,100 @@
+Description: Try using mysql_config to get MySQL compiler and linker flags
+ The current hardcoded search path for MySQL headers and binaries
+ does not work for multi-arch installations.
+Bug-Debian: 672765
+Author: Ben Hutchings <ben at decadent.org.uk>
+Reviewed-by: Alexander Golovko <alexandro at ankalagon.ru>
+Reviewed-by: Luca Capello <luca at pca.it>
+Last-Update: 2012-05-17
+
+--- a/autoconf/bacula-macros/db.m4
++++ b/autoconf/bacula-macros/db.m4
+@@ -327,8 +327,16 @@
+ AC_HELP_STRING([--with-mysql@<:@=DIR@:>@], [Include MySQL support. DIR is the MySQL base install directory, default is to search through a number of common places for the MySQL files.]),
+ [
+   if test "$withval" != "no"; then
++        SQL_INCLUDE=
++        SQL_LFLAGS=
+         if test "$withval" = "yes"; then
+-           if test -f /usr/local/mysql/include/mysql/mysql.h; then
++           MYSQL_CONFIG="$(which mysql_config 2>/dev/null)"
++           if test -n "$MYSQL_CONFIG"; then
++              SQL_INCLUDE="$(mysql_config --cflags)"
++              SQL_LFLAGS="$(mysql_config --libs_r || mysql_config --libs)"
++              MYSQL_BINDIR="$(basename "$MYSQL_CONFIG")"
++           else
++              if test -f /usr/local/mysql/include/mysql/mysql.h; then
+                    MYSQL_INCDIR=/usr/local/mysql/include/mysql
+                    if test -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.a \
+                         -o -f /usr/local/mysql/lib64/mysql/libmysqlclient_r.so; then
+@@ -337,7 +345,7 @@
+                            MYSQL_LIBDIR=/usr/local/mysql/lib/mysql
+                    fi
+                    MYSQL_BINDIR=/usr/local/mysql/bin
+-           elif test -f /usr/include/mysql/mysql.h; then
++              elif test -f /usr/include/mysql/mysql.h; then
+                    MYSQL_INCDIR=/usr/include/mysql
+                    if test -f /usr/lib64/mysql/libmysqlclient_r.a \
+                         -o -f /usr/lib64/mysql/libmysqlclient_r.so; then  
+@@ -352,7 +360,7 @@
+                            MYSQL_LIBDIR=/usr/lib
+                    fi
+                    MYSQL_BINDIR=/usr/bin
+-           elif test -f /usr/include/mysql.h; then
++              elif test -f /usr/include/mysql.h; then
+                    MYSQL_INCDIR=/usr/include
+                    if test -f /usr/lib64/libmysqlclient_r.a \
+                         -o -f /usr/lib64/libmysqlclient_r.so; then
+@@ -361,7 +369,7 @@
+                            MYSQL_LIBDIR=/usr/lib
+                    fi
+                    MYSQL_BINDIR=/usr/bin
+-           elif test -f /usr/local/include/mysql/mysql.h; then
++              elif test -f /usr/local/include/mysql/mysql.h; then
+                    MYSQL_INCDIR=/usr/local/include/mysql
+                    if test -f /usr/local/lib64/mysql/libmysqlclient_r.a \
+                         -o -f /usr/local/lib64/mysql/libmysqlclient_r.so; then
+@@ -370,7 +378,7 @@
+                            MYSQL_LIBDIR=/usr/local/lib/mysql
+                    fi
+                    MYSQL_BINDIR=/usr/local/bin
+-           elif test -f /usr/local/include/mysql.h; then
++              elif test -f /usr/local/include/mysql.h; then
+                    MYSQL_INCDIR=/usr/local/include
+                    if test -f /usr/local/lib64/libmysqlclient_r.a \
+                         -o -f /usr/local/lib64/libmysqlclient_r.so; then
+@@ -379,9 +387,10 @@
+                            MYSQL_LIBDIR=/usr/local/lib
+                    fi
+                    MYSQL_BINDIR=/usr/local/bin
+-           else
+-              AC_MSG_RESULT(no)
+-              AC_MSG_ERROR(Unable to find mysql.h in standard locations)
++              else
++                   AC_MSG_RESULT(no)
++                   AC_MSG_ERROR(Unable to find mysql.h in standard locations)
++              fi
+            fi
+         else
+            if test -f $withval/include/mysql/mysql.h; then
+@@ -413,11 +422,15 @@
+               AC_MSG_ERROR(Invalid MySQL directory $withval - unable to find mysql.h under $withval)
+            fi
+         fi
+-    SQL_INCLUDE=-I$MYSQL_INCDIR
+-    if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
+-         -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
+-       SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
+-       AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
++    if test -z "$SQL_INCLUDE"; then
++       SQL_INCLUDE=-I$MYSQL_INCDIR
++    fi
++    if test -z "$SQL_LFLAGS"; then
++       if test -f $MYSQL_LIBDIR/libmysqlclient_r.a \
++            -o -f $MYSQL_LIBDIR/libmysqlclient_r.so; then
++          SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
++          AC_DEFINE(HAVE_THREAD_SAFE_MYSQL)
++       fi
+     fi
+     SQL_BINDIR=$MYSQL_BINDIR
+     SQL_LIB=$MYSQL_LIBDIR/libmysqlclient_r.a
diff --git a/debian/patches/series b/debian/patches/series
index cb1ef54..8bef1f4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix-default-config
 fix-sql-bindir
 switch-nonfree-sha1-to-openssl.patch
 fix-binutils-gold-linking.patch
+fix-mysql-autoconf.patch
diff --git a/debian/rules b/debian/rules
index 69eb1c9..c6a4020 100755
--- a/debian/rules
+++ b/debian/rules
@@ -91,6 +91,8 @@ configure-stamp-%: extract-stamp-%
 	@echo " *** DEBIAN *** CONFIGURING VARIANT $*"
 	cp /usr/share/misc/config.guess /usr/share/misc/config.sub \
 		$(BUILDDIR)-$(*)/autoconf/
+	cd $(BUILDDIR)-$(*)/autoconf && \
+		autoconf configure.in > ../configure
 	cd $(BUILDDIR)-$(*) && \
 		QMAKE=/usr/bin/qmake-qt4 ./configure --config-cache \
 		--host=${DEB_HOST_GNU_TYPE} --build=${DEB_BUILD_GNU_TYPE} \

-- 
Bacula, a network backup, recovery and verification program



More information about the pkg-bacula-commits mailing list