Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release-src > by-pkgid > 511f17663c7355f90843a7b5ccace3d8 > files > 7

dspam-3.10.2-7.mga6.src.rpm

%define _disable_ld_no_undefined 1

%define	major 7
%define libname %mklibname dspam %{major}
%define develname %mklibname dspam -d

Summary:	A library and Mail Delivery Agent for Bayesian spam filtering
Name:		dspam
Version:	3.10.2
Release:	%mkrel 7
License:	GPL
Group:		System/Servers
URL:		http://dspam.nuclearelephant.com/
Source0:	http://dspam.nuclearelephant.com/sources/%{name}-%{version}.tar.gz
Source1:	dspam_sa_trainer.tar.bz2
Source2:	dspam.cf
Source3:	dspam.cron
Source4:	dspam.sysconfig
Source5:	dspam.cgi.wrapper.c
Source8:        dspam-systemd
Patch0:		dspam-modules.diff
Requires(post):  systemd >= %{systemd_required_version}
Requires(post):  rpm-helper >= 0.24.8-1
Requires(preun): rpm-helper >= 0.24.8-1
Requires:	clamav clamd
BuildRequires:	mysql-devel
BuildRequires:	sqlite3-devel
BuildRequires:	postgresql-devel
BuildRequires:	openldap-devel

%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
Conflicts:	%{mklibname dspam 5}
Conflicts:	%{mklibname dspam 6}
Conflicts:	%{mklibname dspamdb4 6}
Conflicts:	%{mklibname dspamamavis 6}

%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	%{develname}
Summary:	Development library and header files for the %{name} library
Group:		Development/C
Requires:	%{libname} = %{version}
Provides:	%{name}-devel lib%{name}-devel
Obsoletes:	%{mklibname dspam 5 -d}
Obsoletes:	%{mklibname dspam 6 -d}
Obsoletes:	%{mklibname dspam 7 -d}

%description -n	%{develname}
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	backend-mysql
Summary:	The mysql driver for dspam
Group:		System/Servers
Requires:	%{name} = %{version}
Obsoletes:	dspam-mysql
Obsoletes:	%{mklibname dspammysql 6}

%description	backend-mysql
The mysql driver for dspam

%package	backend-pgsql
Summary:	The pgsql driver for dspam
Group:		System/Servers
Requires:	%{name} = %{version}
Obsoletes:	dspam-pgsql
Obsoletes:	%{mklibname dspampgsql 6}

%description	backend-pgsql
The pgsql driver for dspam

%package	backend-sqlite3
Summary:	The sqlite3 driver for dspam
Group:		System/Servers
Requires:	%{name} = %{version}

%description	backend-sqlite3
The sqlite3 driver for dspam

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

%description	cgi
Web administration GUI for DSPAM.

%prep
%setup -q 
%patch0 -p1

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

cp %{SOURCE2} dspam.cf
cp %{SOURCE3} dspam.cron
cp %{SOURCE4} dspam.sysconfig

%build
autoreconf -fi

%configure2_5x \
    --enable-daemon \
    --enable-syslog \
    --enable-debug \
    --enable-trusted-user-security \
    --enable-clamav \
    --enable-long-usernames \
    --enable-virtual-users \
    --enable-preferences-extension \
    --enable-domain-scale \
    --with-dspam-home=%{_localstatedir}/lib/dspam \
    --with-dspam-owner=dspam \
    --with-dspam-group=mail \
    --with-dspam-home-group=mail \
    --with-logdir=/var/log/dspam \
    --with-storage-driver=hash_drv,mysql_drv,pgsql_drv,sqlite3_drv \
    --with-mysql-includes=%{_includedir}/mysql --with-mysql-libraries=%{_libdir} \
    --with-pgsql-includes=%{_includedir} --with-pgsql-libraries=%{_libdir} \
    --with-sqlite-includes=%{_includedir} --with-sqlite-libraries=%{_libdir}

%install
# make some dirs
install -d %{buildroot}%{_includedir}/dspam
install -d %{buildroot}%{_sysconfdir}/mail/spamassassin
install -d %{buildroot}%{_sysconfdir}/cron.daily
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
install -d %{buildroot}%{_libdir}/dspam
install -d %{buildroot}%{_localstatedir}/lib/dspam/data
install -d %{buildroot}/var/log/dspam

%makeinstall_std

# install /etc stuff
install -m0755 dspam.cron %{buildroot}%{_sysconfdir}/cron.daily/dspam
install -m0644 dspam.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/dspam

# install systemd script
%{__install} -Dp -m0644 %{SOURCE8} $RPM_BUILD_ROOT%{_unitdir}/dspam.service

# nuke unwanted devel files
rm -f %{buildroot}%{_libdir}/dspam/lib*_drv.*a

# templates
install -d -m 755 %{buildroot}%{_localstatedir}/lib/dspam/txt
install -m 644 txt/*.txt %{buildroot}%{_localstatedir}/lib/dspam/txt

# install sql stuff
install -d -m 755 %{buildroot}%{_datadir}/dspam/sql/sqlite3
install -m0644 src/tools.sqlite_drv/*.sql %{buildroot}%{_datadir}/dspam/sql/sqlite3

install -d -m 755 %{buildroot}%{_datadir}/dspam/sql/mysql
install -m0644 src/tools.mysql_drv/*.sql %{buildroot}%{_datadir}/dspam/sql/mysql

install -d -m 755 %{buildroot}%{_datadir}/dspam/sql/pgsql
install -m0644 src/tools.pgsql_drv/*.sql %{buildroot}%{_datadir}/dspam/sql/pgsql

# install the cgi stuff
install -d -m 755 %{buildroot}%{_libdir}/dspam/webui
install -d -m 755 %{buildroot}%{_libdir}/dspam/webui/www
install -m 644 webui/htdocs/*.css %{buildroot}%{_libdir}/dspam/webui/www
install -m 644 webui/htdocs/*.js %{buildroot}%{_libdir}/dspam/webui/www
install -m 644 webui/htdocs/*.ico %{buildroot}%{_libdir}/dspam/webui/www
install -m 644 webui/htdocs/*.gif %{buildroot}%{_libdir}/dspam/webui/www
install -m 755 webui/cgi-bin/htmlize.pl %{buildroot}%{_libdir}/dspam/webui/www
install -m 644 webui/cgi-bin/rgb.txt %{buildroot}%{_libdir}/dspam/webui/www

# original cgi
install -m 755 webui/cgi-bin/admin.cgi %{buildroot}%{_libdir}/dspam/webui/www/admin.pl
install -m 755 webui/cgi-bin/dspam.cgi %{buildroot}%{_libdir}/dspam/webui/www/dspam.pl
install -m 755 webui/cgi-bin/graph.cgi %{buildroot}%{_libdir}/dspam/webui/www/graph.pl
install -m 755 webui/cgi-bin/admingraph.cgi %{buildroot}%{_libdir}/dspam/webui/www/admingraph.pl

# wrappers
gcc %{optflags} %{SOURCE5} -DORIGINAL=\"dspam.pl\" \
    -o %{buildroot}%{_libdir}/dspam/webui/www/dspam.cgi
gcc %{optflags} %{SOURCE5} -DORIGINAL=\"admin.pl\" \
    -o %{buildroot}%{_libdir}/dspam/webui/www/admin.cgi
gcc %{optflags} %{SOURCE5} -DORIGINAL=\"admingraph.pl\" \
    -o %{buildroot}%{_libdir}/dspam/webui/www/admingraph.cgi
gcc %{optflags} %{SOURCE5} -DORIGINAL=\"graph.pl\" \
    -o %{buildroot}%{_libdir}/dspam/webui/www/graph.cgi

cp -pr webui/cgi-bin/templates %{buildroot}%{_libdir}/dspam/webui/templates
find %{buildroot}%{_libdir}/dspam/webui/templates -name Makefile\* | xargs rm -f

install -d -m 755 %{buildroot}%{_sysconfdir}/dspam
install -m 644 webui/cgi-bin/configure.pl %{buildroot}%{_sysconfdir}/dspam
install -m 644 webui/cgi-bin/admins %{buildroot}%{_sysconfdir}/dspam
install -m 644 webui/cgi-bin/subadmins %{buildroot}%{_sysconfdir}/dspam
install -m 644 webui/cgi-bin/default.prefs %{buildroot}%{_sysconfdir}/dspam

pushd %{buildroot}%{_libdir}/dspam/webui/www
ln -s ../../../../..%{_sysconfdir}/dspam/configure.pl .
ln -s ../../../../..%{_sysconfdir}/dspam/default.prefs .
ln -s ../../../../..%{_sysconfdir}/dspam/admins .
ln -s ../../../../..%{_sysconfdir}/dspam/subadmins .
popd


install -d %{buildroot}%{webappconfdir}
cat > %{buildroot}%{webappconfdir}/dspam.conf << EOF
Alias /dspam %{_libdir}/dspam/webui/www

<Directory %{_libdir}/dspam/webui/www>
    Options ExecCGI
    DirectoryIndex dspam.cgi

    Require local
</Directory>
EOF

install -d %{buildroot}%{_sysconfdir}/logrotate.d
cat > %{buildroot}%{_sysconfdir}/logrotate.d/dspam << EOF
/var/log/dspam/*.log {
    missingok
    monthly
    compress
    postrotate
        /sbin/systemctl reload dspam.service > /dev/null 2>&1 || true
    endscript
}
EOF

# 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 configuration
perl -pi \
    -e 's|^#ServerMode.*|ServerMode dspam|g;' \
    -e 's|^#ServerPID.*|ServerPID "/run/dspam/dspam\.pid"|g;' \
    -e 's|^#ServerDomainSocketPath.*|ServerDomainSocketPath "%{_localstatedir}/lib/dspam/dspam\.sock"|g;' \
    -e 's|^#ClientHost.*|ClientHost "%{_localstatedir}/lib/dspam/dspam\.sock"|g;' \
    %{buildroot}%{_sysconfdir}/dspam.conf

perl -pi \
    -e 's|\$CONFIG{\x27TEMPLATES\x27}\t=.*|\$CONFIG{\x27TEMPLATES\x27}\t= "%{_libdir}/dspam/webui/templates";|;' \
    -e 's|\$CONFIG{\x27WEB_ROOT\x27}\t=.*|\$CONFIG{\x27WEB_ROOT\x27}\t= "/dspam";|;' \
    %{buildroot}%{_sysconfdir}/dspam/configure.pl

# fix strange perms
chmod 644 doc/*

mkdir -p %{buildroot}%{_tmpfilesdir}
cat <<EOF > %{buildroot}%{_tmpfilesdir}/%{name}.conf
d /run/dspam 0770 dspam mail
EOF

install -d -m 755 %{buildroot}%{_docdir}/%{name}
install -m 644 README RELEASE.NOTES CHANGELOG %{buildroot}%{_docdir}/%{name}
install -m 644 doc/*.txt %{buildroot}%{_docdir}/%{name}
tar xvjf %{SOURCE1} -C %{buildroot}%{_docdir}/%{name}

%pre
%_pre_useradd dspam %{_localstatedir}/lib/dspam /bin/sh

%post
%_tmpfilescreate %{name}
%_post_service dspam

%preun
%_preun_service dspam

%postun
%_postun_userdel dspam

%files
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/mysql_drv.txt
%exclude %{_docdir}/%{name}/pgsql_drv.txt
%exclude %{_docdir}/%{name}/sqlite_drv.txt
%{_unitdir}/dspam.service
%{_tmpfilesdir}/%{name}.conf
%{_sysconfdir}/cron.daily/dspam
%config(noreplace) %{_sysconfdir}/sysconfig/dspam
%config(noreplace) %{_sysconfdir}/logrotate.d/dspam
%attr(0640,root,mail) %config(noreplace) %{_sysconfdir}/dspam.conf
%attr(0644,root,mail) %config(noreplace) %{_sysconfdir}/mail/spamassassin/dspam.cf
%attr(2755,dspam,mail) %{_bindir}/dspam
%{_bindir}/dspam_admin
%{_bindir}/cssclean
%{_bindir}/csscompress
%{_bindir}/cssconvert
%{_bindir}/cssstat
%{_bindir}/dspam_2sql
%{_bindir}/dspam_clean
%{_bindir}/dspam_crc
%{_bindir}/dspamc
%{_bindir}/dspam_dump
%{_bindir}/dspam_logrotate
%{_bindir}/dspam_merge
%{_bindir}/dspam_stats
%{_bindir}/dspam_train
%{_bindir}/dspam_notify
%{_mandir}/man1/dspam.1*
%{_mandir}/man1/dspam_clean.1*
%{_mandir}/man1/dspam_dump.1*
%{_mandir}/man1/dspam_merge.1*
%{_mandir}/man1/dspam_stats.1*
%{_mandir}/man1/dspam_train.1*
%{_mandir}/man1/dspam_admin.1*
%{_mandir}/man1/dspam_crc.1*
%{_mandir}/man1/dspam_logrotate.1*
%dir %{_datadir}/%{name}
%dir %attr(0770,dspam,mail) %{_localstatedir}/lib/dspam
%dir %attr(0770,dspam,mail) %{_localstatedir}/lib/dspam/data
%dir %{_localstatedir}/lib/dspam/txt
%config(noreplace)  %{_localstatedir}/lib/dspam/txt/*.txt
%dir %attr(0770,dspam,mail) /var/log/dspam

%files -n %{libname}
%{_libdir}/libdspam.so.*
%{_libdir}/dspam/libhash_drv.so

%files -n %{develname}
%{_libdir}/libdspam.so
%{_libdir}/libdspam.*a
%{_includedir}/dspam
%{_libdir}/pkgconfig/dspam.pc
%{_mandir}/man3/*

%files backend-mysql
%{_docdir}/%{name}/mysql_drv.txt
%{_libdir}/dspam/libmysql_drv.so
%{_datadir}/dspam/sql/mysql

%files backend-pgsql
%{_docdir}/%{name}/pgsql_drv.txt
%{_libdir}/dspam/libpgsql_drv.so
%{_bindir}/dspam_pg2int8
%{_datadir}/dspam/sql/pgsql

%files backend-sqlite3
%{_docdir}/%{name}/sqlite_drv.txt
%{_libdir}/dspam/libsqlite3_drv.so
%{_datadir}/dspam/sql/sqlite3

%files cgi
%config(noreplace) %{webappconfdir}/dspam.conf
%dir %{_sysconfdir}/dspam/
%config(noreplace) %{_sysconfdir}/dspam/configure.pl
%config(noreplace) %{_sysconfdir}/dspam/default.prefs
%config(noreplace) %{_sysconfdir}/dspam/admins
%config(noreplace) %{_sysconfdir}/dspam/subadmins
%dir %{_libdir}/dspam/webui
%dir %{_libdir}/dspam/webui/www
%attr(2755,dspam,mail) %{_libdir}/dspam/webui/www/dspam.cgi
%attr(2755,dspam,mail) %{_libdir}/dspam/webui/www/admin.cgi
%attr(2755,dspam,mail) %{_libdir}/dspam/webui/www/admingraph.cgi
%attr(2755,dspam,mail) %{_libdir}/dspam/webui/www/graph.cgi
%{_libdir}/dspam/webui/www/*.pl
%{_libdir}/dspam/webui/www/*.css
%{_libdir}/dspam/webui/www/*.js
%{_libdir}/dspam/webui/www/rgb.txt
%{_libdir}/dspam/webui/www/favicon.ico
%{_libdir}/dspam/webui/www/dspam-logo-small.gif
%{_libdir}/dspam/webui/www/admins
%{_libdir}/dspam/webui/www/subadmins
%{_libdir}/dspam/webui/www/default.prefs
%{_libdir}/dspam/webui/templates


%changelog
* Sun Feb 28 2016 oden <oden> 3.10.2-7.mga6
+ Revision: 980338
- rebuilt for postgresql 9.5.x

* Mon Feb 08 2016 umeabot <umeabot> 3.10.2-6.mga6
+ Revision: 950851
- Mageia 6 Mass Rebuild

* Tue Nov 25 2014 cjw <cjw> 3.10.2-5.mga5
+ Revision: 798920
- rebuild against postgresql9.4

* Wed Oct 15 2014 umeabot <umeabot> 3.10.2-4.mga5
+ Revision: 741932
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 3.10.2-3.mga5
+ Revision: 678872
- Mageia 5 Mass Rebuild

* Sat Oct 19 2013 umeabot <umeabot> 3.10.2-2.mga4
+ Revision: 532898
- Mageia 4 Mass Rebuild

* Fri Aug 23 2013 guillomovitch <guillomovitch> 3.10.2-1.mga4
+ Revision: 470288
- new version
- add native wrappers to cgi scripts for setgid support

* Sun May 12 2013 guillomovitch <guillomovitch> 3.10.1-10.mga3
+ Revision: 413062
- enable debug support
- don't forget webui logo
- ship templates in correct location

* Sat May 11 2013 guillomovitch <guillomovitch> 3.10.1-9.mga3
+ Revision: 412997
- install dspam binary setgid
- drop obsoletes conflicts and useless build dependencies
- more readable configuration changes
- drop obsolete README.urpmi
- install all documentation under /usr/share/doc/dspam
- install all sql scripts under /usr/share/dspam
- drop unrecognized configure options, add --enable-syslog and --enable-preferences-extension
- drop useless ld.so configuration file
- revert change from previous release, and use a dedicated dspam user
- revert change from previous release, and use a dedicated dspam user
- spec cleanup
- drop deprecated sysinit service script
- simpliy default apache configuration file, make it compatible with apache
  2.4, and install it in canonical location
- ship missing localized template files
- drop deprecated ctime.pl usage in cgi scripts, making them compatible with
  recent perl releases

* Sat Apr 13 2013 guillomovitch <guillomovitch> 3.10.1-8.mga3
+ Revision: 409854
- don't use a specific user in systemd unit, the package doesn't create it

* Sun Mar 24 2013 colin <colin> 3.10.1-7.mga3
+ Revision: 404859
- Add systemd requires and general post/pre fixes (mga#9302)

* Mon Jan 14 2013 luigiwalser <luigiwalser> 3.10.1-6.mga3
+ Revision: 380204
- add tmpfiles config for /run/dspam

* Fri Jan 11 2013 umeabot <umeabot> 3.10.1-5.mga3
+ Revision: 349144
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Apr 28 2012 tmb <tmb> 3.10.1-4.mga2
+ Revision: 233686
- Require rpm-helper >= 0.24.8-1 for systemd support

* Sun Apr 08 2012 luigiwalser <luigiwalser> 3.10.1-3.mga2
+ Revision: 229642
- httpd restart is handled by filetriggers now

* Mon Jan 16 2012 dmorgan <dmorgan> 3.10.1-2.mga2
+ Revision: 196677
- Add systemd support ( From Fedora )

  + dlucio <dlucio>
    - 3.10.1
    - trying to make this SPEC compatible with mageia so it will be easier for me
    - imported package dspam