+# TODO:
+# - make separate package linked with sqlite
+# - make milter subpackage
+# - maybe make some separate package with contrib perl scripts?
+# - remove bogus banner
+#
Summary: Bayesian Spam Filter
-Summary(pl): Bayesjañski Filtr Antyspamowy
+Summary(pl.UTF-8): Bayesowski Filtr Antyspamowy
Name: bogofilter
-Version: 0.94.11
-Release: 1
-License: GPL
-Vendor: Eric S. Raymond <esr@thyrsus.com>
+Version: 1.2.5
+Release: 2
+License: GPL v2
Group: Applications/Mail
-Source0: http://dl.sourceforge.net/bogofilter/%{name}-%{version}.tar.gz
-# Source0-md5: a892ad5a2c085b9ee7f5d484491eb5a3
+Source0: https://downloads.sourceforge.net/bogofilter/%{name}-%{version}.tar.xz
+# Source0-md5: 8763f87adfff7b802ced177d8c654539
Patch0: %{name}-home_etc.patch
-Patch1: %{name}-dummy.patch
-URL: http://bogofilter.sourceforge.net/
-BuildRequires: autoconf >= 2.53
-BuildRequires: automake
+URL: https://bogofilter.sourceforge.net/
+BuildRequires: autoconf >= 2.68
+BuildRequires: automake >= 1:1.11
+# alternatives (--with-database=): qdbm,sqlite3,tokyocabinet,kyotocabinet,lmdb
BuildRequires: db-devel
BuildRequires: flex
-BuildRequires: gsl-devel
-BuildRequires: judy-devel
+BuildRequires: gettext-tools
+BuildRequires: gsl-devel >= 1.4
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
Requires: gsl >= 1.4
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
system), coded directly in C, and tuned for speed, so it can be used
for production by sites that process a lot of mail.
-%description -l pl
-Bogofilter jest bayesjañskim filtrem antyspamowym. W podstawowym
-trybie dzia³ania na emailu lub innym tek¶cie odczytanym na wej¶ciu
-wykonuje statystyczne testy na wystêpowanie "dobrych" i "z³ych" s³ów i
-zwraca kod powrotu wskazuj±cy czy wiadomo¶æ jest spamem, czy te¿ nie.
-Bogofilter jest zaprojektowany z u¿yciem szybkich algorytmów
-(w³±czaj±c w to Berkeley DB), napisany w czystym C i "podkrêcony" pod
-k±tem szybko¶ci, a wiêc mo¿e byæ u¿ywany na systemach "produkcyjnych",
-które przetwarzaj± du¿e ilo¶ci poczty.
+%description -l pl.UTF-8
+Bogofilter jest bayesowski filtrem antyspamowym. W podstawowym trybie
+działania na emailu lub innym tekście odczytanym na wejściu wykonuje
+statystyczne testy na występowanie "dobrych" i "złych" słów i zwraca
+kod powrotu wskazujący czy wiadomość jest spamem, czy też nie.
+Bogofilter jest zaprojektowany z użyciem szybkich algorytmów
+(włączając w to Berkeley DB), napisany w czystym C i "podkręcony" pod
+kątem szybkości, a więc może być używany na systemach "produkcyjnych",
+które przetwarzają duże ilości poczty.
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
%build
%{__aclocal}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-cp $RPM_BUILD_ROOT%{_sysconfdir}/bogofilter.cf.example $RPM_BUILD_ROOT%{_sysconfdir}/bogofilter.cf
+cp -p $RPM_BUILD_ROOT%{_sysconfdir}/bogofilter.cf.example $RPM_BUILD_ROOT%{_sysconfdir}/bogofilter.cf
-rm -f $RPM_BUILD_ROOT%{_bindir}/lexertest
+install bogogrep $RPM_BUILD_ROOT%{_bindir}
+# Some apps from contrib:
+install contrib/bfproxy.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/bogominitrain.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/mime.get.rfc822.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/printmaildir.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/spamitarium.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/stripsearch.pl $RPM_BUILD_ROOT%{_bindir}
+install contrib/trainbogo.sh $RPM_BUILD_ROOT%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
+# That banner is bogus - no sense to have it _while_ upgrading...
+# It should be some trigger...
+# It makes at least sense that someone will read this file
+# before running bogofilter after upgrade and corrupt his db as
+# it happened before. Bogofilter is not service/daemon by default
+# so its not run automaticaly after upgrade. One can still backup
+# his db.
+%pre
+%banner %{name} -e <<'EOF'
+
+WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+------------------------------------------------------------------------
+POTENTIAL FOR DATA CORRUPTION DURING UPDATES
+
+If you plan to upgrade your database library, if only as a side effect
+of an operating system upgrade, DO HEED the relevant documentation, for
+instance, the %{_docdir}/%{name}-%{version}/README.db file.
+You may need to prepare the upgrade with the old version of the software.
+
+Otherwise, you may cause irrecoverable damage to your databases.
+
+DO backup your databases before making the upgrade.
+------------------------------------------------------------------------
+WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
+
+EOF
+
%files
%defattr(644,root,root,755)
-%doc AUTHORS GETTING.STARTED RELEASE* NEWS README TODO
+%doc AUTHORS GETTING.STARTED NEWS* README RELEASE.NOTES TODO doc/{README.*,bogofilter-SA*,bogofilter-faq.html,bogofilter-tuning.HOWTO.html,bogotune-faq.html,integrating*}
+%lang(bg) %doc doc/bogofilter-faq-bg.xhtml
+%lang(fr) %doc doc/bogofilter-faq-fr.html
+%lang(it) %doc doc/bogofilter-faq-it.html
+%doc contrib/{README.*,bogo.R,bogofilter-qfe.sh,bogofilter-milter.pl,dot-qmail-bogofilter-default,*.example,parmtest.sh,randomtrain.sh,scramble.sh,vm-bogofilter.el}
%config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/bogofilter.cf
-%attr(755,root,root) %{_bindir}/*
-%attr(644,root,root) %{_mandir}/man1/*
+%attr(755,root,root) %{_bindir}/bf_compact
+%attr(755,root,root) %{_bindir}/bf_copy
+%attr(755,root,root) %{_bindir}/bf_tar
+%attr(755,root,root) %{_bindir}/bfproxy.pl
+%attr(755,root,root) %{_bindir}/bogofilter
+%attr(755,root,root) %{_bindir}/bogogrep
+%attr(755,root,root) %{_bindir}/bogolexer
+%attr(755,root,root) %{_bindir}/bogominitrain.pl
+%attr(755,root,root) %{_bindir}/bogotune
+%attr(755,root,root) %{_bindir}/bogoupgrade
+%attr(755,root,root) %{_bindir}/bogoutil
+%attr(755,root,root) %{_bindir}/mime.get.rfc822.pl
+%attr(755,root,root) %{_bindir}/printmaildir.pl
+%attr(755,root,root) %{_bindir}/spamitarium.pl
+%attr(755,root,root) %{_bindir}/stripsearch.pl
+%attr(755,root,root) %{_bindir}/trainbogo.sh
+%{_mandir}/man1/bf_compact.1*
+%{_mandir}/man1/bf_copy.1*
+%{_mandir}/man1/bf_tar.1*
+%{_mandir}/man1/bogofilter.1*
+%{_mandir}/man1/bogolexer.1*
+%{_mandir}/man1/bogotune.1*
+%{_mandir}/man1/bogoupgrade.1*
+%{_mandir}/man1/bogoutil.1*