Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail-filter/bmf: fix parameter c was not declared, defaults to int #30900

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions mail-filter/bmf/bmf-0.9.4-r4.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit toolchain-funcs

IUSE="mysql berkdb"

DESCRIPTION="A fast and small Bayesian spam filter"
HOMEPAGE="http://bmf.sourceforge.net/"
SRC_URI="mirror://sourceforge/bmf/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"

DEPEND="mysql? ( dev-db/mysql-connector-c:0= )
berkdb? ( >=sys-libs/db-3.2.9 )"
RDEPEND="${DEPEND}"

PATCHES=(
"${FILESDIR}/${P}_QA.patch"
"${FILESDIR}/${P}_parameter-not-declared-fix.patch"
)
DOCS=( README AUTHORS ChangeLog )

src_prepare() {
# respect CFLAGS
sed -i -e '/D_LINUX/s/CFLAGS="$CCDBG/CFLAGS+=" $CCDBG/' \
"${S}/configure" || die

# include mysql headers
sed -i -e '/HAVE_MYSQL/s/HAVE_MYSQL/HAVE_MYSQL `mysql_config --include`/' \
"${S}/configure" || die

# We don't need to be root to run install
sed -i -e 's/install: checkroot bmf/install: bmf/' Makefile.in || die

default
}

src_configure() {
# this is not an autotools script
./configure \
$(use_with mysql) \
$(use_with berkdb libdb) || die
}

src_compile() {
emake CC="$(tc-getCC)"
}

pkg_postinst() {
elog
elog "Important: Remember to train bmf before you start using it."
elog "See the README file for further instructions on training and using bmf"
elog "with procmail."
elog
}
24 changes: 24 additions & 0 deletions mail-filter/bmf/files/bmf-0.9.4_parameter-not-declared-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Bug: https://bugs.gentoo.org/885043
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please submit it upstream & link here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I need to figure out how to send patch through sourceforge.net

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, Which slot of sys-libs/db should be used?

--- a/lex.c
+++ b/lex.c
@@ -186,17 +186,17 @@ static inline bool_t is_whitespace( int c )
return ( c == ' ' || c == '\t' || c == '\r' );
}

-static inline bool_t is_base64char(c)
+static inline bool_t is_base64char( int c )
{
return ( isalnum(c) || (c == '/' || c == '+') );
}

-static inline bool_t is_wordmidchar(c)
+static inline bool_t is_wordmidchar( int c )
{
return ( isalnum(c) || c == '$' || c == '\'' || c == '.' || c == '-' );
}

-static inline bool_t is_wordendchar(c)
+static inline bool_t is_wordendchar( int c )
{
return ( isalnum(c) || c == '$' );
}