Source: cfengine3
Version: 3.10.2-2
Severity: minor
Tags: patch

cfengine3 fails to cross build from source for a number of reasons. The
first reason is that it does not pass --host to ./configure and thus
configures for the build architecture. Using dh_auto_configure fixes
that. Then it fails finding libxml2 headers in -Iyes/include/libxml2,
because ./configure insists that xml2-config is unusable for cross
building, but not using it breaks the build. Fixing ./configure to
behave like native builds fixes that. Finally it fails generating the
manual pages. I don't have a generic solution for this issue.
DEB_BUILD_OPTIONS=nodoc could be used to work around it, but I don't
like that. So I am attaching a patch for the first two issues and hope
that you can apply it even though it doesn't fully make cfengine3 cross
build. Please close this bug when doing so.

Helmut
diff --minimal -Nru cfengine3-3.10.2/debian/changelog 
cfengine3-3.10.2/debian/changelog
--- cfengine3-3.10.2/debian/changelog   2017-11-21 23:05:33.000000000 +0100
+++ cfengine3-3.10.2/debian/changelog   2017-12-04 14:28:03.000000000 +0100
@@ -1,3 +1,12 @@
+cfengine3 (3.10.2-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Address FTCBFS: (Closes: #-1)
+    + Let dh_auto_configure pass --host to ./configure.
+    + Use xml2-config rather than passing -Iyes/include/libxml2.
+
+ -- Helmut Grohne <[email protected]>  Mon, 04 Dec 2017 14:28:03 +0100
+
 cfengine3 (3.10.2-2) unstable; urgency=medium
 
   * debian/control: removed any dependency fron libssl-* which is not
diff --minimal -Nru cfengine3-3.10.2/debian/patches/0011-cross.patch 
cfengine3-3.10.2/debian/patches/0011-cross.patch
--- cfengine3-3.10.2/debian/patches/0011-cross.patch    1970-01-01 
01:00:00.000000000 +0100
+++ cfengine3-3.10.2/debian/patches/0011-cross.patch    2017-12-04 
14:28:03.000000000 +0100
@@ -0,0 +1,14 @@
+Index: cfengine3-3.10.2/configure.ac
+===================================================================
+--- cfengine3-3.10.2.orig/configure.ac
++++ cfengine3-3.10.2/configure.ac
+@@ -573,8 +573,7 @@
+         XML2_CONFIG=xml2-config
+     fi
+ 
+-    # xml2-config is only for native builds
+-    if test "x$cross_compiling" = "xno" && test x`which $XML2_CONFIG` != x
++    if test x`which $XML2_CONFIG` != x
+     then
+         xml2_include_dir=`$XML2_CONFIG --cflags`
+         if test -n "$xml2_include_dir"
diff --minimal -Nru cfengine3-3.10.2/debian/patches/series 
cfengine3-3.10.2/debian/patches/series
--- cfengine3-3.10.2/debian/patches/series      2017-11-21 23:05:33.000000000 
+0100
+++ cfengine3-3.10.2/debian/patches/series      2017-12-04 14:28:03.000000000 
+0100
@@ -5,3 +5,4 @@
 0006-skip_failing_tests.patch
 0007-fix_kfreebsd_build.patch
 0010_disable_date_annotation.patch
+0011-cross.patch
diff --minimal -Nru cfengine3-3.10.2/debian/rules cfengine3-3.10.2/debian/rules
--- cfengine3-3.10.2/debian/rules       2017-11-21 23:05:33.000000000 +0100
+++ cfengine3-3.10.2/debian/rules       2017-12-04 14:28:01.000000000 +0100
@@ -14,7 +14,7 @@
 # openssl1.1 transition, re-enable once it becomes ready.
 override_dh_auto_configure:
        dh_autoreconf
-       ./configure     --prefix=/usr \
+       dh_auto_configure -- \
                        --with-sql=yes \
                        --without-sql \
                        --with-libvirt \
@@ -26,10 +26,10 @@
                        --with-piddir=/var/run/cfengine3 \
                        --libdir=/usr/lib/cfengine3 \
                        --docdir=\$${prefix}/share/doc/cfengine3 \
-                       --datadir=\$${prefix}/share/cfengine3 \
-                       --mandir=\$${prefix}/share/man
-       cd masterfiles && ./configure --prefix=/usr/share/cfengine3 \
-                                                                       
--with-core=$(CURDIR)
+                       --datadir=\$${prefix}/share/cfengine3
+       dh_auto_configure --sourcedirectory=masterfiles -- \
+                       --prefix=/usr/share/cfengine3 \
+                       --with-core=$(CURDIR)
 
 
 override_dh_clean:

Reply via email to