Source: mosquitto-auth-plugin
Version: 0.1.2-1
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

mosquitto-auth-plugin fails to cross build from source, because it does
not pass cross tools to make. The easiest way of fixing that is using
dh_auto_build. Unfortunately, that's not sufficient as mysql_config is
being used. mysql_config is unfixably broken during cross compilation
and one should use pkg-config instead. After doing so, one runs into
#915346. Please consider applying the attached patch.

Helmut
diff --minimal -Nru mosquitto-auth-plugin-0.1.2/debian/changelog 
mosquitto-auth-plugin-0.1.2/debian/changelog
--- mosquitto-auth-plugin-0.1.2/debian/changelog        2017-08-20 
08:00:47.000000000 +0200
+++ mosquitto-auth-plugin-0.1.2/debian/changelog        2019-06-12 
17:10:39.000000000 +0200
@@ -1,3 +1,12 @@
+mosquitto-auth-plugin (0.1.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make.
+    + Detect mysql using pkg-config.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Wed, 12 Jun 2019 17:10:39 +0200
+
 mosquitto-auth-plugin (0.1.2-1) unstable; urgency=medium
 
   * New upstream version
diff --minimal -Nru mosquitto-auth-plugin-0.1.2/debian/control 
mosquitto-auth-plugin-0.1.2/debian/control
--- mosquitto-auth-plugin-0.1.2/debian/control  2017-08-20 07:46:16.000000000 
+0200
+++ mosquitto-auth-plugin-0.1.2/debian/control  2019-06-12 17:10:39.000000000 
+0200
@@ -4,7 +4,7 @@
 Maintainer: Adam Majer <ad...@zombino.com>
 Build-Depends: debhelper (>= 9), libssl-dev, libmosquitto-dev, mosquitto-dev,
                libhiredis-dev, default-libmysqlclient-dev, libpq-dev, 
libsqlite3-dev,
-               libldap2-dev, libcdb-dev, libcurl4-gnutls-dev
+               libldap2-dev, libcdb-dev, libcurl4-gnutls-dev, pkg-config
 Standards-Version: 4.0.0
 Homepage: https://github.com/jpmens/mosquitto-auth-plug
 Vcs-Git: git://anonscm.debian.org/collab-maint/mosquitto-auth-plugin.git
diff --minimal -Nru mosquitto-auth-plugin-0.1.2/debian/patches/cross.patch 
mosquitto-auth-plugin-0.1.2/debian/patches/cross.patch
--- mosquitto-auth-plugin-0.1.2/debian/patches/cross.patch      1970-01-01 
01:00:00.000000000 +0100
+++ mosquitto-auth-plugin-0.1.2/debian/patches/cross.patch      2019-06-12 
17:10:39.000000000 +0200
@@ -0,0 +1,21 @@
+--- mosquitto-auth-plugin-0.1.2.orig/Makefile
++++ mosquitto-auth-plugin-0.1.2/Makefile
+@@ -10,6 +10,7 @@
+ 
+ BACKENDS =
+ BACKENDSTR =
++PKG_CONFIG ?= pkg-config
+ 
+ ifneq ($(BACKEND_CDB),no)
+       BACKENDS += -DBE_CDB
+@@ -25,8 +26,8 @@
+       BACKENDS += -DBE_MYSQL
+       BACKENDSTR += MySQL
+ 
+-      BE_CFLAGS += `mysql_config --cflags`
+-      BE_LDADD += `mysql_config --libs`
++      BE_CFLAGS += `$(PKG_CONFIG) mysqlclient --cflags || mysql_config 
--cflags`
++      BE_LDADD += `$(PKG_CONFIG) mysqlclient --libs || mysql_config --libs`
+       OBJS += be-mysql.o
+ endif
+ 
diff --minimal -Nru mosquitto-auth-plugin-0.1.2/debian/patches/series 
mosquitto-auth-plugin-0.1.2/debian/patches/series
--- mosquitto-auth-plugin-0.1.2/debian/patches/series   2017-08-20 
07:36:42.000000000 +0200
+++ mosquitto-auth-plugin-0.1.2/debian/patches/series   2019-06-12 
17:10:39.000000000 +0200
@@ -1,3 +1,4 @@
 fix_makefile
 default_config
 disable_cdb_build
+cross.patch
diff --minimal -Nru mosquitto-auth-plugin-0.1.2/debian/rules 
mosquitto-auth-plugin-0.1.2/debian/rules
--- mosquitto-auth-plugin-0.1.2/debian/rules    2017-08-20 07:39:48.000000000 
+0200
+++ mosquitto-auth-plugin-0.1.2/debian/rules    2019-06-12 17:10:38.000000000 
+0200
@@ -21,7 +21,7 @@
        dh $@ 
 
 override_dh_auto_build:
-       VPATH=.. $(MAKE) -C build
+       VPATH=.. dh_auto_build --builddirectory=build
 
 override_dh_auto_install:
        dh_auto_install

Reply via email to