X-Git-Url: http://git.pld-linux.org/?p=packages%2Fdspam.git;a=blobdiff_plain;f=dspam.spec;h=0c56d41a7e5b53ef3f00d59ec7505f50923ae2a4;hp=4f9e707fc3c4f86bebc8d57a7f327e3c59887719;hb=HEAD;hpb=8b918ab12dcd9e9d391b4ef5e54da429728df46a diff --git a/dspam.spec b/dspam.spec index 4f9e707..bf936b6 100644 --- a/dspam.spec +++ b/dspam.spec @@ -2,39 +2,39 @@ # - support for libdclassify # - oracle driver # - messages from default install of cron with mysql driver Memory fault -# - installing dspam and dspam-client on same host causes -# /etc/dspam.conf being owned by both packages and .rpmnew files being -# created. move the config to -libs? -common? patch code to use -# different config for client? +# - remove versioned sonames from drivers # # Conditional build: %bcond_without mysql # disable MySQL storage driver %bcond_without pgsql # disable PostgreSQL storage driver %bcond_without sqlite # disable SQLite3 storage driver %bcond_with mysql40 # use with mysql 4.0 -# -%include /usr/lib/rpm/macros.perl + Summary: A library and Mail Delivery Agent for Bayesian spam filtering Summary(pl.UTF-8): Biblioteka i MDA do bayesowskiego filtrowania spamu Name: dspam -Version: 3.6.8 -Release: 0.1 -License: GPL +Version: 3.9.0 +Release: 8 +License: GPL v2+ Group: Applications/Mail -Source0: http://dspam.nuclearelephant.com/sources/%{name}-%{version}.tar.gz -# Source0-md5: c4b1a7079690ee16d8b0f36b2a2a90a4 +Source0: http://downloads.sourceforge.net/project/dspam/dspam/%{name}-%{version}/%{name}-%{version}.tar.gz +# Source0-md5: 10d092b57d628d8c91655fee5dc0d0cd +Source1: %{name}.init +Source2: %{name}-apache.conf +Source3: %{name}.tmpfiles +Source4: %{name}-httpd.conf Patch0: %{name}-webui.patch Patch1: %{name}-config.patch Patch2: %{name}-speedup.patch -Source1: %{name}.init -Source2: %{name}-apache.conf +Patch3: %{name}-autotools.patch +Patch4: %{name}-single-char-usernames.patch URL: http://dspam.nuclearelephant.com/ BuildRequires: autoconf BuildRequires: automake BuildRequires: clamav-devel BuildRequires: libtool %{?with_mysql:BuildRequires: mysql-devel} -BuildRequires: openldap-devel +BuildRequires: openldap-devel >= 2.4.6 %{?with_pgsql:BuildRequires: postgresql-devel} BuildRequires: rpm-perlprov >= 4.1-13 BuildRequires: rpmbuild(macros) >= 1.268 @@ -42,13 +42,17 @@ BuildRequires: sed >= 4.0 %{?with_sqlite:BuildRequires: sqlite3-devel} BuildRequires: zlib-devel Requires(post,preun): /sbin/chkconfig +Requires: %{name}-common = %{version}-%{release} Requires: %{name}-driver = %{version}-%{release} Requires: rc-scripts -Buildroot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _webapps /etc/webapps %define _webapp %{name} +# symbols are provided by dspam executable +%define skip_post_check_so libdspam.so.7.0.0 lib(hash\|mysql\|pgsql\|sqlite3)_drv.so.7.0.0 + %description DSPAM (as in De-Spam) is an open-source project to create a new kind of anti-spam mechanism, and is currently effective as both a @@ -91,9 +95,7 @@ qmailem itd.). Summary: dspam client Summary(pl.UTF-8): Klient dspam Group: Applications/Mail -# to get the same dspam.conf when both installed -Conflicts: dspam < %{version}-%{release} -Conflicts: dspam > %{version}-%{release} +Requires: %{name}-common %description client dspam client. @@ -101,6 +103,17 @@ dspam client. %description client -l pl.UTF-8 Klient dspam. +%package common +Summary: Common files for dspam packages +Summary(pl.UTF-8): Wspólne pliki dla pakietów z dspamem +Group: Applications/Mail + +%description common +Common files for dspam and dspam-client packages. + +%description common -l pl.UTF-8 +Wspólne pliki dla pakietów dspam i dspam-client. + %package libs Summary: A library for Bayesian spam filtering Summary(pl.UTF-8): Biblioteka do bayesowskiego filtrowania spamu @@ -198,18 +211,19 @@ PostgreSQL driver for DSPAM. %description driver-pgsql -l pl.UTF-8 Sterownik PostgreSQL dla DSPAM-a. -%package driver-sqlite +%package driver-sqlite3 Summary: SQLite driver for DSPAM Summary(pl.UTF-8): Sterownik SQLite dla DSPAM-a Group: Libraries Requires(post): sed >= 4.0 Requires: %{name} = %{version}-%{release} Provides: %{name}-driver = %{version}-%{release} +Obsoletes: dspam-driver-sqlite -%description driver-sqlite +%description driver-sqlite3 SQLite driver for DSPAM. -%description driver-sqlite -l pl.UTF-8 +%description driver-sqlite3 -l pl.UTF-8 Sterownik SQLite dla DSPAM-a. %package webui @@ -219,6 +233,7 @@ Group: Applications/WWW Requires: webapps # needs dspam binary Requires: %{name} = %{version}-%{release} +Conflicts: apache-base < 2.4.0-1 %description webui The Web UI (CGI client) can be run from any executable location on a @@ -248,6 +263,8 @@ wystarczy dla większości popularnych instalacji. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile* %{?with_mysql40:sed -i -e 's#40100#99999#g' src/mysql_drv.c} sed -i -e 's,/usr/local/dspam/bin,/usr/bin,' ./scripts/train.pl @@ -256,34 +273,30 @@ sed -i -e 's,/usr/local/dspam/bin,/usr/bin,' ./scripts/train.pl %{__libtoolize} %{__aclocal} -I m4 %{__autoconf} +%{__autoheader} %{__automake} DRIVERS=" hash_drv %{?with_mysql:mysql_drv} %{?with_pgsql:pgsql_drv} -%{?with_sqlite:sqlite_drv} +%{?with_sqlite:sqlite3_drv} " %configure \ --disable-dependency-tracking \ %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \ --enable-trusted-user-security \ - --enable-bias \ --enable-large-scale \ - --with-userdir=/var/lib/%{name} \ - --with-userdir-owner=none \ - --with-userdir-group=none \ --with-dspam-home=/var/lib/%{name} \ --with-dspam-home-owner=none \ --with-dspam-home-group=none \ --with-dspam-owner=none \ --with-dspam-group=none \ - --with-signature-life=14 \ + --with-logdir=/var/log/%{name} \ --enable-ldap \ --enable-clamav \ --enable-preferences-extension \ --enable-long-usernames \ - --enable-neural-networking \ --enable-virtual-users \ --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \ %if %{with mysql} @@ -294,22 +307,25 @@ hash_drv --with-pgsql-includes=%{_includedir}/postgresql \ --with-pgsql-libraries=%{_libdir} \ %endif +%if 0 %if %{with sqlite} - --with-sqlite3-includes=%{_includedir} \ - --with-sqlite3-libraries=%{_libdir} \ + --with-sqlite-includes=%{_includedir} \ + --with-sqlite-libraries=%{_libdir} \ +%endif %endif --enable-daemon # --enable-dclassify-extension needs libdclassify -%{__make} +%{__make} -j1 %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{/var/run/dspam,/etc/{rc.d/init.d,sysconfig}} \ - $RPM_BUILD_ROOT/var/lib/%{name}/{txt,data} + $RPM_BUILD_ROOT/var/lib/%{name}/{txt,data} \ + $RPM_BUILD_ROOT/usr/lib/tmpfiles.d -%{__make} install \ +%{__make} -j1 install \ DESTDIR=$RPM_BUILD_ROOT install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam @@ -366,9 +382,14 @@ EOF install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf -install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf +install %{SOURCE4} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf touch $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/htpasswd +install %{SOURCE3} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf + +# cleanup +%{__rm} $RPM_BUILD_ROOT%{_libdir}/dspam/*.{a,la} + %post /sbin/chkconfig --add dspam %service dspam restart "dspam daemon" @@ -386,24 +407,16 @@ rm -rf $RPM_BUILD_ROOT %postun libs -p /sbin/ldconfig %post driver-hash -if [ "$1" = "1" ]; then - sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libhash_drv.so,' /etc/dspam.conf -fi +%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libhash_drv.so,' /etc/dspam.conf %post driver-mysql -if [ "$1" = "1" ]; then - sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libmysql_drv.so,' /etc/dspam.conf -fi +%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libmysql_drv.so,' /etc/dspam.conf %post driver-pgsql -if [ "$1" = "1" ]; then - sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libpgsql_drv.so,' /etc/dspam.conf -fi +%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libpgsql_drv.so,' /etc/dspam.conf -%post driver-sqlite -if [ "$1" = "1" ]; then - sed -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/libsqlite_drv.so,' /etc/dspam.conf -fi +%post driver-sqlite3 +%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libsqlite3_drv.so,' /etc/dspam.conf %triggerin webui -- apache1 < 1.3.37-3, apache1-base %webapp_register apache %{_webapp} @@ -411,10 +424,10 @@ fi %triggerun webui -- apache1 < 1.3.37-3, apache1-base %webapp_unregister apache %{_webapp} -%triggerin webui -- apache < 2.2.0, apache-base +%triggerin webui -- apache-base %webapp_register httpd %{_webapp} -%triggerun webui -- apache < 2.2.0, apache-base +%triggerun webui -- apache-base %webapp_unregister httpd %{_webapp} %files @@ -422,11 +435,12 @@ fi %doc README CHANGELOG RELEASE.NOTES UPGRADING %doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt %doc scripts/train.pl -%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf +/usr/lib/tmpfiles.d/%{name}.conf %dir %attr(775,root,mail) /var/run/dspam %dir %attr(750,root,mail) /var/lib/%{name} %dir %attr(770,root,mail) /var/lib/%{name}/data %dir /var/lib/%{name}/txt +%dir %{_libdir}/dspam %config(noreplace) %verify(not md5 mtime size) /var/lib/%{name}/txt/*.txt %dir %attr(770,root,mail) /var/log/dspam %attr(754,root,root) /etc/rc.d/init.d/dspam @@ -445,39 +459,40 @@ fi %files client %defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf %attr(755,root,root) %{_bindir}/%{name}c +%files common +%defattr(644,root,root,755) +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf + %files libs %defattr(644,root,root,755) -%doc README CHANGELOG -%attr(755,root,root) %{_libdir}/lib*.so.*.*.* -%attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so* +%attr(755,root,root) %{_libdir}/libdspam.so.7.0.0 +%attr(755,root,root) %ghost %{_libdir}/libdspam.so.7 %files devel %defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/lib*.so -%attr(755,root,root) %exclude %{_libdir}/lib*_drv*.so* -%{_libdir}/lib*.la +%attr(755,root,root) %{_libdir}/libdspam.so +%{_libdir}/libdspam.la %{_includedir}/%{name} -%{_mandir}/man3/libdspam* -%{_pkgconfigdir}/*.pc +%{_mandir}/man3/libdspam.3* +%{_pkgconfigdir}/dspam.pc %files static %defattr(644,root,root,755) -%{_libdir}/lib*.a +%{_libdir}/libdspam.a %files driver-hash %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/css* -%attr(755,root,root) %{_libdir}/libhash_drv*.so* +%attr(755,root,root) %{_libdir}/dspam/libhash_drv.so* %if %{with mysql} %files driver-mysql %defattr(644,root,root,755) %doc doc/mysql_drv.txt src/tools.mysql_drv/*.sql %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data -%attr(755,root,root) %{_libdir}/libmysql_drv*.so* +%attr(755,root,root) %{_libdir}/dspam/libmysql_drv.so* %endif %if %{with pgsql} @@ -486,14 +501,14 @@ fi %doc doc/pgsql_drv.txt src/tools.pgsql_drv/*.sql %attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data %attr(755,root,root) %{_bindir}/%{name}_pg2int8 -%attr(755,root,root) %{_libdir}/libpgsql_drv*.so* +%attr(755,root,root) %{_libdir}/dspam/libpgsql_drv.so* %endif %if %{with sqlite} -%files driver-sqlite +%files driver-sqlite3 %defattr(644,root,root,755) %doc doc/sqlite_drv.txt -%attr(755,root,root) %{_libdir}/libsqlite_drv*.so* +%attr(755,root,root) %{_libdir}/dspam/libsqlite3_drv.so* %endif %files webui