Skip to content

Commit

Permalink
mail/bogofilter*: change default database
Browse files Browse the repository at this point in the history
* The default version of mail/bogofilter now uses LMDB instead
  of Berkeley DB. It is not compatible and cannot read databases.

* bogofilter was renamed to bogofilter-bdb
* bogofilter-lmdb was renamed to bogofilter

* MOVED/UPDATING entries included.
  • Loading branch information
mandree committed Jan 27, 2022
1 parent ef939d3 commit c443b66
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 112 deletions.
2 changes: 2 additions & 0 deletions MOVED
Expand Up @@ -16843,3 +16843,5 @@ net/php73-sockets|net/php74-sockets|2022-01-26|Has expired: Security support end
net/php73-xmlrpc|net/php74-xmlrpc|2022-01-26|Has expired: Security support ended on 2021-12-06
net/php73-ldap|net/php74-ldap|2022-01-26|Has expired: Security support ended on 2021-12-06
net/php73-soap|net/php74-soap|2022-01-26|Has expired: Security support ended on 2021-12-06
mail/bogofilter|mail/bogofilter-bdb|2022-01-26|Port renamed to make LMDB the new default DB
mail/bogofilter-lmdb|mail/bogofilter|2022-01-26|Port renamed to make LMDB the new default DB
15 changes: 15 additions & 0 deletions UPDATING
Expand Up @@ -5,6 +5,21 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.

20220126:
AFFECTS: users of mail/bogofilter, mail/bogofilter-lmdb
AUTHOR: mandree@FreeBSD.org

The default version of mail/bogofilter now uses LMDB instead
of Berkeley DB. It is not compatible and cannot read databases.

Your options are:
1. use bogoutil on each wordlist for each of your users first,
ONLY THEN reinstall bogofilter, THEN reload the databases with bogoutil,
OR
2. install the matching bogofilter version and
If you had been using bogofilter-lmdb so far, install bogofilter.
If you had been using bogofilter so far, install bogofilter-bdb.

20220125:
AFFECTS: users of lang/php74
AUTHOR: tz@FreeBSD.org
Expand Down
2 changes: 1 addition & 1 deletion mail/Makefile
Expand Up @@ -30,8 +30,8 @@
SUBDIR += bincimap
SUBDIR += bmf
SUBDIR += bogofilter
SUBDIR += bogofilter-bdb
SUBDIR += bogofilter-kc
SUBDIR += bogofilter-lmdb
SUBDIR += bogofilter-sqlite
SUBDIR += bsfilter
SUBDIR += bsmtp
Expand Down
98 changes: 98 additions & 0 deletions mail/bogofilter-bdb/Makefile
@@ -0,0 +1,98 @@
# Created by: Matthias Andree <matthias.andree@gmx.de>

PORTNAME= bogofilter
DISTVERSION= 1.2.5
PORTREVISION?= 3
CATEGORIES?= mail
MASTER_SITES= SF/bogofilter/bogofilter-stable/
PKGNAMESUFFIX?= -bdb

MAINTAINER?= mandree@FreeBSD.org
COMMENT= Fast, teachable, learning spam detector

LICENSE= GPLv2

.if !defined(MASTERDIR) || ${MASTERDIR} == ${.CURDIR}
# building master port
USES+= bdb:5+
.endif

OPTIONS_DEFINE= GSL UNICODE DOCS
OPTIONS_DEFAULT= GSL UNICODE
GSL_DESC= Link with system-wide GSL dynamically (recommended)
UNICODE_DESC= Normalize tokens to Unicode (UTF-8) (recommended)

CONFLICTS_INSTALL?= bogofilter-sqlite bogofilter bogofilter-kc

USES+= cpe perl5 shebangfix tar:xz
SHEBANG_FILES= contrib/randomtrain.sh contrib/scramble.sh \
src/tests/unsort.pl contrib/*.pl
USE_PERL5= run
GNU_CONFIGURE= yes

CPE_VENDOR= bogofilter_project

UNICODE_USES= iconv
UNICODE_CONFIGURE_ENABLE= unicode
GSL_LIB_DEPENDS= libgsl.so:math/gsl
GSL_CONFIGURE_OFF= --with-included-gsl

PORTDOCS= *

TEST_TARGET= check

.include <bsd.port.pre.mk>

BF_LIBS?= -l${BDB_LIB_NAME}
BF_CPPFLAGS?= -I${BDB_INCLUDE_DIR} -I${LOCALBASE}/include
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc
.if ${PORT_OPTIONS:MUNICODE}
BF_LIBS+= ${ICONV_LIB}
.endif
CPPFLAGS+= ${BF_CPPFLAGS}
LIBS+= -L${LOCALBASE}/lib ${BF_LIBS}
CONFIGURE_ENV+= PERL="${PERL}"
INSTALL_TARGET= install-strip prefix=${PREFIX} mandir=${MANPREFIX}/man

post-patch:
${REINPLACE_CMD} -e 's/INTEGRITY_TESTS = t.lock1 t.lock3 t.valgrind/INTEGRITY_TESTS = t.lock1/' \
-e 's/ENVIRON_TESTS = t.abort/ENVIRON_TESTS =/' \
${WRKSRC}/src/tests/Makefile.in

post-build:
cd ${WRKSRC}/src && ${SETENV} SHELL=${SH} ${MAKE_CMD} ${TEST_TARGET} ${_MAKE_JOBS} SHELL=${SH} \
|| { r=$$? ; head -n30000 ${WRKSRC}/src/tests/test-suite.log ; exit $$r ; }

post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}/contrib
.for i in html programmer xml
@${MKDIR} ${STAGEDIR}${DOCSDIR}/${i}
.endfor
.for i in AUTHORS COPYING INSTALL NEWS README README.git \
doc/README.validation TODO GETTING.STARTED \
RELEASE.NOTES doc/README.db doc/README.sqlite \
doc/integrating-with-postfix doc/integrating-with-qmail \
doc/bogofilter-tuning.HOWTO.html doc/bogofilter-SA-* \
doc/bogofilter-faq.html doc/bogofilter-faq-fr.html
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.for i in README.randomtrain README.contrib
${INSTALL_DATA} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor
${INSTALL_DATA} ${WRKSRC}/trio/AUTHORS ${STAGEDIR}${DOCSDIR}/AUTHORS.trio
${INSTALL_DATA} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}/html
${INSTALL_DATA} ${WRKSRC}/doc/*.xml ${STAGEDIR}${DOCSDIR}/xml
${INSTALL_DATA} ${WRKSRC}/doc/programmer/README.freebsd ${STAGEDIR}${DOCSDIR}/programmer
${INSTALL_PROGRAM} ${WRKSRC}/bogogrep ${STAGEDIR}${PREFIX}/bin/
.for i in bfproxy.pl bogofilter-milter.pl bogo.R bogofilter-qfe.sh \
mime.get.rfc822.pl parmtest.sh printmaildir.pl \
bogominitrain.pl \
randomtrain.sh scramble.sh spamitarium.pl stripsearch.pl trainbogo.sh
${INSTALL_SCRIPT} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor
.for i in dot-qmail-bogofilter-default \
mailfilter.example procmailrc.example vm-bogofilter.el
${INSTALL_DATA} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor

.include <bsd.port.post.mk>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mail/bogofilter-kc/Makefile
Expand Up @@ -14,6 +14,6 @@ BF_CPPFLAGS= -I${LOCALBASE}/include
BF_LIBS=
DESCR= ${PKGDIR}/pkg-descr

MASTERDIR= ${.CURDIR}/../bogofilter
MASTERDIR= ${.CURDIR}/../bogofilter-bdb

.include "${MASTERDIR}/Makefile"
19 changes: 0 additions & 19 deletions mail/bogofilter-lmdb/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion mail/bogofilter-sqlite/Makefile
Expand Up @@ -15,6 +15,6 @@ BF_CPPFLAGS= -I${LOCALBASE}/include
BF_LIBS=
DESCR= ${PKGDIR}/pkg-descr

MASTERDIR= ${.CURDIR}/../bogofilter
MASTERDIR= ${.CURDIR}/../bogofilter-bdb

.include "${MASTERDIR}/Makefile"
102 changes: 12 additions & 90 deletions mail/bogofilter/Makefile
@@ -1,97 +1,19 @@
# Created by: Matthias Andree <matthias.andree@gmx.de>

PORTNAME= bogofilter
DISTVERSION= 1.2.5
PORTREVISION?= 3
CATEGORIES?= mail
MASTER_SITES= SF/bogofilter/bogofilter-stable/

MAINTAINER?= mandree@FreeBSD.org
COMMENT= Fast, teachable, learning spam detector

LICENSE= GPLv2

.if !defined(MASTERDIR) || ${MASTERDIR} == ${.CURDIR}
# building master port
USES+= bdb:5+
.endif

OPTIONS_DEFINE= GSL UNICODE DOCS
OPTIONS_DEFAULT= GSL UNICODE
GSL_DESC= Link with system-wide GSL dynamically (recommended)
UNICODE_DESC= Normalize tokens to Unicode (UTF-8) (recommended)

CONFLICTS_INSTALL?= bogofilter-sqlite bogofilter-lmdb bogofilter-kc

USES+= cpe perl5 shebangfix tar:xz
SHEBANG_FILES= contrib/randomtrain.sh contrib/scramble.sh \
src/tests/unsort.pl contrib/*.pl
USE_PERL5= run
GNU_CONFIGURE= yes

CPE_VENDOR= bogofilter_project

UNICODE_USES= iconv
UNICODE_CONFIGURE_ENABLE= unicode
GSL_LIB_DEPENDS= libgsl.so:math/gsl
GSL_CONFIGURE_OFF= --with-included-gsl

PORTDOCS= *

TEST_TARGET= check
PORTREVISION= 3
CATEGORIES= mail
PKGNAMESUFFIX= # blank, to override bogofilter-bdb's

.include <bsd.port.pre.mk>
MAINTAINER= mandree@FreeBSD.org

BF_LIBS?= -l${BDB_LIB_NAME}
BF_CPPFLAGS?= -I${BDB_INCLUDE_DIR} -I${LOCALBASE}/include
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc
.if ${PORT_OPTIONS:MUNICODE}
BF_LIBS+= ${ICONV_LIB}
.endif
CPPFLAGS+= ${BF_CPPFLAGS}
LIBS+= -L${LOCALBASE}/lib ${BF_LIBS}
CONFIGURE_ENV+= PERL="${PERL}"
INSTALL_TARGET= install-strip prefix=${PREFIX} mandir=${MANPREFIX}/man
LIB_DEPENDS= liblmdb.so:databases/lmdb

post-patch:
${REINPLACE_CMD} -e 's/INTEGRITY_TESTS = t.lock1 t.lock3 t.valgrind/INTEGRITY_TESTS = t.lock1/' \
-e 's/ENVIRON_TESTS = t.abort/ENVIRON_TESTS =/' \
${WRKSRC}/src/tests/Makefile.in
CONFLICTS_INSTALL= bogofilter-bdb bogofilter-kc bogofilter-sqlite

post-build:
cd ${WRKSRC}/src && ${SETENV} SHELL=${SH} ${MAKE_CMD} ${TEST_TARGET} ${_MAKE_JOBS} SHELL=${SH} \
|| { r=$$? ; head -n30000 ${WRKSRC}/src/tests/test-suite.log ; exit $$r ; }
CONFIGURE_ARGS= --with-database=lmdb
BF_CPPFLAGS= -I${LOCALBASE}/include
BF_LIBS=
DESCR= ${PKGDIR}/pkg-descr

post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}/contrib
.for i in html programmer xml
@${MKDIR} ${STAGEDIR}${DOCSDIR}/${i}
.endfor
.for i in AUTHORS COPYING INSTALL NEWS README README.git \
doc/README.validation TODO GETTING.STARTED \
RELEASE.NOTES doc/README.db doc/README.sqlite \
doc/integrating-with-postfix doc/integrating-with-qmail \
doc/bogofilter-tuning.HOWTO.html doc/bogofilter-SA-* \
doc/bogofilter-faq.html doc/bogofilter-faq-fr.html
${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
.endfor
.for i in README.randomtrain README.contrib
${INSTALL_DATA} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor
${INSTALL_DATA} ${WRKSRC}/trio/AUTHORS ${STAGEDIR}${DOCSDIR}/AUTHORS.trio
${INSTALL_DATA} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}/html
${INSTALL_DATA} ${WRKSRC}/doc/*.xml ${STAGEDIR}${DOCSDIR}/xml
${INSTALL_DATA} ${WRKSRC}/doc/programmer/README.freebsd ${STAGEDIR}${DOCSDIR}/programmer
${INSTALL_PROGRAM} ${WRKSRC}/bogogrep ${STAGEDIR}${PREFIX}/bin/
.for i in bfproxy.pl bogofilter-milter.pl bogo.R bogofilter-qfe.sh \
mime.get.rfc822.pl parmtest.sh printmaildir.pl \
bogominitrain.pl \
randomtrain.sh scramble.sh spamitarium.pl stripsearch.pl trainbogo.sh
${INSTALL_SCRIPT} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor
.for i in dot-qmail-bogofilter-default \
mailfilter.example procmailrc.example vm-bogofilter.el
${INSTALL_DATA} ${WRKSRC}/contrib/${i} ${STAGEDIR}${DOCSDIR}/contrib/${i}
.endfor
MASTERDIR= ${.CURDIR}/../bogofilter-bdb

.include <bsd.port.post.mk>
.include "${MASTERDIR}/Makefile"

0 comments on commit c443b66

Please sign in to comment.