Your message dated Thu, 29 Dec 2022 16:54:49 +0000
with message-id <e1pawb7-005ukz...@fasolo.debian.org>
and subject line Bug#916998: fixed in ulogd2 2.0.8-1
has caused the Debian Bug report #916998,
regarding ulogd2 FTCBFS: mysql/libpq detection broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
916998: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916998
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: ulogd2
Version: 2.0.7-1
Tags: patch upstream
User: helm...@debian.org
Usertags: rebootstrap

ulogd2 fails to cross build from source, because it fails to detect
client libraries for postgres and mysql. The relevant code prefers
pg_config and mysql_config, but explicity opts out of these for cross
compilation (even though using them would actually work). Opting out is
good for other distributions as these utilities typically produce
results for a different architecture.

The fallback code seems completely unmaintained and doesn't work at all.
For instance, PQINCPATH (see acinclude.m4) is sometimes initialized to a
directory by pg_config, but receives full flags in the later fallback
code resulting in -I-I/somedir due to output/pgsql/Makefile.am adding
another -I.

A good way to discover these libraries is pkg-config. Unfortunately, we
cannot use PKG_CHECK_MODULES in a shell if, because PKG_CHECK_MODULES
uses AC_REQUIRE. Therefore the shell if must be converted to AS_IF.

Then we can proceed using PKG_CHECK_MODULES, though note that
mysqlclient.pc is not presently discoverable (#878340), so we need to
consider mariadb.pc as well.

That sounds a lot of complexity, but once we switch over to pkg-config,
the cross stuff just works. I've implemented it to gracefully fall back
to the old way (mysql_config/pg_config).

Please consider applying the attached patch as it makes ulogd2 cross
buildable.

Helmut
--- ulogd2-2.0.7.orig/acinclude.m4
+++ ulogd2-2.0.7/acinclude.m4
@@ -30,7 +30,12 @@
 AC_SUBST(PQLIBS)
 PQLIBS=-lpq
 
-if test "$pg_prefix" != "no"; then
+AS_IF([test "$pg_prefix" != "no"],[
+
+PKG_CHECK_MODULES([LIBPQ],[libpq],[
+	PQINCPATH=$LIBPQ_CFLAGS
+	PQLIBPATH=$LIBPQ_LIBS
+],[
 
 AC_MSG_CHECKING([for PostgreSQL pg_config program])
 for d in $pg_prefix/bin /usr/bin /usr/local/bin /usr/local/pgsql/bin /opt/pgsql/bin /opt/packages/pgsql/bin
@@ -38,7 +43,7 @@
 	if test -x $d/pg_config -a "$cross_compiling" = "no";
 	then
 		AC_MSG_RESULT(found pg_config in $d)
-		PQINCPATH=`$d/pg_config --includedir`
+		PQINCPATH=-I`$d/pg_config --includedir`
 		PQLIBPATH=`$d/pg_config --libdir`
 		break
 	fi
@@ -89,9 +94,7 @@
   AC_CHECK_LIB(pq, PQconnectdb, [], AC_MSG_WARN(libpq.so not found))
 fi
 
-fi
-
-])
+])])])
 
 dnl @synopsis CT_CHECK_MYSQL_DB
 dnl
@@ -123,7 +126,15 @@
 AC_SUBST(MYSQL_INC)
 AC_SUBST(MYSQL_LIB)
 
-if test "$my_prefix" != "no"; then
+AS_IF([test "$my_prefix" != no],[
+PKG_CHECK_MODULES([MYSQLCLIENT],[mysqlclient],[
+  MYSQL_INC=$MYSQLCLIENT_CFLAGS
+  MYSQL_LIB=$MYSQLCLIENT_LIBS
+],[
+PKG_CHECK_MODULES([MYSQLCLIENT],[mariadb],[
+  MYSQL_INC=$MYSQLCLIENT_CFLAGS
+  MYSQL_LIB=$MYSQLCLIENT_LIBS
+],[
 
 AC_MSG_CHECKING([for MySQL mysql_config program])
 for d in $my_prefix/bin /usr/bin /usr/local/bin /usr/local/mysql/bin /opt/mysql/bin /opt/packages/mysql/bin
@@ -182,9 +193,7 @@
   AC_CHECK_LIB(mysqlclient, mysql_close, [], AC_MSG_WARN(libmysqlclient.so not found))
 fi
 
-fi
-
-])
+])])])])
 
 dnl @synopsis CT_CHECK_PCAP
 dnl
--- ulogd2-2.0.7.orig/output/pgsql/Makefile.am
+++ ulogd2-2.0.7/output/pgsql/Makefile.am
@@ -1,5 +1,5 @@
 
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(PQINCPATH)
+AM_CPPFLAGS = -I$(top_srcdir)/include $(PQINCPATH)
 AM_CFLAGS = ${regular_CFLAGS}
 
 if HAVE_PGSQL

--- End Message ---
--- Begin Message ---
Source: ulogd2
Source-Version: 2.0.8-1
Done: Chris Boot <bo...@debian.org>

We believe that the bug you reported is fixed in the latest version of
ulogd2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 916...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Chris Boot <bo...@debian.org> (supplier of updated ulogd2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 29 Dec 2022 16:11:14 +0000
Source: ulogd2
Architecture: source
Version: 2.0.8-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Netfilter Packaging Team 
<pkg-netfilter-t...@lists.alioth.debian.org>
Changed-By: Chris Boot <bo...@debian.org>
Closes: 731638 805940 916998
Changes:
 ulogd2 (2.0.8-1) unstable; urgency=medium
 .
   [ Debian Janitor ]
   * Remove constraints unnecessary since buster (oldstable):
     + Build-Depends: Drop versioned constraint on libnetfilter-conntrack-dev 
and
       libnfnetlink-dev.
     + Remove 1 maintscript entries from 1 files.
 .
   [ Jeremy Sowden ]
   * New upstream version
     - New IPFIX output plugin
     - Introduces pkg-config for libdbi, libmysqlclient, libpcap and libpq
       (Closes: #916998)
   * Add d/.gitignore file
   * d/compat, d/control:
     - remove d/compat
     - add a build-dep on `debhelper-compat = 13` to d/control
   * d/README.source:
     - bump dh version
   * d/control:
     - bump Standards-Version to 4.6.1
     - add myself to uploaders
     - add `Rules-requires-root: no`
   * d/copyright:
     - add myself to debian/*
   * d/not-installed, d/rules:
     - add libtool archives to d/not-installed
     - remove deprecated `dh_install` override from d/rules
   * d/patches:
     - add patch to fix libpq `CFLAGS` fall-back
   * d/rules:
     - remove no-op `dh_strip` override
     - replace several `override`s with `execute_after`s
     - remove obsolete flags from `dh_auto_configure`
   * d/ulogd2.dirs:
     - remove directories created by `make` (/usr/sbin) and `dh_install` (/etc)
     - remove /var/log/ulog since it leads to warnings from `adduser` and
       will be created by `postinst` anyway (Closes: #731638, #805940)
   * Add d/ulogd2.manpages and update d/*.install files
   * d/ulogd2.postinst:
     - remove obsolete code related to the ulogd init-script
     - only create user and group when configuring
     - create /var/log/ulog once with the right ownership and permissions
   * d/ulogd2.preinst:
     - remove obsolete code related to the ulogd init-script
   * d/ulogd2.tmpfile:
     - rename to ulogd2.tmpfiles
   * d/u/signing-key.asc:
     - update and minimize signing key
   * d/watch:
     - bump to v4 and use HTTPS URL
   * Update Lintian overrides
Checksums-Sha1:
 919fa41fceda39206af547fe156fff94683ac17b 3067 ulogd2_2.0.8-1.dsc
 ebc9fd80bdf8a03d7e77c4e6b794b1fb633a347a 435434 ulogd2_2.0.8.orig.tar.bz2
 88ae76c1ecdc7c9a4ffd0347bb413ed46815acaf 833 ulogd2_2.0.8.orig.tar.bz2.asc
 02053159584b5dc838cccd63c64f0e0aca4d03f5 15796 ulogd2_2.0.8-1.debian.tar.xz
Checksums-Sha256:
 374a9825eb7743b966e7f0359c8e150a6d5bf3c51577460461ccf579741e4f6d 3067 
ulogd2_2.0.8-1.dsc
 4ead6c3970c3f57fa1e89fe2d7cc483ba6fe2bd1b08701521e0b3afd667df291 435434 
ulogd2_2.0.8.orig.tar.bz2
 2c6130ffa2c773cbce39ec81d78e15d666242263dd2c0c4829088c21125b237f 833 
ulogd2_2.0.8.orig.tar.bz2.asc
 2db3e93ada0ebd566c09b31b2b1a28537fe75e65a7459b29f401980b510a6ba4 15796 
ulogd2_2.0.8-1.debian.tar.xz
Files:
 feedb9458d9fdf269bcbc95ad77f8fc6 3067 net optional ulogd2_2.0.8-1.dsc
 9f69597b37bfaf3ae63426529dd1fb5d 435434 net optional ulogd2_2.0.8.orig.tar.bz2
 f1496c86be12e24d1dd384188e13834b 833 net optional ulogd2_2.0.8.orig.tar.bz2.asc
 030178597a728dd855d79c7b9980f400 15796 net optional 
ulogd2_2.0.8-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEE2oqQ9X/7HWR+QDTaQRpzPmfWT/4FAmOtvQRfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldERB
OEE5MEY1N0ZGQjFENjQ3RTQwMzREQTQxMUE3MzNFNjdENjRGRkURHGJvb3RjQGRl
Ymlhbi5vcmcACgkQQRpzPmfWT/6DdxAAv69XObHFrXQaiUrASOZvoFIax2zZeMkQ
NoxevatIZydmTPkHjhbkW2iNtLXeoYluIq1aeLQVDnoeYJaIyg0qj+zIn+tPM+h+
vqyZ/k+59RCpYImUTE8uR0wz7mTAowSxrl0eI3YWON/eSzIvdfn/krnSuyTKj6P4
LIIEz7lHmuhWO01vYlxlhc8AcUiKlOic9qGzung7lUvvPPwXFP60AsRr21SuqPty
pZVXl1GrBQ/G8LqK6oLHNh0v1oWdDsjMExK5LmuPx6pgrZ8jYAaJUehaE/e6pPj3
8+6hpasbIg7VuCnpE6Ojg2V4uzbqGiKKsdM+dl3JWzprj0nL6WRrWv1dcCRjtvon
wE454p47YPrOaqbdE9K3TkpQYhGGA1dcg1NeUZMdE4vaHaDLX19WqFrjul/ZBANf
ApC1DvnYUQGefmLHmuh9qgrKlvb/EOU5T15lyNG3hqN8+m3XnDRGiROcD/OygjeM
vdbGp+g7rHUN796l0m1Smbgzdt2MF3jjq8QfGdbUMICS3t92/t/BAgHSFqNfRf/V
IsqduOvfDa/r4LqwrhfwVpbv0GQELoNOpQuR5P/19qpdt/tRArXp4qLJQZKY2LJB
H11PM8z6I+X9yMUWGekc6egu8+4Ya0fAjZOzf4YUjZx8mKwt2nn/0dUfbQBayxqT
DnUCz+ZXwi4=
=Kifh
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to