Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > e76013765bd00d4f7756e20cbf39e984 > files > 5

dspam-3.4.3-1mdk.src.rpm

%define name	dspam
%define version	3.4.3

%define	major	6
%define libname	%mklibname %{name} %{major}
%define libnamedb4 %mklibname %{name}db4 %{major}
%define libnamemysql %mklibname %{name}mysql %{major}
%define libnamepgsql %mklibname %{name}pgsql %{major}
%define libnameamavis %mklibname %{name}amavis %{major}

%define dspam_binaries dspam_2sql dspam_admin dspam_clean dspam_corpus dspam_crc dspam_dump dspam_genaliases dspam_logrotate dspam_merge dspam_stats dspamc

Summary:	A library and Mail Delivery Agent for Bayesian spam filtering
Name:		%{name}
Version:	%{version}
Release:	%mkrel 1
License:	GPL
Group:		System/Servers
URL:		http://www.nuclearelephant.com/projects/dspam/
Source0:	http://dspam.nuclearelephant.com/sources/%{name}-%{version}.tar.bz2
Source1:	dspam_sa_trainer.tar.bz2
Source2:	dspam.cf.bz2
Source3:	dspam.cron.bz2
Source4:	dspam.sysconfig.bz2
Source5:	dspam.init.bz2
PreReq:		%{libname} = %{version}-%{release}
BuildRequires:	autoconf2.5
BuildRequires:	automake1.7
BuildRequires:	MySQL-devel
BuildRequires:	sqlite-devel
BuildRequires:	db4-devel
BuildRequires:	postgresql-devel
Buildroot:	%{_tmppath}/%{name}-%{version}-root

%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
server-side agent for UNIX email servers and a developer's library
for mail clients, other anti-spam tools, and similar projects
requiring drop-in spam filtering.

The DSPAM agent masquerades as the email server's local delivery
agent and filters/learns spams using an advanced Bayesian
statistical approach (based on Baye's theorem of combined
probabilities) which provides an administratively
maintenance-free, easy-learning Anti-Spam service custom tailored
to each individual user's behavior. Advanced because on top of
standard Bayesian filtering is also incorporated the use of
Chained Tokens, de-obfuscation, and other enhancements. DSPAM
works great with Sendmail and Exim, and should work well with
any other MTA that supports an external local delivery agent
(postfix, qmail, etc.)

%package -n	%{libname}
Summary:	A library and Mail Delivery Agent for Bayesian spam filtering
Group:         	System/Libraries

%description -n	%{libname}
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
server-side agent for UNIX email servers and a developer's library
for mail clients, other anti-spam tools, and similar projects
requiring drop-in spam filtering.

The DSPAM agent masquerades as the email server's local delivery
agent and filters/learns spams using an advanced Bayesian
statistical approach (based on Baye's theorem of combined
probabilities) which provides an administratively
maintenance-free, easy-learning Anti-Spam service custom tailored
to each individual user's behavior. Advanced because on top of
standard Bayesian filtering is also incorporated the use of
Chained Tokens, de-obfuscation, and other enhancements. DSPAM
works great with Sendmail and Exim, and should work well with
any other MTA that supports an external local delivery agent
(postfix, qmail, etc.)

%package -n	%{libname}-devel
Summary:	Development library and header files for the %{name} library
Group:		Development/C
Requires:	%{libname} = %{version}
Provides:	%{name}-devel lib%{name}-devel
Obsoletes:	%{name}-devel lib%{name}-devel
Obsoletes:	libdspam5-devel

%description -n	%{libname}-devel
DSPAM has had its core engine moved into a separate library,
libdspam. 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. 

%package -n	%{libnamedb4}
Summary:	Shared library for dspam using the db4 driver
Group:         	System/Libraries

%description -n	%{libnamedb4}
Shared library for dspam using the db4 driver

%package -n	%{libnamemysql}
Summary:	Shared library for dspam using the mysql driver
Group:         	System/Libraries

%description -n	%{libnamemysql}
Shared library for dspam using the mysql driver

%package -n	%{libnamepgsql}
Summary:	Shared library for dspam using the pgsql driver
Group:         	System/Libraries

%description -n	%{libnamepgsql}
Shared library for dspam using the pgsql driver

%package -n	%{libnameamavis}
Summary:	Shared library for dspam using the sqlite driver tailored for amavis-new
Group:         	System/Libraries

%description -n	%{libnameamavis}
Shared library for dspam using the sqlite driver tailored for amavis-new

%package	db4
Summary:	Binaries for dspam using the db4 driver
Group:		System/Servers
PreReq:		%{libnamedb4} = %{version}
Requires:	%{name} = %{version}

%description	db4
Binaries for dspam using the db4 driver

%package	mysql
Summary:	Binaries for dspam using the mysql driver
Group:		System/Servers
Prereq:		rpm-helper
PreReq:		%{libnamemysql} = %{version}
Requires:	%{name} = %{version}

%description	mysql
Binaries for dspam using the mysql driver

%package	pgsql
Summary:	Binaries for dspam using the pgsql driver
Group:		System/Servers
Prereq:		rpm-helper
PreReq:		%{libnamepgsql} = %{version}
Requires:	%{name} = %{version}

%description	pgsql
Binaries for dspam using the pgsql driver

%package	amavis
Summary:	Binaries for dspam using the sqlite driver tailored for amavis-new
Group:		System/Servers
PreReq:		%{libnameamavis} = %{version}
Requires:	%{name} = %{version}
PreReq:		amavisd-new

%description	amavis
Binaries for dspam using the sqlite driver tailored for amavis-new

%package	cgi
Summary:	Web administration GUI for DSPAM
Group:		System/Servers
Requires:	apache2
Requires:	%{name} = %{version}

%description	cgi
Web administration GUI for DSPAM.

%prep

%setup -q -n %{name}-%{version} -a1

# instead of maintaining patches...
find -type f -name "Makefile*" | xargs perl -pi -e "s|-static||g"
find -type f | xargs perl -pi -e "s|libpq-fe.h|pgsql/libpq-fe.h|g"

bzcat %{SOURCE2} > dspam.cf

bzcat %{SOURCE3} > dspam.cron
bzcat %{SOURCE4} > dspam.sysconfig
bzcat %{SOURCE5} > dspam.init

%build
#sh ./autogen.sh
export WANT_AUTOCONF_2_5=1
libtoolize --copy --force; aclocal-1.7 -I m4; autoheader; automake-1.7 --add-missing; autoconf

COMMON="--cache-file=$PWD/config.cache \
    --enable-shared --enable-static \
    --enable-trusted-user-security \
    --enable-bayesian-dobly \
    --enable-chained-tokens \
    --enable-bias \
    --enable-domain-scale \
    --enable-delivery-to-stdout \
    --enable-virtual-users \
    --with-dspam-home=%{_localstatedir}/dspam \
    --with-userdir-owner=none \
    --with-userdir-group=none \
    --with-dspam-owner=none \
    --with-dspam-group=none \
    --with-signature-life=14 \
    --disable-dependency-tracking \
    --enable-virtual-users \
    --with-logdir=%{_var}/log/dspam \
    --enable-debug \
    --enable-verbose-debug \
    --enable-bnr-debug"

################################################################################
################################################################################
mkdir -p build-sqlite; pushd build-sqlite
ln -s ../configure .
%configure2_5x $COMMON \
    --program-suffix="-sqlite" \
    --with-storage-driver=sqlite_drv \
    --with-sqlite-includes=%{_includedir} \
    --with-sqlite-libraries=%{_libdir}
%make
popd


################################################################################
################################################################################
mkdir -p build-sqlite-amavis; pushd build-sqlite-amavis
ln -s ../configure .
%configure2_5x \
    --program-suffix="-amavis" \
    --with-storage-driver=sqlite_drv \
    --with-sqlite-includes=%{_includedir} \
    --with-sqlite-libraries=%{_libdir} \
    --with-dspam-home=%{_localstatedir}/amavis/dspam \
    --enable-signature-headers \
    --without-delivery-agent \
    --without-quarantine-agent \
    --enable-experimental \
    --enable-domain-scale \
    --with-logdir=%{_var}/log/dspam
find -type f -name "Makefile" | xargs perl -pi -e "s|libdspam\.la|libdspamamavis\.la|g"
find -type f -name "Makefile" | xargs perl -pi -e "s|\/dspam\.conf\\\|\/dspam-amavis\.conf\\\|g"
%make EXEEXT="-amavis"
popd

################################################################################
################################################################################
mkdir -p build-db4; pushd build-db4
ln -s ../configure .
%configure2_5x $COMMON \
    --program-suffix="-db4" \
    --with-storage-driver=libdb4_drv \
    --with-db4-includes=%{_includedir} \
    --with-db4-libraries=%{_libdir}
find -type f -name "Makefile" | xargs perl -pi -e "s|libdspam\.la|libdspamdb4\.la|g"
find -type f -name "Makefile" | xargs perl -pi -e "s|\/dspam\.conf\\\|\/dspam-db4\.conf\\\|g"
%make EXEEXT="-db4"
popd

################################################################################
################################################################################
mkdir -p build-mysql; pushd build-mysql
ln -s ../configure .
%configure2_5x $COMMON \
    --enable-daemon \
    --enable-neural-networking \
    --program-suffix="-mysql" \
    --with-storage-driver=mysql_drv \
    --with-mysql-includes=%{_includedir}/mysql \
    --with-mysql-libraries=%{_libdir}
find -type f -name "Makefile" | xargs perl -pi -e "s|libdspam\.la|libdspammysql\.la|g"
find -type f -name "Makefile" | xargs perl -pi -e "s|\/dspam\.conf\\\|\/dspam-mysql\.conf\\\|g"
%make EXEEXT="-mysql"
popd

################################################################################
################################################################################
mkdir -p build-pgsql; pushd build-pgsql
ln -s ../configure .
%configure2_5x $COMMON \
    --enable-daemon \
    --enable-neural-networking \
    --program-suffix="-pgsql" \
    --with-storage-driver=pgsql_drv \
    --with-pgsql-includes=%{_includedir}/pgsql \
    --with-pgsql-libraries=%{_libdir}
find -type f -name "Makefile" | xargs perl -pi -e "s|libdspam\.la|libdspampgsql\.la|g"
find -type f -name "Makefile" | xargs perl -pi -e "s|\/dspam\.conf\\\|\/dspam-pgsql\.conf\\\|g"
%make EXEEXT="-pgsql"
popd

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} 

# make some dirs
install -d %{buildroot}%{_includedir}/dspam
install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/mail/spamassassin
install -d %{buildroot}%{_sysconfdir}/cron.daily
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sysconfdir}/httpd/webapps.d
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_localstatedir}/dspam
install -d %{buildroot}%{_localstatedir}/amavis/dspam
install -d %{buildroot}%{_var}/log/dspam
install -d %{buildroot}%{_var}/www/icons
install -d %{buildroot}%{_datadir}/dspam/cgi-bin/templates
install -d %{buildroot}%{_datadir}/dspam-amavis
install -d %{buildroot}%{_datadir}/dspam-mysql
install -d %{buildroot}%{_datadir}/dspam-pgsql

%makeinstall_std -C build-db4
%makeinstall_std -C build-mysql
%makeinstall_std -C build-pgsql
%makeinstall_std -C build-sqlite-amavis

# cleanup
rm -rf %{buildroot}%{_mandir}
rm -f %{buildroot}%{_libdir}/*.a
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/*.so

%makeinstall_std -C build-sqlite

# install promo icon
install -m0644 src/dspam-button.gif %{buildroot}%{_var}/www/icons/dspam.gif

install -m0755 dspam.cron %{buildroot}%{_sysconfdir}/cron.daily/dspam
install -m0644 dspam.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/dspam
install -m0755 dspam.init %{buildroot}%{_initrddir}/dspam-mysql
install -m0755 dspam.init %{buildroot}%{_initrddir}/dspam-pgsql
perl -pi -e "s|_DSPAM_|dspam-mysql|g" %{buildroot}%{_initrddir}/dspam-mysql
perl -pi -e "s|_DSPAM_|dspam-pgsql|g" %{buildroot}%{_initrddir}/dspam-pgsql

# fix prefix
perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" %{buildroot}%{_bindir}/dspam_corpus*
perl -pi -e "s|%{_prefix}/local|%{_prefix}|g" cgi/dspam.cgi

# install config files
install -m0644 build-db4/src/dspam.conf %{buildroot}%{_sysconfdir}/dspam-db4.conf
install -m0644 build-mysql/src/dspam.conf %{buildroot}%{_sysconfdir}/dspam-mysql.conf
install -m0644 build-pgsql/src/dspam.conf %{buildroot}%{_sysconfdir}/dspam-pgsql.conf
install -m0644 build-sqlite-amavis/src/dspam.conf %{buildroot}%{_sysconfdir}/dspam-amavis.conf

# install sql stuff
install -m0644 src/tools.sqlite_drv/*.sql %{buildroot}%{_datadir}/dspam/
install -m0644 src/tools.sqlite_drv/*.sql %{buildroot}%{_datadir}/dspam-amavis/
install -m0644 src/tools.mysql_drv/*.sql %{buildroot}%{_datadir}/dspam-mysql/
install -m0644 src/tools.pgsql_drv/*.sql %{buildroot}%{_datadir}/dspam-pgsql/
install -m0644 doc/sqlite_drv.txt %{buildroot}%{_datadir}/dspam/
install -m0644 doc/sqlite_drv.txt %{buildroot}%{_datadir}/dspam-amavis/
install -m0644 doc/mysql_drv.txt %{buildroot}%{_datadir}/dspam-mysql/
install -m0644 doc/pgsql_drv.txt %{buildroot}%{_datadir}/dspam-pgsql/

# install the cgi stuff
install -m0755 cgi/*.cgi %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0755 build-sqlite/cgi/configure.pl %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/*.txt %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/*.gif %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/default.prefs %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/admins %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/*.css %{buildroot}%{_datadir}/dspam/cgi-bin/
install -m0644 cgi/templates/*.html %{buildroot}%{_datadir}/dspam/cgi-bin/templates/

cat > dspam.apache2 << EOF
Alias /dspam %{_datadir}/dspam/cgi-bin

<Directory %{_datadir}/dspam/cgi-bin/>

    Options ExecCGI
    AllowOverride Limit AuthConfig
    DirectoryIndex dspam.cgi

    <IfModule mod_access.c>
	Order deny,allow
	Deny from all
	allow from 127.0.0.1
    </IfModule>

    AuthUserFile %{_datadir}/dspam/cgi-bin/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Authorization required"
    AuthType Basic

    <Limit GET>
	require user root
	require user dspamadmin
    </Limit>

</Directory>
EOF
install -m0644 dspam.apache2 %{buildroot}%{_sysconfdir}/httpd/webapps.d/dspam.conf
echo "dspamadmin:h7Sr5nPztyPjU" > %{buildroot}%{_datadir}/dspam/cgi-bin/.htpasswd
echo "dspamadmin" >> %{buildroot}%{_datadir}/dspam/cgi-bin/admins

cat > dspam.logrotate << EOF
%{_var}/log/dspam/*.log {
    missingok
    monthly
    compress
    postrotate
	[ -e %{_var}/lock/subsys/dspam-mysql -a -e %{_var}/lock/subsys/dspam-pgsql ] && /bin/kill -HUP `cat %{_var}/run/dspam/dspam.pid 2> /dev/null ` || /bin/true
    endscript
}
EOF
install -m0644 dspam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/dspam

# fix strange perms (strip cannot access setuid/sgid files...)
chmod 755 %{buildroot}%{_bindir}/*

# install spamassassin stuff
install -m0644 dspam.cf %{buildroot}%{_sysconfdir}/mail/spamassassin

# fix default config (patches won't apply here...)
perl -pi -e "s|^#ServerDomainSocketPath.*|ServerDomainSocketPath \"%{_localstatedir}/dspam/dspam.sock\"|g" %{buildroot}%{_sysconfdir}/dspam-*.conf
perl -pi -e "s|^ServerDomainSocketPath.*|ServerDomainSocketPath \"%{_localstatedir}/amavis/dspam/dspam.sock\"|g" %{buildroot}%{_sysconfdir}/dspam-amavis.conf
perl -pi -e "s|^#ClientHost.*|ClientHost \"%{_localstatedir}/dspam/dspam.sock\"|g" %{buildroot}%{_sysconfdir}/dspam-*.conf
perl -pi -e "s|^ClientHost.*|ClientHost \"%{_localstatedir}/amavis/dspam/dspam.sock\"|g" %{buildroot}%{_sysconfdir}/dspam-amavis.conf
perl -pi -e "s|^#ServerPID.*|ServerPID \"%{_var}/run/dspam/dspam.pid\"|g" %{buildroot}%{_sysconfdir}/dspam-*.conf
perl -pi -e "s|^#ServerMode.*|ServerMode dspam|g" %{buildroot}%{_sysconfdir}/dspam-*.conf

# fix man pages
mv %{buildroot}%{_mandir}/man1/dspam_dump-sqlite.1 %{buildroot}%{_mandir}/man1/dspam_dump.1 
mv %{buildroot}%{_mandir}/man1/dspam_corpus-sqlite.1 %{buildroot}%{_mandir}/man1/dspam_corpus.1
mv %{buildroot}%{_mandir}/man1/dspam_merge-sqlite.1 %{buildroot}%{_mandir}/man1/dspam_merge.1
mv %{buildroot}%{_mandir}/man1/dspam-sqlite.1 %{buildroot}%{_mandir}/man1/dspam.1
mv %{buildroot}%{_mandir}/man1/dspam_clean-sqlite.1 %{buildroot}%{_mandir}/man1/dspam_clean.1
mv %{buildroot}%{_mandir}/man1/dspam_stats-sqlite.1 %{buildroot}%{_mandir}/man1/dspam_stats.1
mv %{buildroot}%{_mandir}/man3/libdspam-sqlite.3 %{buildroot}%{_mandir}/man3/libdspam.3

# fix strange perms
chmod 644 doc/*

# provide a  README.urpmi file
cat > README.urpmi << EOF
You will have to define a proper cron command to use for daily cleanups. Look
in the %{_sysconfdir}/sysconfig/dspam file for some examples.

For example when executing dspam with the mysql driver it is possible it will
complain that it cannot find a %{_localstatedir}/dspam/mysql.data file. This
is for backward compatibility. Do not use this file, edit the %{_sysconfdir}/dspam-mysql.conf
file instead.

In theory it is possible to have all the dspam binaries installed at the same
time and for example run both dspam-mysql and dspam-pgsql daemonized, but it
is not heavily tested and is not recommended.

Each of the dspam-* packages (except dspam-cgi) uses a named suffix and uses its
own config file. As an example dspam-mysql will utilize the %{_sysconfdir}/dspam-mysql.conf
config file only.

The dspam-cgi web interface is password protected and only accessable from 127.0.0.1,
login as dspamadmin (l/p=dspamadmin) and change this ASAP in the 
%{_datadir}/dspam/cgi-bin/.htpasswd file. Preferably you should use some other
authentication mechanish.
EOF

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%post -n %{libnamedb4} -p /sbin/ldconfig

%postun -n %{libnamedb4} -p /sbin/ldconfig

%post -n %{libnamemysql} -p /sbin/ldconfig

%postun -n %{libnamemysql} -p /sbin/ldconfig

%post -n %{libnamepgsql} -p /sbin/ldconfig

%postun -n %{libnamepgsql} -p /sbin/ldconfig

%post -n %{libnameamavis} -p /sbin/ldconfig

%postun -n %{libnameamavis} -p /sbin/ldconfig

%post
update-alternatives --install %{_bindir}/dspam dspam %{_bindir}/dspam-sqlite 10 \
`for prog in %{dspam_binaries}; do echo "--slave %{_bindir}/${prog} ${prog} %{_bindir}/${prog}-sqlite"; done`
update-alternatives --auto dspam

%postun
if [ "$1" = "0" ]; then
    update-alternatives --remove dspam %{_bindir}/dspam
fi

%post amavis
update-alternatives --install %{_bindir}/dspam dspam %{_bindir}/dspam-amavis 11 \
`for prog in %{dspam_binaries}; do echo "--slave %{_bindir}/${prog} ${prog} %{_bindir}/${prog}-amavis"; done`

%postun amavis
if [ "$1" = "0" ]; then
    update-alternatives --remove dspam %{_bindir}/dspam-amavis
fi

%post mysql
update-alternatives --install %{_bindir}/dspam dspam %{_bindir}/dspam-mysql 12 \
`for prog in %{dspam_binaries}; do echo "--slave %{_bindir}/${prog} ${prog} %{_bindir}/${prog}-mysql"; done`
%_post_service %{name}-mysql

%postun mysql
if [ "$1" = "0" ]; then
    update-alternatives --remove dspam %{_bindir}/dspam-mysql
fi

%preun mysql
%_preun_service %{name}-mysql

%post pgsql
update-alternatives --install %{_bindir}/dspam dspam %{_bindir}/dspam-pgsql 13 \
`for prog in %{dspam_binaries}; do echo "--slave %{_bindir}/${prog} ${prog} %{_bindir}/${prog}-pgsql"; done`
%_post_service %{name}-pgsql

%postun pgsql
if [ "$1" = "0" ]; then
    update-alternatives --remove dspam %{_bindir}/dspam-pgsql
fi

%preun pgsql
%_preun_service %{name}-pgsql

%post db4
update-alternatives --install %{_bindir}/dspam dspam %{_bindir}/dspam-db4 14 \
`for prog in %{dspam_binaries}; do echo "--slave %{_bindir}/${prog} ${prog} %{_bindir}/${prog}-db4"; done`

%postun db4
if [ "$1" = "0" ]; then
    update-alternatives --remove dspam %{_bindir}/dspam-db4
fi

%post cgi
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi
 
%postun cgi
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} 

%files
%defattr(-,root,root)
%doc README* RELEASE.NOTES CHANGELOG txt/*.txt dspam_sa_trainer
%doc doc/courier.txt doc/exim.txt doc/pop3filter.txt doc/postfix.txt doc/qmail.txt
%doc doc/sendmail.txt
%dir %attr(0750,root,mail) %{_localstatedir}/dspam
%dir %attr(0750,root,mail) %{_var}/log/dspam
%dir %attr(0755,root,root) %{_datadir}/dspam
%attr(0755,root,root) %{_sysconfdir}/cron.daily/dspam
%attr(0644,root,mail) %config(noreplace) %{_sysconfdir}/dspam.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dspam
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/dspam
%attr(0755,root,mail) %{_bindir}/dspam_admin-sqlite
%attr(0755,root,mail) %{_bindir}/dspam-sqlite
%attr(0755,root,root) %{_bindir}/dspam_2sql-sqlite
%attr(0755,root,root) %{_bindir}/dspam_clean-sqlite
%attr(0755,root,root) %{_bindir}/dspam_corpus-sqlite
%attr(0755,root,root) %{_bindir}/dspam_crc-sqlite
%attr(0755,root,root) %{_bindir}/dspamc-sqlite
%attr(0755,root,root) %{_bindir}/dspam_dump-sqlite
%attr(0755,root,root) %{_bindir}/dspam_genaliases-sqlite
%attr(0755,root,root) %{_bindir}/dspam_logrotate-sqlite
%attr(0755,root,root) %{_bindir}/dspam_merge-sqlite
%attr(0755,root,root) %{_bindir}/dspam_stats-sqlite
%attr(0644,root,root) %{_datadir}/dspam/*.sql
%attr(0644,root,root) %{_datadir}/dspam/sqlite_drv.txt
%attr(0644,root,root) %{_var}/www/icons/dspam.gif
%attr(0644,root,root) %{_mandir}/man1/dspam.1*
%attr(0644,root,root) %{_mandir}/man1/dspam_clean.1*
%attr(0644,root,root) %{_mandir}/man1/dspam_corpus.1*
%attr(0644,root,root) %{_mandir}/man1/dspam_dump.1*
%attr(0644,root,root) %{_mandir}/man1/dspam_merge.1*
%attr(0644,root,root) %{_mandir}/man1/dspam_stats.1*

%files -n %{libname}
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspam.so.*

%files -n %{libname}-devel
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspam.so
%attr(0644,root,root) %{_libdir}/libdspam.la
%attr(0755,root,root) %{_libdir}/libdspam.a
%{_includedir}/dspam
%attr(0644,root,root) %{_libdir}/pkgconfig/dspam.pc
%attr(0644,root,root) %{_mandir}/man3/*

%files -n %{libnamedb4}
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspamdb4.so.*

%files -n %{libnamemysql}
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspammysql.so.*

%files -n %{libnamepgsql}
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspampgsql.so.*

%files -n %{libnameamavis}
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libdspamamavis.so.*

%files db4
%defattr(-,root,root)
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/dspam-db4.conf
%attr(0755,root,mail) %{_bindir}/dspam*-db4

%files mysql
%defattr(-,root,root)
%attr(0755,root,root) %{_initrddir}/dspam-mysql
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/dspam-mysql.conf
%attr(0755,root,mail) %{_bindir}/dspam*-mysql
%dir %attr(0755,root,root) %{_datadir}/dspam-mysql
%attr(0644,root,root) %{_datadir}/dspam-mysql/*

%files pgsql
%defattr(-,root,root)
%attr(0755,root,root) %{_initrddir}/dspam-pgsql
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/dspam-pgsql.conf
%attr(0755,root,mail) %{_bindir}/dspam*-pgsql
%dir %attr(0755,root,root) %{_datadir}/dspam-pgsql
%attr(0644,root,root) %{_datadir}/dspam-pgsql/*

%files amavis
%defattr(-,root,root)
%attr(0644,amavis,amavis) %config(noreplace) %{_sysconfdir}/dspam-amavis.conf
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/mail/spamassassin/dspam.cf
%attr(0755,root,amavis) %{_bindir}/dspam*-amavis
%dir %attr(0755,root,root) %{_datadir}/dspam-amavis
%attr(0644,root,root) %{_datadir}/dspam-amavis/*
%dir %attr(0750,amavis,amavis) %{_localstatedir}/amavis/dspam

%files cgi
%defattr(-,root,root)
%dir %attr(0755,root,root) %{_datadir}/dspam/cgi-bin
%dir %attr(0755,root,root) %{_datadir}/dspam/cgi-bin/templates
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/webapps.d/dspam.conf
%attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/default.prefs
%attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/admins
%attr(0644,root,root) %config(noreplace) %{_datadir}/dspam/cgi-bin/.htpasswd
%attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.txt
%attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.gif
%attr(0644,root,root) %{_datadir}/dspam/cgi-bin/*.css
%attr(0755,root,root) %{_datadir}/dspam/cgi-bin/*.cgi
%attr(0755,root,root) %{_datadir}/dspam/cgi-bin/*.pl
%attr(0644,root,root) %{_datadir}/dspam/cgi-bin/templates/*.html

%changelog
* Tue Apr 12 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.4.3-1mdk
- 3.4.3

* Wed Mar 30 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.4.2-1mdk
- 3.4.2

* Tue Mar 15 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.4.0-2mdk
- fix a bug in the update-alternatives stuff

* Tue Mar 15 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.4.0-1mdk
- 3.4.0
- fix the update-alternatives stuff, great thanks goes to Guillaume
  Rousse for explaining the update-alternatives.
- major spec file and overall changes
- added the cgi stuff as a sub package

* Sat Mar 12 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.7-2mdk
- fix #14010 and #12399 
- own directories
- use the %%mkrel macro

* Sat Feb 19 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.7-1mdk
- 3.2.7

* Mon Jan 24 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.5-2mdk
- rebuilt against MySQL-4.1.x system libs

* Wed Jan 19 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.5-1mdk
- 3.2.5

* Mon Jan 03 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.4-1mdk
- 3.2.4
- revert latest "lib64 fixes"

* Tue Dec 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.3-4mdk
- lib64 fixes

* Thu Dec 23 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.3-3mdk
- fix deps

* Thu Dec 23 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.3-2mdk
- provide binaries with different drivers
- added amavis-new + spamassassin integrations after ideas by Giuseppe Ghibo

* Mon Nov 29 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.3-1mdk
- 3.2.3

* Mon Nov 15 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.2-1mdk
- 3.2.2

* Mon Nov 01 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.1-1mdk
- 3.2.1
- drop P1, it's fixed upstream

* Sat Oct 30 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.0-2mdk
- make it compile on 9.2/10.0
- make the devel package obsolete the older one

* Sat Oct 23 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.2.0-1mdk
- 3.2.0
- fix P0
- new %%{major} (again!)
- misc spec file fixes
- drop the weekly purge script

* Thu Jun 17 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.0.0-1mdk
- 3.0.0
- fix P0
- new %%{major} (again!)
- use domain-scale instead
- two more binaries is gone

* Fri Apr 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.10.3-1mdk
- 2.10.3

* Sun Mar 07 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.10-0.2mdk
- 2.10-RC2

* Sun Feb 29 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.10-0.1mdk
- 2.10-RC1
- misc spec file fixes

* Tue Feb 10 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.9.6-1mdk
- 2.9.6

* Sun Jan 25 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.8.3-1mdk
- 2.8.3

* Sun Nov 30 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.8-2mdk
- fix some forgotten stuff and added S1

* Fri Nov 28 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.8-1mdk
- 2.8
- fix P0
- new %%{major}

* Sun Nov 09 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.6.10-1mdk
- 2.7.6.10

* Mon Oct 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.6.8-1mdk
- 2.7.6.8

* Fri Oct 17 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.6.4-1mdk
- 2.7.6.4
- fix P0

* Tue Oct 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.6-2mdk
- use --enable-virtual-users

* Sun Oct 12 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.6-1mdk
- 2.7.6
- new P0

* Fri Oct 03 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.4-1mdk
- use the mysql driver

* Wed Oct 01 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.3-1mdk
- 2.7.3

* Fri Sep 26 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.2-1mdk
- 2.7.2

* Wed Sep 24 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.1-1mdk
- 2.7.1
- drop P1, it's in there

* Fri Sep 19 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.7.0-1mdk
- 2.7.0
- fix P0
- 2 binaries is no more, may re-appear?
- 1 new binary

* Sun Sep 07 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5.2-2mdk
- fix major
- fix requires and buildrequires

* Sun Sep 07 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5.2-1mdk
- dspam-2.6.5.2

* Tue Sep 02 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-1mdk
- dspam-2.6.5

* Sun Aug 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-0.5mdk
- dspam-2.6.5-rc1

* Wed Aug 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-0.4mdk
- dspam-2.6.5-beta-2

* Mon Aug 25 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-0.3mdk
- dspam-2.6.5-beta-1

* Thu Aug 21 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-0.2mdk
- dspam-2.6.5-alpha-3

* Sun Aug 17 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.5-0.1mdk
- dspam-2.6.5-alpha-2

* Tue Aug 12 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.4-1mdk
- 2.6.4
- misc spec file fixes

* Fri Aug 01 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.3-1mdk
- 2.6.3

* Tue Jul 29 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6.2.02-1mdk
- 2.6.2.02

* Tue Jul 15 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.6-1mdk
- initial cooker contrib
- added P0