]> git.pld-linux.org Git - packages/dspam.git/blobdiff - dspam.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/dspam.git] / dspam.spec
index 5ec7a0fd299c38421a45409ce7cc23a04c03fb3b..bf936b6091e3bece42937a8243c0644ccf7351b3 100644 (file)
@@ -1,65 +1,57 @@
-# NOTE about versioning:
-#  Stable Releases: 3.4.x, Development Releases: 3.5.x
-#  All odd-versioned minor releases are considered development
-#  releases, and all even-versioned minor releases are stable releases
-# - from http://www.nuclearelephant.com/projects/dspam/download.shtml
-#
 # TODO:
 # TODO:
-# - everything
+# - support for libdclassify
 # - oracle driver
 # - oracle driver
-# - missing /etc/dspam.conf for cron:
-#   /etc/cron.daily/dspam:
-#    2430: [6/28/2005 1:2:1] Unable to open file for reading: /etc/dspam.conf: No such file or directory
-#    2430: [6/28/2005 1:2:1] Unable to read dspam.conf
+# - messages from default install of cron with mysql driver Memory fault
+# - remove versioned sonames from drivers
 #
 # Conditional build:
 #
 # Conditional build:
-%bcond_without mysql   # enable MySQL storage driver (disable sqlite/pgsql driver)
-%bcond_with    pgsql   # enable PostgreSQL storage driver (disable sqlite/mysql driver)
-%bcond_with    sqlite  # enable SQLite3 storage driver
-%bcond_with    daemon
-
-%if %{with mysql} && %{with pgsql}
-%undefine with_pgsql
-%{warn:disabled pgsql as mysql and pgsql aren't supported together (yet)
-}#'vim
-%endif
-
-%if %{with mysql} && %{with sqlite}
-%undefine with_sqlite
-%{warn:disabled sqlite as mysql and sqlite aren't supported together (yet)
-}#'vim
-%endif
-
-%if %{with pgsql} && %{with sqlite}
-%undefine with_sqlite
-%{warn:disabled sqlite as pgsql and sqlite aren't supported together (yet)
-}#'vim
-%endif
-
-
-%if %{with mysql} || %{with pgsql}
-%define        with_daemon 1
-%endif
+%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
 
 Summary:       A library and Mail Delivery Agent for Bayesian spam filtering
 
 Summary:       A library and Mail Delivery Agent for Bayesian spam filtering
-Summary(pl):   Biblioteka i MDA do bayesowskiego filtrowania spamu
+Summary(pl.UTF-8):     Biblioteka i MDA do bayesowskiego filtrowania spamu
 Name:          dspam
 Name:          dspam
-Version:       3.4.9
-Release:       0.2
-License:       GPL
+Version:       3.9.0
+Release:       8
+License:       GPL v2+
 Group:         Applications/Mail
 Group:         Applications/Mail
-Source0:       http://www.nuclearelephant.com/projects/dspam/sources/%{name}-%{version}.tar.gz
-# Source0-md5: ef7ceba47e63edb02a59be3c36cf0f6f
+Source0:       http://downloads.sourceforge.net/project/dspam/dspam/%{name}-%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 10d092b57d628d8c91655fee5dc0d0cd
 Source1:       %{name}.init
 Source1:       %{name}.init
-URL:           http://www.nuclearelephant.com/projects/dspam/
+Source2:       %{name}-apache.conf
+Source3:       %{name}.tmpfiles
+Source4:       %{name}-httpd.conf
+Patch0:                %{name}-webui.patch
+Patch1:                %{name}-config.patch
+Patch2:                %{name}-speedup.patch
+Patch3:                %{name}-autotools.patch
+Patch4:                %{name}-single-char-usernames.patch
+URL:           http://dspam.nuclearelephant.com/
 BuildRequires: autoconf
 BuildRequires: automake
 BuildRequires: autoconf
 BuildRequires: automake
+BuildRequires: clamav-devel
 BuildRequires: libtool
 %{?with_mysql:BuildRequires:   mysql-devel}
 BuildRequires: libtool
 %{?with_mysql:BuildRequires:   mysql-devel}
+BuildRequires: openldap-devel >= 2.4.6
 %{?with_pgsql:BuildRequires:   postgresql-devel}
 %{?with_pgsql:BuildRequires:   postgresql-devel}
-%{?with_sqlite:BuildRequires:  sqlite3-devel}
+BuildRequires: rpm-perlprov >= 4.1-13
+BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: sed >= 4.0
 BuildRequires: sed >= 4.0
-Buildroot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%{?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)
+
+%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
 
 %description
 DSPAM (as in De-Spam) is an open-source project to create a new kind
@@ -79,44 +71,54 @@ works great with Sendmail and Exim, and should work well with any
 other MTA that supports an external local delivery agent (postfix,
 qmail, etc.)
 
 other MTA that supports an external local delivery agent (postfix,
 qmail, etc.)
 
-%description -l pl
-DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
+%description -l pl.UTF-8
+DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu
 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
-efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
-uniksowych serwerów pocztowych jak i biblioteka dla programistów
-klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
-wymagaj±cych filtrowania spamu w locie.
-
-Agent DSPAM zachowuje siê jak lokalny agent dostarczania poczty (MDA)
-i filtruje/uczy siê spamu przy u¿yciu zaawansowanego bayesowskiego
-przybli¿enia statystycznego (opartego na twierdzeniu Bayesa o
-po³±czonych prawdopodobieñstwach), daj±c nie wymagaj±c± obs³ugi
-administracyjnej, ³atwo ucz±c± siê us³ugê antyspamow± dostosowan± do
-zachowania ka¿dego u¿ytkownika. Metoda jest zaawansowana poniewa¿ na
-podstawie standardowego filtrowania bayesowskiego wprowadzono u¿ycie
-tokenów ³añcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
-DSPAM dzia³a wspaniale z Sendmailem i Eximem, powinien dzia³aæ dobrze
-z ka¿dym innym MTA obs³uguj±cym zewnêtrznego agenta MDA (postfiksem,
+efektywny zarówno jako działający po stronie serwera agent dla
+uniksowych serwerów pocztowych jak i biblioteka dla programistów
+klientów pocztowych, innych narzędzi antyspamowych i innych projektów
+wymagających filtrowania spamu w locie.
+
+Agent DSPAM zachowuje się jak lokalny agent dostarczania poczty (MDA)
+i filtruje/uczy się spamu przy użyciu zaawansowanego bayesowskiego
+przybliżenia statystycznego (opartego na twierdzeniu Bayesa o
+połączonych prawdopodobieństwach), dając nie wymagającą obsługi
+administracyjnej, łatwo uczącą się usługę antyspamową dostosowaną do
+zachowania każdego użytkownika. Metoda jest zaawansowana ponieważ na
+podstawie standardowego filtrowania bayesowskiego wprowadzono użycie
+tokenów łańcuchowych, eliminowanie ukrywanie i inne rozszerzenia.
+DSPAM działa wspaniale z Sendmailem i Eximem, powinien działać dobrze
+z każdym innym MTA obsługującym zewnętrznego agenta MDA (postfiksem,
 qmailem itd.).
 
 %package client
 qmailem itd.).
 
 %package client
-Summary:        dspam client
-Summary(pl):    Klient dspam
-Group:          Applications/Mail
-# to get the same dspam.conf when both installed
-Conflicts:     dspam > %{version}-%{release}
-Conflicts:     dspam < %{version}-%{release}
+Summary:       dspam client
+Summary(pl.UTF-8):     Klient dspam
+Group:         Applications/Mail
+Requires:      %{name}-common
 
 %description client
 dspam client.
 
 
 %description client
 dspam client.
 
-%description -l pl client
+%description client -l pl.UTF-8
 Klient dspam.
 
 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
 %package libs
 Summary:       A library for Bayesian spam filtering
-Summary(pl):   Biblioteka do bayesowskiego filtrowania spamu
+Summary(pl.UTF-8):     Biblioteka do bayesowskiego filtrowania spamu
 Group:         Libraries
 Group:         Libraries
+Obsoletes:     dspam-driver-db
 
 %description libs
 DSPAM (as in De-Spam) is an open-source project to create a new kind
 
 %description libs
 DSPAM (as in De-Spam) is an open-source project to create a new kind
@@ -127,19 +129,19 @@ drop-in spam filtering.
 
 This package contains the library.
 
 
 This package contains the library.
 
-%description libs -l pl
-DSPAM (czyli De-Spam) to projekt o otwartych ¼ród³ach maj±cy na celu
+%description libs -l pl.UTF-8
+DSPAM (czyli De-Spam) to projekt o otwartych źródłach mający na celu
 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
 stworzenie nowego rodzaju mechanizmu antyspamowego. Aktualnie jest
-efektywny zarówno jako dzia³aj±cy po stronie serwera agent dla
-uniksowych serwerów pocztowych jak i biblioteka dla programistów
-klientów pocztowych, innych narzêdzi antyspamowych i innych projektów
-wymagaj±cych filtrowania spamu w locie.
+efektywny zarówno jako działający po stronie serwera agent dla
+uniksowych serwerów pocztowych jak i biblioteka dla programistów
+klientów pocztowych, innych narzędzi antyspamowych i innych projektów
+wymagających filtrowania spamu w locie.
 
 
-Ten pakiet zawiera wspomnian± bibliotekê.
+Ten pakiet zawiera wspomnianą bibliotekę.
 
 %package devel
 Summary:       Header files for the DSPAM library
 
 %package devel
 Summary:       Header files for the DSPAM library
-Summary(pl):   Pliki nag³ówkowe biblioteki DSPAM
+Summary(pl.UTF-8):     Pliki nagłówkowe biblioteki DSPAM
 Group:         Development/Libraries
 Requires:      %{name}-libs = %{version}-%{release}
 
 Group:         Development/Libraries
 Requires:      %{name}-libs = %{version}-%{release}
 
@@ -149,87 +151,193 @@ This library can be used by developers to provide 'drop-in' spam
 filtering for their mail client applications, other anti-spam tools,
 or similar projects.
 
 filtering for their mail client applications, other anti-spam tools,
 or similar projects.
 
-%description devel -l pl
-G³ówny silnik DSPAM zosta³ przeniesiony do oddzielnej biblioteki
-libdspam, która mo¿e byæ u¿ywana przez programistów do zapewnienia
-filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
-narzêdzi antyspamowych i podobnych projektów.
+%description devel -l pl.UTF-8
+Główny silnik DSPAM został przeniesiony do oddzielnej biblioteki
+libdspam, która może być używana przez programistów do zapewnienia
+filtrowania spamu w locie dla aplikacji klientów pocztowych, innych
+narzędzi antyspamowych i podobnych projektów.
 
 %package static
 Summary:       Static DSPAM library
 
 %package static
 Summary:       Static DSPAM library
-Summary(pl):   Statyczna biblioteka DSPAM
+Summary(pl.UTF-8):     Statyczna biblioteka DSPAM
 Group:         Development/Libraries
 Requires:      %{name}-devel = %{version}-%{release}
 
 %description static
 Static DSPAM library.
 
 Group:         Development/Libraries
 Requires:      %{name}-devel = %{version}-%{release}
 
 %description static
 Static DSPAM library.
 
-%description static -l pl
+%description static -l pl.UTF-8
 Statyczna biblioteka DSPAM.
 
 Statyczna biblioteka DSPAM.
 
+%package driver-hash
+Summary:       HASH driver for DSPAM
+Summary(pl.UTF-8):     Sterownik HASH dla DSPAM-a
+Group:         Libraries
+Requires(post):        sed >= 4.0
+Requires:      %{name} = %{version}-%{release}
+Provides:      %{name}-driver = %{version}-%{release}
+
+%description driver-hash
+HASH driver for DSPAM.
+
+%description driver-hash -l pl.UTF-8
+Sterownik HASH dla DSPAM-a.
+
+%package driver-mysql
+Summary:       MySQL driver for DSPAM
+Summary(pl.UTF-8):     Sterownik MySQL dla DSPAM-a
+Group:         Libraries
+Requires(post):        sed >= 4.0
+Requires:      %{name} = %{version}-%{release}
+Provides:      %{name}-driver = %{version}-%{release}
+
+%description driver-mysql
+MySQL driver for DSPAM.
+
+%description driver-mysql -l pl.UTF-8
+Sterownik MySQL dla DSPAM-a.
+
+%package driver-pgsql
+Summary:       PostgreSQL driver for DSPAM
+Summary(pl.UTF-8):     Sterownik PostgreSQL dla DSPAM-a
+Group:         Libraries
+Requires(post):        sed >= 4.0
+Requires:      %{name} = %{version}-%{release}
+Provides:      %{name}-driver = %{version}-%{release}
+
+%description driver-pgsql
+PostgreSQL driver for DSPAM.
+
+%description driver-pgsql -l pl.UTF-8
+Sterownik PostgreSQL dla DSPAM-a.
+
+%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-sqlite3
+SQLite driver for DSPAM.
+
+%description driver-sqlite3 -l pl.UTF-8
+Sterownik SQLite dla DSPAM-a.
+
+%package webui
+Summary:       DSPAM Web UI
+Summary(pl.UTF-8):     Interfejs WWW do programu DSPAM
+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
+web server, and detects its user's identity from the REMOTE_USER
+environment variable. This means you'll need to use HTTP password
+authentication to access the CGI (Any type of authentication will
+work, so long as Apache supports the module). This is also convenient
+in that you can set up authentication using almost any existing system
+you have. The only catch is that you'll need the usernames to match
+the actual DSPAM usernames used the system. A copy of the shadow
+password file will suffice for most common installs.
+
+%description webui -l pl.UTF-8
+Interfejs użytkownika WWW (klient CGI) może być uruchamiany z
+dowolnego wykonywalnego miejsca na serwerze WWW i rozpoznaje tożsamość
+użytkownika ze zmiennej środowiskowej REMOTE_USER. Oznacza to, że
+trzeba użyć uwietrzytelnienia HTTP z hasłem do dostępu do CGI (działać
+będzie dowolny rodzaj uwierzytelnienia obsługiwany przez moduły
+Apache'a). Jest to o tyle wygodne, że można skonfigurować
+uwierzytelnianie dla prawie każdego istniejącego systemu. Jedynym
+wymogiem jest, żeby nazwy użytkowników pokrywały się z nazwami
+użytkowników DSPAM-a używanymi w systemie. Kopia pliku shadow
+wystarczy dla większości popularnych instalacji.
+
 %prep
 %setup -q
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 sed -i -e 's#\-static##g' src/Makefile* src/*/Makefile*
 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
 
 %build
 %{__libtoolize}
 %{__aclocal} -I m4
 %{__autoconf}
 
 %build
 %{__libtoolize}
 %{__aclocal} -I m4
 %{__autoconf}
+%{__autoheader}
 %{__automake}
 %{__automake}
+
+DRIVERS="
+hash_drv
+%{?with_mysql:mysql_drv}
+%{?with_pgsql:pgsql_drv}
+%{?with_sqlite:sqlite3_drv}
+"
 %configure \
 %configure \
+       --disable-dependency-tracking \
        %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
        --enable-trusted-user-security \
        %{?debug: --enable-debug --enable-bnr-debug --enable-verbose-debug} \
        --enable-trusted-user-security \
-       --enable-chi-square \
-       --enable-bias \
        --enable-large-scale \
        --enable-large-scale \
-       --with-userdir=/var/lib/%{name} \
        --with-dspam-home=/var/lib/%{name} \
        --with-dspam-home=/var/lib/%{name} \
-       --with-userdir-owner=none \
-       --with-userdir-group=none \
+       --with-dspam-home-owner=none \
+       --with-dspam-home-group=none \
        --with-dspam-owner=none \
        --with-dspam-group=none \
        --with-dspam-owner=none \
        --with-dspam-group=none \
-       --with-signature-life=14 \
-       --disable-dependency-tracking \
-%if %{with mysql}
-       --enable-neural-networking \
-       --enable-daemon \
+       --with-logdir=/var/log/%{name} \
+       --enable-ldap \
+       --enable-clamav \
+       --enable-preferences-extension \
+       --enable-long-usernames \
        --enable-virtual-users \
        --enable-virtual-users \
-       --with-storage-driver=mysql_drv \
+       --with-storage-driver=$(echo $DRIVERS | tr ' ' ',') \
+%if %{with mysql}
        --with-mysql-includes=%{_includedir}/mysql \
        --with-mysql-includes=%{_includedir}/mysql \
-       --with-mysql-libraries=%{_libdir}
+       --with-mysql-libraries=%{_libdir} \
 %endif
 %if %{with pgsql}
 %endif
 %if %{with pgsql}
-       --enable-neural-networking \
-       --enable-daemon \
-       --enable-virtual-users \
-       --with-storage-driver=pgsql_drv \
        --with-pgsql-includes=%{_includedir}/postgresql \
        --with-pgsql-includes=%{_includedir}/postgresql \
-       --with-pgsql-libraries=%{_libdir}
+       --with-pgsql-libraries=%{_libdir} \
 %endif
 %endif
+%if 0
 %if %{with sqlite}
 %if %{with sqlite}
-       --with-storage-driver=sqlite3_drv \
-       --with-sqlite3-includes=%{_includedir} \
-       --with-sqlite3-libraries=%{_libdir}
+       --with-sqlite-includes=%{_includedir} \
+       --with-sqlite-libraries=%{_libdir} \
 %endif
 %endif
-%{__make}
+%endif
+       --enable-daemon
+
+# --enable-dclassify-extension needs libdclassify
+
+%{__make} -j1
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %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/usr/lib/tmpfiles.d
 
 
-%{__make} install \
+%{__make} -j1 install \
        DESTDIR=$RPM_BUILD_ROOT
 
        DESTDIR=$RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dspam
 
+cp -a txt/*.txt $RPM_BUILD_ROOT/var/lib/%{name}/txt
+
 # install devel files
 # install devel files
-install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/lib/%{name}}
+install -d $RPM_BUILD_ROOT{%{_includedir}/%{name},/var/{log,lib}/%{name}}
 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
 
 # provide maintenance scripts
 install src/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
 
 # provide maintenance scripts
-install -d $RPM_BUILD_ROOT/etc/cron.daily
-install -d $RPM_BUILD_ROOT/etc/cron.weekly
-
+install -d $RPM_BUILD_ROOT/etc/cron.{daily,weekly}
 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
 #!/bin/sh
 exec %{_bindir}/%{name}_clean -s -p
 cat > $RPM_BUILD_ROOT/etc/cron.daily/%{name} <<EOF
 #!/bin/sh
 exec %{_bindir}/%{name}_clean -s -p
@@ -237,16 +345,10 @@ EOF
 
 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
 
 
 chmod 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/%{name}
 
-# fix prefix
-sed -i -e "s|%{_prefix}/local|%{_prefix}|g" $RPM_BUILD_ROOT%{_bindir}/%{name}_corpus
-sed -i -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi
-
 # fix purge stuff
 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
 
 %if %{with mysql}
 # fix purge stuff
 #install dspam-cron.weekly $RPM_BUILD_ROOT%{_sysconfdir}/cron.weekly/%{name}
 
 %if %{with mysql}
-# fix missing file
-install -d $RPM_BUILD_ROOT/var/lib/%{name}
 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
 _UNCONFIGURED_
 
 cat > $RPM_BUILD_ROOT/var/lib/%{name}/mysql.data <<EOF
 _UNCONFIGURED_
 
@@ -263,8 +365,6 @@ EOF
 %endif
 
 %if %{with pgsql}
 %endif
 
 %if %{with pgsql}
-# fix missing file
-install -d $RPM_BUILD_ROOT/var/lib/%{name}
 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
 _UNCONFIGURED_
 
 cat > $RPM_BUILD_ROOT/var/lib/%{name}/pgsql.data <<EOF
 _UNCONFIGURED_
 
@@ -280,19 +380,23 @@ DATABASE
 EOF
 %endif
 
 EOF
 %endif
 
+install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
+install %{SOURCE2} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.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
 %post
 /sbin/chkconfig --add dspam
-if [ -f /var/lock/subsys/dspam ]; then
-       /etc/rc.d/init.d/dspam restart 1>&2
-else
-       echo "Run \"/etc/rc.d/init.d/dspam start\" to start dspam daemon."
-fi
+%service dspam restart "dspam daemon"
 
 %preun
 if [ "$1" = "0" ]; then
 
 %preun
 if [ "$1" = "0" ]; then
-       if [ -f /var/lock/subsys/dspam ]; then
-               /etc/rc.d/init.d/dspam stop 1>&2
-       fi
+       %service dspam stop
        /sbin/chkconfig --del dspam
 fi
 
        /sbin/chkconfig --del dspam
 fi
 
@@ -302,61 +406,123 @@ rm -rf $RPM_BUILD_ROOT
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
 %post  libs -p /sbin/ldconfig
 %postun        libs -p /sbin/ldconfig
 
+%post driver-hash
+%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libhash_drv.so,' /etc/dspam.conf
+
+%post driver-mysql
+%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libmysql_drv.so,' /etc/dspam.conf
+
+%post driver-pgsql
+%{__sed} -i -e '/^StorageDriver/s,/.*\.so,%{_libdir}/dspam/libpgsql_drv.so,' /etc/dspam.conf
+
+%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}
+
+%triggerun webui -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin webui -- apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun webui -- apache-base
+%webapp_unregister httpd %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc README CHANGELOG RELEASE.NOTES UPGRADING
 %files
 %defattr(644,root,root,755)
 %doc README CHANGELOG RELEASE.NOTES UPGRADING
-%doc cgi/base.css cgi/dspam.cgi
-%if %{with mysql}
-%doc doc/mysql_drv.txt
-%doc src/tools.mysql_drv/*.sql
-%endif
-%if %{with pgsql}
-%doc doc/pgsql_drv.txt
-%doc src/tools.pgsql_drv/*.sql
-%endif
-%if %{without mysql} && %{without pgsql}
-%doc doc/sqlite_drv.txt
-%endif
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
+%doc doc/{courier,exim,markov,pop3filter,postfix,qmail,relay,sendmail}.txt
+%doc scripts/train.pl
+/usr/lib/tmpfiles.d/%{name}.conf
+%dir %attr(775,root,mail) /var/run/dspam
 %dir %attr(750,root,mail) /var/lib/%{name}
 %dir %attr(750,root,mail) /var/lib/%{name}
-%{?with_mysql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/mysql.data}
-%{?with_pgsql:%attr(640,root,mail) %config(noreplace) /var/lib/%{name}/pgsql.data}
+%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
 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
 %attr(755,root,root) %config(noreplace) /etc/cron.daily/%{name}
-%attr(755,root,mail) %{_bindir}/%{name}
-%attr(755,root,mail) %{_bindir}/%{name}_logrotate
+%attr(755,root,root) %{_bindir}/%{name}
+%attr(755,root,root) %{_bindir}/%{name}_logrotate
 %attr(755,root,root) %{_bindir}/%{name}_clean
 %attr(755,root,root) %{_bindir}/%{name}_clean
-%attr(755,root,root) %{_bindir}/%{name}_corpus
 %attr(755,root,root) %{_bindir}/%{name}_crc
 %attr(755,root,root) %{_bindir}/%{name}_dump
 %attr(755,root,root) %{_bindir}/%{name}_crc
 %attr(755,root,root) %{_bindir}/%{name}_dump
-%attr(755,root,root) %{_bindir}/%{name}_genaliases
 %attr(755,root,root) %{_bindir}/%{name}_stats
 %attr(755,root,root) %{_bindir}/%{name}_merge
 %attr(755,root,root) %{_bindir}/%{name}_2sql
 %attr(755,root,root) %{_bindir}/%{name}_admin
 %attr(755,root,root) %{_bindir}/%{name}_stats
 %attr(755,root,root) %{_bindir}/%{name}_merge
 %attr(755,root,root) %{_bindir}/%{name}_2sql
 %attr(755,root,root) %{_bindir}/%{name}_admin
-%{?with_pgsql:%attr(755,root,root) %{_bindir}/%{name}_pg2int8}
+%attr(755,root,root) %{_bindir}/%{name}_train
 %{_mandir}/man?/%{name}*
 
 %{_mandir}/man?/%{name}*
 
-%if %{with daemon}
-%attr(754,root,root) /etc/rc.d/init.d/dspam
 %files client
 %defattr(644,root,root,755)
 %files client
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/%{name}c
+
+%files common
+%defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dspam.conf
-%endif
-%attr(755,root,mail) %{_bindir}/%{name}c
 
 %files libs
 %defattr(644,root,root,755)
 
 %files libs
 %defattr(644,root,root,755)
-%doc README CHANGELOG
-%attr(755,root,root) %{_libdir}/lib*.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)
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
+%attr(755,root,root) %{_libdir}/libdspam.so
+%{_libdir}/libdspam.la
 %{_includedir}/%{name}
 %{_includedir}/%{name}
-%{_mandir}/man3/libdspam*
-%{_pkgconfigdir}/*.pc
+%{_mandir}/man3/libdspam.3*
+%{_pkgconfigdir}/dspam.pc
 
 %files static
 %defattr(644,root,root,755)
 
 %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}/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}/dspam/libmysql_drv.so*
+%endif
+
+%if %{with pgsql}
+%files driver-pgsql
+%defattr(644,root,root,755)
+%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}/dspam/libpgsql_drv.so*
+%endif
+
+%if %{with sqlite}
+%files driver-sqlite3
+%defattr(644,root,root,755)
+%doc doc/sqlite_drv.txt
+%attr(755,root,root) %{_libdir}/dspam/libsqlite3_drv.so*
+%endif
+
+%files webui
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_webapps}/%{_webapp}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/htpasswd
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/admins
+%attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/default.prefs
+%config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/configure.pl
+
+%dir %{_datadir}/dspam
+%dir %{_datadir}/dspam/cgi
+%attr(755,root,root) %{_datadir}/dspam/cgi/*.cgi
+%{_datadir}/dspam/cgi/templates
+%{_datadir}/dspam/htdocs
This page took 0.13748 seconds and 4 git commands to generate.