%define _default_patch_fuzz 2 %define gitver 02d3536 Summary: a modular network filter for postfix Name: clapf Version: 0.5.2 Release: 3.7 License: Custom Group: Networking/Mail #Source0: %{name}-nightly.tar.gz Source0: %{name}-%{gitver}.tar.gz Source1: %{name}.init # TODO: Source2: clapf.conf Source3: clapf-hourly.cron Source4: clapf-daily.cron Source5: clapf-weekly.cron Source6: clapf-monthly.cron Source10: clapf-setup Patch1: clapf-configure-skipusercheck.patch URL: http://clapf.acts.hu/ Buildroot: %{_tmppath}/%{name}-%{version}-root # this picks up a circular dependency on libclapf AutoReq: 0 # EL7 changes BuildRequires: mariadb-devel Requires: mariadb-server # E6 and others BuildRequires: clamav-devel Requires: clamav, rrdtool Requires: tre Requires: gsl Requires: libzip # Maybe doesnt use spamassassin? #Requires: spamassassin #Requires: dcc, pyzor #Requires: perl-Razor-Agent BuildRequires: tcp_wrappers-devel BuildRequires: gsl-devel BuildRequires: tre-devel BuildRequires: libzip-devel %description clapf is a modular network filter for postfix. It includes a statisti- cal (inverse chi-square) antispam module, the blackhole feature and antivirus support (clamav, AVG Linux, Dr.Web, avast! and Kasperky) pre venting virus infection as well as a cgi and a command line interface to easily train the token database. %package web Summary: Web interface for clapf Group: Networking/Mail Requires: php, php-pdo, php-mysql Requires: sphinx %description web Web interface for clapf %prep %setup -q -n %{name} %patch1 -p 1 %build %{configure} \ --prefix=/usr \ --enable-clamd \ --enable-memcached \ --enable-starttls \ --enable-tcpwrappers \ --with-database=mysql \ --with-clapf-user=clapf %{__make} all %{?_smp_mflags} %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} mkdir -p %{buildroot}/usr/bin mkdir -p %{buildroot}/%{_sysconfdir}/init.d/ mkdir -p %{buildroot}/%{_sysconfdir}/cron.hourly/ mkdir -p %{buildroot}/%{_sysconfdir}/cron.daily/ mkdir -p %{buildroot}/%{_sysconfdir}/cron.weekly/ mkdir -p %{buildroot}/%{_sysconfdir}/cron.monthly/ mkdir -p %{buildroot}%{_localstatedir}/spool/clapf/quarantine mkdir -p %{buildroot}%{_localstatedir}/spool/clapf/spamquarantine mkdir -p %{buildroot}%{_localstatedir}/spool/clapf/tmp mkdir -p %{buildroot}%{_localstatedir}/spool/clapf/stat mkdir -p %{buildroot}%{_localstatedir}/run/clapf/ mkdir -p %{buildroot}%{_localstatedir}/lib/clapf/ install -m 755 %{SOURCE1} %{buildroot}/etc/init.d/%{name} install -m 644 %{SOURCE2} %{buildroot}/etc/%{name}.conf install -m 644 %{SOURCE3} %{buildroot}/etc/cron.hourly/clapf install -m 644 %{SOURCE4} %{buildroot}/etc/cron.daily/clapf install -m 644 %{SOURCE5} %{buildroot}/etc/cron.weekly/clapf install -m 644 %{SOURCE6} %{buildroot}/etc/cron.monthly/clapf make install DESTDIR=%{buildroot} # Install setup script install -m 700 %{SOURCE10} %{buildroot}/usr/share/clapf/clapf-setup # Remove legacy files rm -f %{buildroot}/etc/init.d/rc.clapf %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %pre /usr/sbin/groupadd -r clapf 2>/dev/null || : /usr/sbin/useradd -r -d /var/spool/clapf -s /sbin/nologin -c "Clapf Antispam" -g clapf clapf 2>/dev/null || : %post /sbin/chkconfig --add clapf %triggerin -- postfix # TODO this should be in a trigger, or separate package # need to add to /etc/postfix/main.cf if ! grep -q smtp.*10125 /etc/postfix/main.cf ; then echo "content_filter=smtp:[127.0.0.1]:10125" >> /etc/postfix/main.cf fi # need to add to /etc/postfix/master.cf if ! grep -q 10126.*inet /etc/postfix/master.cf ; then echo "127.0.0.1:10126 inet n - n - 10 smtpd -o content_filter= -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters -o smtpd_helo_restrictions= -o smtpd_client_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8" >> /etc/postfix/master.cf fi # TODO - create the rdd stuff # - /usr/share/doc/clapf-0.4.2/stat/clapf-rrd-create.sh /var/lib/clapf/stat/clapf-ham-spam.rrd `date +%s` %preun if [ $1 -eq 0 ]; then /sbin/service clapf stop &>/dev/null || : /sbin/chkconfig --del clapf fi %postun if [ $1 -eq 0 ]; then if grep smtp.*10125 /etc/postfix/main.cf; then perl -p -i -e "s[^content_filter.*10125.*][]" /etc/postfix/main.cf fi if grep 10126.*inet /etc/postfix/master.cf; then perl -p -i -e "s[^127.*10126.*][]" /etc/postfix/master.cf fi fi %files %defattr(-,root,root) %doc README LICENSE Changelog %config %attr(0644,root,root) /etc/%{name}.conf %config %attr(0644,root,root) /etc/%{name}.conf.dist %config %attr(0644,root,root) /etc/sphinx.conf.dist %attr(0755,root,root) /etc/init.d/clapf %attr(0755,root,root) /etc/init.d/rc.searchd %attr(0755,root,root) /etc/cron.hourly/clapf %attr(0755,root,root) /etc/cron.daily/clapf %attr(0755,root,root) /etc/cron.weekly/clapf %attr(0755,root,root) /etc/cron.monthly/clapf #%attr(0644,root,root) %{_mandir} %dir %attr(0711,clapf,clapf) /var/spool/clapf %dir %attr(0751,clapf,clapf) /var/spool/clapf/quarantine %dir %attr(0751,clapf,clapf) /var/spool/clapf/tmp %dir %attr(0770,clapf,apache) /var/spool/clapf/spamquarantine %dir %attr(0770,clapf,clapf) /var/spool/clapf/stat %attr(0755,root,root) %{_bindir}/spamdrop %attr(0755,root,root) %{_bindir}/splitmbox %attr(0755,root,root) %{_sbindir}/clapf %attr(0755,root,root) %{_sbindir}/clapfconf %{_libdir}/libclapf.* %{_libexecdir}/clapf /usr/share/clapf %attr(0755,clapf,clapf) /var/lib/clapf %attr(0755,clapf,clapf) /var/run/clapf %attr(0755,clapf,clapf) /var/clapf/queue %attr(0755,clapf,clapf) /var/clapf/sphinx %attr(0755,clapf,clapf) /var/clapf/stat %attr(0755,clapf,clapf) /var/clapf/tmp %files web %defattr(-,root,root) /var/clapf/www %attr(0770,clapf,apache)/var/clapf/www/tmp %attr(0770,root,apache)/var/clapf/www/images # well need a -devel package #{_includedir}/clapf %changelog * Wed Jan 22 2014 Scott R. Shinn - 0.5.2-3 - Updated 08may2015 * Wed Jan 22 2014 Scott R. Shinn - 0.4.7.4-2 - Update to 0.4.7.4 - Moved postfix actions under postfix trigger * Mon Jul 23 2012 Scott R. Shinn - 0.4.7.2-1 - Update to 0.4.7.2 - Bugfix #441, clapf cron bugs * Thu Jun 9 2011 Scott R. Shinn - 0.4.6-1 - Update to 0.4.6 * Mon Sep 20 2010 Scott R. Shinn - 0.4.5-1 - Update to 0.4.5 - moved clapf.cron to /etc/cron.hourly/clapf * Wed Sep 8 2010 Scott R. Shinn - 0.4.5-0.1 - Update to 0.4.5-rc3 - Bugfix #441, create /var/lib/clapf, correct init script deprecated flags * Tue Mar 9 2010 Scott R. Shinn - 0.4.4-1 - Update to 0.4.4 - Changed to version neutral /usr/share/doc/clapf path * Thu Feb 18 2010 Scott R. Shinn - 0.4.3.1-0.2 - Added razor-agents, dcc, and pyzor dependencies * Sat Jan 9 2010 Scott R. Shinn - 0.4.3.1-0.1 - Update to 0.4.3.1 * Mon Dec 28 2009 Scott R. Shinn - 0.4.3-0.1 - Update to 0.4.3 - Bugfix #XXX, on the cron jobs using the right syntax and path - Bugfix #ClapF-6, fixes issue where the spam/antispam objects are not added to the Makefile by default - Bugfix #ClapF-7, fixes missing definition for the rc container. * Tue Oct 20 2009 Scott R. Shinn - 0.4.2-0.3 - Add Policy (per user settings) support * Sat Oct 17 2009 Scott R. Shinn - 0.4.2-0.2 - Bugfix for missing init script * Fri Oct 16 2009 Scott R. Shinn - 0.4.2-0.1 - Update to 0.4.2 - Much tweaking to get it to build in mock * Thu May 25 2006 Tim Philips - 0.3.26-1 - Rebuilt with updated version. - Require openldap-devel - Enable SURBL * Thu May 18 2006 Tim Philips - 0.3.25-1 - First build