File bmf.spec of Package bmf

# vim: set sw=4 ts=4 et nu:
# norootforbuild

Name:               bmf
Version:            0.9.4
Release:            0
Summary:            Bayesian Mail Filter
Source:             http://prdownloads.sourceforge.net/bmf/bmf-%{version}.tar.gz
Patch1:             bmf-optflags.patch
Patch2:             bmf-disable_root_check.patch
URL:                http://sourceforge.net/projects/bmf/
Group:              Productivity/Networking/Email/Utilities
License:            GNU General Public License version 2 (GPL v2)
BuildRoot:          %{_tmppath}/build-%{name}-%{version}
BuildRequires:      libmysqlclient-devel
%if 0%{?suse_version} >= 1030
BuildRequires:      libdb-4_5-devel
%else
BuildRequires:      db-devel
%endif
BuildRequires:      gcc make glibc-devel pkgconfig

%description
bmf is a self contained and extremely efficient Bayesian mail filter. SeePaul
Graham's article "A Plan for Spam" for background information. It aims to be
faster, smaller, and more versatile than similar applications.

%prep
%setup -q
%patch1
%patch2

%build
./configure \
    --debug=no \
    --with-libdb=/usr \
    --with-mysql=test \
2>&1|tee configure.log

for c in BerkeleyDB MySQL; do
    %__grep -q -E "${c}.*enabled" configure.log || { echo "missing support for $c" >&2; exit 1; }
done

%__make %{?jobs:-j%{jobs}} \
    OPTFLAGS="%{optflags}" \
    CC="%__cc" \
    all

%install
%makeinstall

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-,root,root)
%doc LICENSE AUTHORS ChangeLog README TODO
%{_bindir}/bmf
%{_bindir}/bmfconv
%{_mandir}/man1/bmf.1%{ext_man}
%{_mandir}/man1/bmfconv.1%{ext_man}


openSUSE Build Service is sponsored by