[Pkg-net-snmp-devel] Bug#944953: net-snmp FTCBFS: multiple reasons
Helmut Grohne
helmut at subdivi.de
Sun Nov 17 19:23:17 GMT 2019
Source: net-snmp
Version: 5.8+dfsg-2
Tags: patch
User: debian-cross at lists.debian.org
Usertags: cross-satisfiability ftcbfs
net-snmp fails to cross build from source. The immediate failure is when
satisfying Build-Depends. The perl dependency is interpreted as host
architecture and conflicts with the build architecture perl. Looking
closer, net-snmp depends on perl, because it wants to build a perl
extension module. We've introduced a new package perl-xs-dev for that
purpose. This package is temporarily virtual and will become real soon.
The next issue is with detecting mysql. It tries to use mysql_config,
but that doesn't work for cross compilation at all. Since a while mysql
and now mariadb do provide a pkg-config file and using that makes this
part work. The attached patch takes care of not regressing the build by
first trying pkg-config and then falling back to mysql_config.
The third failure is when building the perl extension. It tries to build
the perl extension for the build architecture and consequently fails on
missing dependencies. Niko Tyni has updated debhelper to correctly
invoke a Makefile.PL, but I didn't figure out how to integrate that into
the net-snmp build. The attached patch doesn't address this and net-snmp
keeps failing to cross build.
Please consider applying the attached patch as an incremental step and
close this bug when doing so.
Helmut
-------------- next part --------------
diff --minimal -Nru net-snmp-5.8+dfsg/debian/changelog net-snmp-5.8+dfsg/debian/changelog
--- net-snmp-5.8+dfsg/debian/changelog 2019-10-22 23:56:17.000000000 +0200
+++ net-snmp-5.8+dfsg/debian/changelog 2019-11-17 17:02:50.000000000 +0100
@@ -1,3 +1,12 @@
+net-snmp (5.8+dfsg-2.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Improve cross building: (Closes: #-1)
+ + Build-Depends: perl-xs-dev for building a perl extension.
+ + cross.patch: Detect mysql using pkg-config.
+
+ -- Helmut Grohne <helmut at subdivi.de> Sun, 17 Nov 2019 17:02:50 +0100
+
net-snmp (5.8+dfsg-2) unstable; urgency=medium
* All MIB directory values removed and just use the default compile-time
diff --minimal -Nru net-snmp-5.8+dfsg/debian/control net-snmp-5.8+dfsg/debian/control
--- net-snmp-5.8+dfsg/debian/control 2019-10-22 23:56:17.000000000 +0200
+++ net-snmp-5.8+dfsg/debian/control 2019-11-17 17:02:50.000000000 +0100
@@ -6,10 +6,10 @@
Thomas Anders <tanders at users.sourceforge.net>,
Noah Meyerhans <noahm at debian.org>
Build-Depends: debhelper-compat (= 12),
- libtool, libwrap0-dev, libssl-dev, perl (>=5.8), libperl-dev,
+ libtool, libwrap0-dev, libssl-dev, perl:any (>=5.8), perl-xs-dev,
autoconf, automake, debianutils (>=1.13.1),
bash (>=2.05), findutils (>=4.1.20), procps,
- pkg-config [kfreebsd-i386 kfreebsd-amd64],
+ pkg-config,
libbsd-dev [kfreebsd-i386 kfreebsd-amd64],
libkvm-dev [kfreebsd-i386 kfreebsd-amd64],
libsensors-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
diff --minimal -Nru net-snmp-5.8+dfsg/debian/patches/cross.patch net-snmp-5.8+dfsg/debian/patches/cross.patch
--- net-snmp-5.8+dfsg/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100
+++ net-snmp-5.8+dfsg/debian/patches/cross.patch 2019-11-17 17:02:50.000000000 +0100
@@ -0,0 +1,36 @@
+--- net-snmp-5.8+dfsg.orig/configure.d/config_os_libs2
++++ net-snmp-5.8+dfsg/configure.d/config_os_libs2
+@@ -520,12 +520,16 @@
+ ##
+ # mysql
+ ##
+-if test "x$with_mysql" = "xyes" ; then
+- AC_PATH_PROGS(MYSQLCONFIG,mysql_config)
+- test -x "$MYSQLCONFIG" \
++AS_IF([test "x$with_mysql" = "xyes"],[
++ PKG_CHECK_MODULES([MYSQL],[mysqlclient],[
++ MYSQL_INCLUDES="$MYSQL_CFLAGS"
++ ],[
++ AC_PATH_PROGS(MYSQLCONFIG,mysql_config)
++ test -x "$MYSQLCONFIG" \
+ || AC_MSG_ERROR([Could not find mysql_config and was specifically asked to use MySQL support])
+- MYSQL_LIBS=`$MYSQLCONFIG --libs`
+- MYSQL_INCLUDES=`$MYSQLCONFIG --include`
++ MYSQL_LIBS=`$MYSQLCONFIG --libs`
++ MYSQL_INCLUDES=`$MYSQLCONFIG --include`
++ ])
+ _libs="${LIBS}"
+ _cppflags="${CPPFLAGS}"
+ LIBS="${LIBS} ${MYSQL_LIBS}"
+@@ -574,9 +578,9 @@
+ CPPFLAGS="${_cppflags}"
+ LIBS="${_libs}"
+ AC_MSG_CACHE_ADD(MYSQL Trap Logging: enabled)
+-else
++],[
+ AC_MSG_CACHE_ADD(MYSQL Trap Logging: unavailable)
+-fi
++])
+ AC_SUBST(MYSQL_LIBS)
+ AC_SUBST(MYSQL_INCLUDES)
+
diff --minimal -Nru net-snmp-5.8+dfsg/debian/patches/series net-snmp-5.8+dfsg/debian/patches/series
--- net-snmp-5.8+dfsg/debian/patches/series 2019-10-22 23:56:17.000000000 +0200
+++ net-snmp-5.8+dfsg/debian/patches/series 2019-11-17 17:02:50.000000000 +0100
@@ -31,3 +31,4 @@
netsnmp_mib_api_3_groff
snmplib_error_subcontainer
apps_makefile_use_ldflags
+cross.patch
More information about the Pkg-net-snmp-devel
mailing list