## $Id: milter-greylist.spec,v 1.5 2005/05/19 17:37:44 ensc Exp $ ## This package accepts the following switches: ## --with spf ... enable SPF support ## --with minit ... enable minit support %global username grmilter %global minitdir %_sysconfdir/minit %global minitsvcdir %minitdir/services/grmilter %global vardir %_var/lib/%name %global dbdir %vardir/db %global rundir %vardir/run %global __chkconfig /sbin/chkconfig #%{!?release_func:%global release_func() %1%{?dist}} Summary: Milter for greylisting, the next step in the spam control war Name: milter-greylist Version: 1.6 Release: 3.3.%{mysig} License: BSD w/ advertising Group: System Environment/Daemon URL: http://hcpnet.free.fr/milter-greylist/ Source0: ftp://ftp.espci.fr/pub/milter-greylist/%name-%version.tgz Source1: milter-greylist.sysconfig Source2: milter-greylist.init Patch0: milter-greylist-1.6-rh.patch Patch1: milter-greylist-1.6-group.patch Patch2: milter-greylist-1.4-spfbool.patch BuildRoot: %_tmppath/%name-%version-%release-root Requires: init(%name) Requires(pre): shadow-utils Requires(postun): shadow-utils BuildRequires: bison flex m4 BuildRequires: sendmail-devel %{?_with_spf:libspf-devel} %package sysv Summary: Sysv initscripts for %name Group: System Environment/Daemon Provides: init(%name) = sysv Requires: milter-greylist Requires(preun): %name = %version-%release Requires(postun): %name = %version-%release Requires(preun): initscripts Requires(postun): initscripts Requires(post): %__chkconfig Requires(preun): %__chkconfig %package minit Summary: Minit initscripts for %name Group: System Environment/Daemon Provides: init(%name) = minit Requires: %name = %version-%release Requires(pre): minit-setup Requires(postun): minit-setup %description Greylisting is a new method of blocking significant amounts of spam at the mailserver level, but without resorting to heavyweight statistical analysis or other heuristical (and error-prone) approaches. Consequently, implementations are fairly lightweight, and may even decrease network traffic and processor load on your mailserver. This package provides a greylist filter for sendmail's milter API. %description sysv Greylisting is a new method of blocking significant amounts of spam at the mailserver level, but without resorting to heavyweight statistical analysis or other heuristical (and error-prone) approaches. Consequently, implementations are fairly lightweight, and may even decrease network traffic and processor load on your mailserver. This package provides the SysV initscripts for the %name package. %description minit Greylisting is a new method of blocking significant amounts of spam at the mailserver level, but without resorting to heavyweight statistical analysis or other heuristical (and error-prone) approaches. Consequently, implementations are fairly lightweight, and may even decrease network traffic and processor load on your mailserver. This package provides the minit initscripts for the %name package. %prep %setup -q %patch0 -p1 -b .rh %patch1 -p1 -b .group %patch2 -p1 -b .spfbool perl -pi -e 's!(\$\{INSTALL\}.*\s)(\S+\s*)$!$1\${DESTDIR}$2!' Makefile.in perl -pi -e 's!--rpath!--XXXX!g' configure for i in `find -type f`; do sed -e 's!/var/milter-greylist/milter-greylist.sock!%rundir/milter-greylist.sock!g; s!/var/milter-greylist/greylist.db!%dbdir/greylist.db!g; ' "$i" >"$i.tmp" cmp -s "$i" "$i.tmp" || cat "$i.tmp" >"$i" rm -f "$i".tmp done %define makeflags TEST=false BINDIR=%_sbindir %build %configure \ --with-user=%username \ %{?_with_spf:--with-libspf=/usr} ## is not SMP safe :( %__make %makeflags %install rm -rf $RPM_BUILD_ROOT %__install -d -m755 \ $RPM_BUILD_ROOT{/etc/mail,%rundir,%dbdir,%_initrddir,%minitsvcdir,%_var/run} %__make DESTDIR=$RPM_BUILD_ROOT install %makeflags USER="$(id -u)" mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig %__install -p -m755 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%name %__install -p -m755 %{S:2} $RPM_BUILD_ROOT%_initrddir/%name # the minit stuff ln -s %_sbindir/milter-greylist $RPM_BUILD_ROOT%minitsvcdir/run touch $RPM_BUILD_ROOT%minitsvcdir/respawn cat <$RPM_BUILD_ROOT%minitsvcdir/params -D -u%username -p%rundir/milter-greylist.sock EOF # Short hack... %{!?_with_minit:rm -rf $RPM_BUILD_ROOT%minitdir} # create temporary files touch $RPM_BUILD_ROOT%rundir/milter-greylist.sock touch $RPM_BUILD_ROOT%_var/run/milter-greylist.pid %pre /usr/sbin/groupadd -r %username &>/dev/null || : /usr/sbin/useradd -r -s /sbin/nologin -M -d %vardir \ -c 'Greylist-milter user' -g %username %username &>/dev/null || : %postun test "$1" != 0 || /usr/sbin/userdel %username &>/dev/null || : test "$1" != 0 || /usr/sbin/groupdel %username &>/dev/null || : %post sysv %__chkconfig --add %name %preun sysv test "$1" != 0 || %__chkconfig --del %name test "$1" != 0 || %_initrddir/%name stop >/dev/null || : %postun sysv test "$1" = 0 || %_initrddir/%name condrestart >/dev/null || : %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc ChangeLog README %_mandir/man*/* %attr(0640,root,%username) %config(noreplace) %{_sysconfdir}/mail/greylist.conf %attr(0640,root,%username) %config(noreplace) %{_sysconfdir}/sysconfig/%name %dir %attr(0751,%username,%username) %vardir %dir %attr(0770,root,%username) %dbdir %dir %attr(0700,%username,root) %rundir %_sbindir/* %ghost %rundir/milter-greylist.sock %ghost %_var/run/milter-greylist.pid %files sysv %defattr(-,root,root,-) %config %_initrddir/* %if 0%{?_with_minit:1} %files minit %defattr(-,root,root,-) %dir %minitsvcdir %minitsvcdir/run %minitsvcdir/respawn %config(noreplace) %minitsvcdir/params %endif %changelog * Fri Jul 08 2005 Milan Kerslager 1.6-3.3.ker.rhel3 - fixed path for socket in /etc/sysconfig/milter-greylist and in the init script * Sun Jul 03 2005 Milan Kerslager 1.6-3.2.ker.rhel4 - disable SPF, see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=162336 * Sat Jul 02 2005 Milan Kerslager 1.6-3.1.ker.rhel4 - rebuild for RHEL4 - fixes in init script, /etc/sysconfig/milter-greylist * Sat Jul 02 2005 Milan Kerslager 1.6-3.ker.rhel4 - rebuild for RHEL4 - change fedora-usermgmt to shadow-utils - change fedora-{useradd,userdel,groupadd,groupdel} to {useradd,userdel,groupadd,groupdel} * Thu May 19 2005 Enrico Scholz - 1.6-3 - set %%dist - use %%global instead of %%define - do not require 'setuidgid' for -minit anymore * Fri Apr 7 2005 Michael Schwendt - rebuilt * Thu Feb 3 2005 Enrico Scholz - 0:1.6 - updated to 1.6 * Thu Oct 7 2004 Enrico Scholz - 0:1.4-0.fdr.2 - rebuilt - applied patch to build with libspf-1.0.0 * Tue Jun 15 2004 Enrico Scholz - 0:1.4-0.fdr.1 - updated to 1.4 * Fri Jun 11 2004 Enrico Scholz - 0:1.3.9-0.fdr.1 - updated to 1.3.9 * Thu Apr 29 2004 Enrico Scholz - 0:1.2.1-1 - Initial build.