On 2021/07/08 08:45, Martin Ziemer wrote:
> After some package update i found sysclean to mark
> /usr/lib/libz.so.5.0 as deletable because of no depends, which broke
> bogofilter in the flavor sqlite3.
> 
> To solve the problem for me i added WANTLIB z to *my* flavor. 
> I dont know, of it is needed in the other flavors too. So maybe the
> better solution would be adding z to the generic WANTLIB.

Testing other flavours of bogofilter it's just happening for sqlite.
But we need to look at the reason why rather than just blindly adding
because other ports could be affected too.

Looking at a few other ports with WANTLIB containing sqlite3 but not z,
it seems there's no general problem with these. So it does seem specific
to bogofilter. The libz dependency came along with the update to sqlite
3.25.1. But downstream software doesn't normally need to link to libz
directly, it comes via inter library dependency for shared libraries.

Let's run port-lib-depends-check:

$ FLAVOR=sqlite3 make port-lib-depends-check 

bogofilter-1.2.4p2-sqlite3(mail/bogofilter,sqlite3):
Missing: z.6 (/usr/local/bin/bogoutil) (system lib)
Extra:  iconv.7 sqlite3.37
WANTLIB += z

So that's interesting, sqlite3 is listed as extra. So bogofilter isn't
using libsqlite3.so.*, seems it's linking statically instead. This
reduces the chance of other software having a problem because most
things don't statically link to it.

Let's look at the other flavours.

bogofilter-1.2.4p2-qdbm(mail/bogofilter,qdbm):
Extra:  qdbm.14

bogofilter-1.2.4p2-db4(mail/bogofilter,db4):
Extra:  db.5 iconv.7

Same problem. Presumably this worked properly before, looking at other OS
bogofilter is dynamically linked to db libraries there. The part of the
configure script responsible for figuring out how to link to these comes
from an ancient copy of gettext-related m4 files in the distro. So let's
pick up new ones to replace them. While there we can pick up the 2019
update to 1.2.5 that includes various things including fixes for memory
leaks, lexer fixes for MIME multipart and HTML tokens, and some others.

I don't use bogofilter. This passes the self-tests, could you try some
runtime tests please?

? bogofilter/bogofilter-1.2.4p2-sqlite3.log
? bogofilter/default.log
Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/Makefile,v
retrieving revision 1.405
diff -u -p -r1.405 Makefile
--- Makefile    3 May 2021 16:22:12 -0000       1.405
+++ Makefile    8 Jul 2021 10:01:06 -0000
@@ -13,6 +13,7 @@
      SUBDIR += bmf,mysql
      SUBDIR += bogofilter
      SUBDIR += bogofilter,db4
+     SUBDIR += bogofilter,lmdb
      SUBDIR += bogofilter,qdbm
      SUBDIR += bogofilter,sqlite3
      SUBDIR += bulk_mailer
Index: bogofilter/Makefile
===================================================================
RCS file: /cvs/ports/mail/bogofilter/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- bogofilter/Makefile 12 Jul 2019 20:47:25 -0000      1.31
+++ bogofilter/Makefile 8 Jul 2021 10:01:06 -0000
@@ -2,13 +2,13 @@
 
 COMMENT =      bayesian spam filter
 
-DISTNAME =     bogofilter-1.2.4
+DISTNAME =     bogofilter-1.2.5
+EXTRACT_SUFX = .tar.xz
 CATEGORIES =   mail
-REVISION =     2
 
 MAINTAINER =   Marc Espie <[email protected]>
 
-HOMEPAGE =     http://bogofilter.sourceforge.net/
+HOMEPAGE =     https://bogofilter.sourceforge.io/
 MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=bogofilter/}
 
 # GPLv2/GPLv3
@@ -17,15 +17,20 @@ PERMIT_PACKAGE =    Yes
 WANTLIB =              c iconv m
 LIB_DEPENDS =          converters/libiconv
 
-FLAVORS =              db4 sqlite3 qdbm
+FLAVORS =              db4 sqlite3 qdbm lmdb
 FLAVOR ?=
 
 DB_ENGINE =            db
-CONFIGURE_STYLE =      gnu
+CONFIGURE_STYLE =      autoconf
+AUTOCONF_VERSION =     2.69
 CONFIGURE_ARGS =       --with-included-gsl \
                        --with-database=${DB_ENGINE}
-CONFIGURE_ENV =                CPPFLAGS="-I${LOCALBASE}/include/${DB_DIR}" \
-                       LDFLAGS="-L${LOCALBASE}/lib/${DB_DIR}"
+CPPFLAGS =             -I${LOCALBASE}/include/${DB_DIR} \
+                       -I${LOCALBASE}/include
+LDFLAGS =              -L${LOCALBASE}/lib/${DB_DIR} \
+                       -L${LOCALBASE}/lib
+CONFIGURE_ENV =                CPPFLAGS="${CPPFLAGS}" \
+                       LDFLAGS="${LDFLAGS}"
 
 .if ${FLAVOR} == "db4"
 BROKEN-aarch64 =       configure stuck on testing if BDB supports shared 
environments
@@ -34,14 +39,16 @@ LIB_DEPENDS +=              databases/db/v4
 WANTLIB +=             lib/db4/db>=4
 .elif ${FLAVOR} == "sqlite3"
 DB_ENGINE =            sqlite3
-WANTLIB +=             sqlite3 pthread
+WANTLIB +=             sqlite3
 LIB_DEPENDS +=         databases/sqlite3
 .elif ${FLAVOR} == "qdbm"
 DB_ENGINE =            qdbm
 LIB_DEPENDS +=         databases/qdbm
 WANTLIB +=             qdbm z
-CONFIGURE_ENV =                CPPFLAGS="-I${LOCALBASE}/include/" \
-                       LDFLAGS="-L${LOCALBASE}/lib/ -liconv -lz"
+.elif ${FLAVOR} == "lmdb"
+DB_ENGINE =            lmdb
+LIB_DEPENDS +=         databases/lmdb
+WANTLIB +=             lmdb
 .else
 BROKEN-hppa =          configure stuck on testing if BDB supports shared 
environments
 BROKEN-aarch64 =       configure stuck on testing if BDB supports shared 
environments
@@ -52,6 +59,11 @@ WANTLIB +=           lib/db/db=3
 
 SAMPLEDIR =            ${PREFIX}/share/examples/bogofilter
 DOCDIR =               ${PREFIX}/share/doc/bogofilter
+
+BUILD_DEPENDS =                devel/gettext,-tools
+post-extract:
+       cd ${LOCALBASE}/share/aclocal; \
+           cp iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 ${WRKSRC}/m4
 
 post-install:
        ${INSTALL_DATA_DIR} ${SAMPLEDIR}
Index: bogofilter/distinfo
===================================================================
RCS file: /cvs/ports/mail/bogofilter/distinfo,v
retrieving revision 1.8
diff -u -p -r1.8 distinfo
--- bogofilter/distinfo 20 Oct 2014 08:38:54 -0000      1.8
+++ bogofilter/distinfo 8 Jul 2021 10:01:06 -0000
@@ -1,2 +1,2 @@
-SHA256 (bogofilter-1.2.4.tar.gz) = 0vJZjRMAMHIJt7GQXMBjfS0FPApHAajUQ4OGcplXhHE=
-SIZE (bogofilter-1.2.4.tar.gz) = 1083344
+SHA256 (bogofilter-1.2.5.tar.xz) = MkihNzv/VSxQCDStvqS2yu4EIkUWrlgfslpMam3uieo=
+SIZE (bogofilter-1.2.5.tar.xz) = 801240
Index: bogofilter/patches/patch-configure
===================================================================
RCS file: bogofilter/patches/patch-configure
diff -N bogofilter/patches/patch-configure
--- bogofilter/patches/patch-configure  1 Aug 2020 17:17:43 -0000       1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-configure,v 1.4 2020/08/01 17:17:43 naddy Exp $
-
-LLVM 9+ no longer pretends to be gcc 4.2.1
-
-Index: configure
---- configure.orig
-+++ configure
-@@ -5880,7 +5880,7 @@ gcc4=no
- if test "$GCC" = yes && test "$ICC" = no ; then
-     case `$CC -dumpversion 2>/dev/null` in
-       ""|2.*|3.*) ;;
--      4.*) gcc4=yes ;;
-+      *) gcc4=yes ;;
-     esac
-     case "$CC" in
-       *clang) gcc4=yes ;;
Index: bogofilter/patches/patch-configure_ac
===================================================================
RCS file: bogofilter/patches/patch-configure_ac
diff -N bogofilter/patches/patch-configure_ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ bogofilter/patches/patch-configure_ac       8 Jul 2021 10:01:06 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -193,7 +193,7 @@ gcc4=no
+ if test "$GCC" = yes && test "$ICC" = no ; then
+     case `$CC -dumpversion 2>/dev/null` in
+       ""|2.*|3.*) ;;
+-      4.*) gcc4=yes ;;
++      *) gcc4=yes ;;
+     esac
+     case "$CC" in
+       *clang) gcc4=yes ;;
Index: bogofilter/pkg/DESCR
===================================================================
RCS file: /cvs/ports/mail/bogofilter/pkg/DESCR,v
retrieving revision 1.4
diff -u -p -r1.4 DESCR
--- bogofilter/pkg/DESCR        15 Apr 2010 13:27:48 -0000      1.4
+++ bogofilter/pkg/DESCR        8 Jul 2021 10:01:06 -0000
@@ -13,3 +13,4 @@ Flavors:
        * db4:          use v4 of the Berkeley database
        * sqlite3:      use SQLite 3 database backend
        * qdbm:         use QDBM database backend
+       * lmdb:         use LMDB database backend


Reply via email to