2c420c1
## $Id$
2c420c1
3615676
## This package accepts the following switches:
3f06bd6
##   --with spf        ...  enable SPF support
3f06bd6
##   --without minit   ...  disable creation of 'minit' subpackage
3f06bd6
##   --without initng  ...  disable creation of 'initng' subpackage
3615676
3615676
## Fedora Extras specific customization below...
3f06bd6
%{!?_with_minit:%global		_without_minit		--without minit}
3f06bd6
%{!?_with_initng:%global	_without_initng		--without initng}
3615676
##
3615676
2c420c1
%global username	grmilter
2c420c1
%global minitdir	%_sysconfdir/minit
2c420c1
%global minitsvcdir	%minitdir/services/grmilter
2c420c1
%global vardir		%_var/lib/%name
2c420c1
%global dbdir		%vardir/db
3f06bd6
%global rundir		%_var/run/%name
2c420c1
%global __chkconfig	/sbin/chkconfig
2c420c1
2c420c1
%{!?release_func:%global release_func() %1%{?dist}}
3615676
d198a5c
Summary:	Milter for greylisting, the next step in the spam control war
3615676
Name:		milter-greylist
c2b28a1
Version:	2.0.2
3f06bd6
Release:	%release_func 2
3615676
License:	BSD w/ advertising
3f06bd6
Group:		System Environment/Daemons
3615676
URL:		http://hcpnet.free.fr/milter-greylist/
44a5784
Source0:	ftp://ftp.espci.fr/pub/milter-greylist/%name-%version.tgz
3f06bd6
Patch0:		milter-greylist-2.0.2-sysv.patch
3615676
BuildRoot:	%_tmppath/%name-%version-%release-root
3615676
Requires:		init(%name)
3615676
Requires(pre):		fedora-usermgmt
3615676
Requires(postun):	fedora-usermgmt
3615676
BuildRequires:		bison flex m4
3615676
BuildRequires:		sendmail-devel %{?_with_spf:libspf-devel}
3615676
3615676
%package sysv
452781d
Summary:	Sysv initscripts for %name
3f06bd6
Group:		System Environment/Daemons
3615676
Provides:	init(%name) = sysv
452781d
Requires(preun):	%name = %version-%release
452781d
Requires(postun):	%name = %version-%release
3615676
Requires(preun):	initscripts
3615676
Requires(postun):	initscripts
3615676
Requires(post):		%__chkconfig
3615676
Requires(preun):	%__chkconfig
3615676
3615676
%package minit
452781d
Summary:	Minit initscripts for %name
3f06bd6
Group:		System Environment/Daemons
3f06bd6
Source20:	milter-greylist.params
3f06bd6
Provides:		init(%name) = minit
452781d
Requires:		%name = %version-%release
3615676
Requires(pre):		minit-setup
3615676
Requires(postun):	minit-setup
3615676
3f06bd6
%package initng
3f06bd6
Summary:	initng initscripts for %name
3f06bd6
Group:		System Environment/Daemons
3f06bd6
Source30:	milter-greylist.i
3f06bd6
Provides:		init(%name) = initng
3f06bd6
Requires:		%name = %version-%release
3f06bd6
Requires(pre):		%_sysconfdir/initng %name
3f06bd6
Requires(preun):	initng %name
3f06bd6
Requires(postun):	initng %name
3f06bd6
3615676
3615676
%description
3615676
Greylisting is a new method of blocking significant amounts of spam at
3615676
the mailserver level, but without resorting to heavyweight statistical
3615676
analysis or other heuristical (and error-prone) approaches. Consequently,
3615676
implementations are fairly lightweight, and may even decrease network
3615676
traffic and processor load on your mailserver.
3615676
3615676
This package provides a greylist filter for sendmail's milter API.
3615676
3615676
3615676
%description sysv
3615676
Greylisting is a new method of blocking significant amounts of spam at
3615676
the mailserver level, but without resorting to heavyweight statistical
3615676
analysis or other heuristical (and error-prone) approaches. Consequently,
3615676
implementations are fairly lightweight, and may even decrease network
3615676
traffic and processor load on your mailserver.
3615676
3615676
This package provides the SysV initscripts for the %name package.
3615676
3615676
3615676
%description minit
3615676
Greylisting is a new method of blocking significant amounts of spam at
3615676
the mailserver level, but without resorting to heavyweight statistical
3615676
analysis or other heuristical (and error-prone) approaches. Consequently,
3615676
implementations are fairly lightweight, and may even decrease network
3615676
traffic and processor load on your mailserver.
3615676
3615676
This package provides the minit initscripts for the %name package.
3615676
3615676
3f06bd6
%description initng
3f06bd6
Greylisting is a new method of blocking significant amounts of spam at
3f06bd6
the mailserver level, but without resorting to heavyweight statistical
3f06bd6
analysis or other heuristical (and error-prone) approaches. Consequently,
3f06bd6
implementations are fairly lightweight, and may even decrease network
3f06bd6
traffic and processor load on your mailserver.
3f06bd6
3f06bd6
This package provides the initng initscripts for the %name package.
3f06bd6
3f06bd6
3615676
%prep
44a5784
%setup -q
3f06bd6
%patch0 -p1 -b .sysv
3615676
3615676
perl -pi -e 's!--rpath!--XXXX!g' configure
3f06bd6
sed  -i  -e 's!^\#user .*!user "%username"!;
3f06bd6
             s!^\#socket !socket !' greylist.conf
3615676
3615676
for i in `find -type f`; do
3615676
    sed -e 's!/var/milter-greylist/milter-greylist.sock!%rundir/milter-greylist.sock!g;
3615676
            s!/var/milter-greylist/greylist.db!%dbdir/greylist.db!g;
c2b28a1
	    s!/var/milter-greylist/milter-greylist.pid!%_var/run/milter-greylist.pid!g;
452781d
           ' "$i" >"$i.tmp"
3615676
    cmp -s "$i" "$i.tmp" || cat "$i.tmp" >"$i"
3615676
    rm -f "$i".tmp
3615676
done
3615676
3615676
3615676
%define makeflags	TEST=false BINDIR=%_sbindir
3615676
%build
3615676
%configure \
3615676
	--with-user=%username \
3615676
	%{?_with_spf:--with-libspf=/usr}
3615676
3615676
## is not SMP safe :(
3615676
%__make %makeflags
3615676
3615676
3615676
%install
3615676
rm -rf $RPM_BUILD_ROOT
3615676
3f06bd6
%__install -d -m755 $RPM_BUILD_ROOT{%_initrddir,%minitsvcdir,%rundir,%dbdir,%_var/run} \
3f06bd6
		    $RPM_BUILD_ROOT%_sysconfdir/initng/daemon
3615676
%__make DESTDIR=$RPM_BUILD_ROOT install %makeflags USER="$(id -u)"
3615676
%__install -p -m755 rc-redhat.sh $RPM_BUILD_ROOT%_initrddir/%name
3615676
3615676
# the minit stuff
3615676
ln -s %_sbindir/milter-greylist $RPM_BUILD_ROOT%minitsvcdir/run
3f06bd6
%__install -p -m644 %SOURCE20   $RPM_BUILD_ROOT%minitsvcdir/params
3f06bd6
touch                           $RPM_BUILD_ROOT%minitsvcdir/respawn
3615676
3f06bd6
# the initng stuff
3f06bd6
%__install -p -m644 %SOURCE30	$RPM_BUILD_ROOT%_sysconfdir/initng/daemon/milter-greylist.i
3615676
3615676
# create temporary files
3615676
touch $RPM_BUILD_ROOT%rundir/milter-greylist.sock
3615676
touch $RPM_BUILD_ROOT%_var/run/milter-greylist.pid
3615676
3f06bd6
## Remove the unwanted init-methods
3f06bd6
%{?_without_sysv:  rm -rf $RPM_BUILD_ROOT%_initrddir}
3f06bd6
%{?_without_minit: rm -rf $RPM_BUILD_ROOT%_sysconfdir/minit}
3f06bd6
%{?_without_initng:rm -rf $RPM_BUILD_ROOT%_sysconfdir/initng}
3f06bd6
3615676
3615676
%pre
3615676
/usr/sbin/fedora-groupadd 7 -r %username &>/dev/null || :
3615676
/usr/sbin/fedora-useradd  7 -r -s /sbin/nologin -M -d %vardir \
3615676
                            -c 'Greylist-milter user' -g %username %username &>/dev/null || :
3615676
3615676
d198a5c
%postun
3615676
test "$1" != 0 || /usr/sbin/fedora-userdel  %username &>/dev/null || :
3615676
test "$1" != 0 || /usr/sbin/fedora-groupdel %username &>/dev/null || :
3615676
3615676
3615676
3615676
%post sysv
3615676
%__chkconfig --add %name
3615676
3615676
%preun sysv
3615676
test "$1" != 0 || %__chkconfig --del %name
3615676
test "$1" != 0 || %_initrddir/%name stop >/dev/null || :
3615676
3615676
%postun sysv
3615676
test "$1"  = 0 || %_initrddir/%name condrestart >/dev/null || :
3615676
3615676
3f06bd6
%preun initng
3f06bd6
test "$1" != 0 || {
3f06bd6
	/sbin/ngc --stop    daemon/milter-greylist &>/dev/null || :
3f06bd6
	/sbin/ng-update del daemon/milter-greylist &>/dev/null || :
3f06bd6
}
3f06bd6
3f06bd6
%postun initng
3f06bd6
test "$1"  = 0 || /sbin/ngc --restart daemon/milter-greylist &>/dev/null || :
3f06bd6
3615676
3615676
%clean
3615676
rm -rf $RPM_BUILD_ROOT
3615676
3615676
%files
3615676
%defattr(-,root,root,-)
3615676
%doc ChangeLog README
3615676
%_mandir/man*/*
3f06bd6
%attr(0640,root,%username) %verify(not mtime) %config(noreplace) %_sysconfdir/mail/greylist.conf
3615676
%dir %attr(0751,%username,%username) %vardir
3615676
%dir %attr(0770,root,%username) %dbdir
3615676
%dir %attr(0700,%username,root) %rundir
3615676
%_sbindir/*
3615676
3615676
%ghost %rundir/milter-greylist.sock
3615676
%ghost %_var/run/milter-greylist.pid
3615676
3f06bd6
%if 0%{!?_without_sysv:1}
3615676
%files sysv
3f06bd6
  %defattr(-,root,root,-)
3f06bd6
  %config %_initrddir/*
3f06bd6
%endif
3f06bd6
3f06bd6
%if 0%{!?_without_initng:1}
3f06bd6
%files initng
3f06bd6
  %defattr(-,root,root,-)
3f06bd6
  %config %_sysconfdir/initng/daemon/*
3f06bd6
%endif
3615676
3f06bd6
%if 0%{!?_without_minit:1}
3615676
%files minit
3f06bd6
  %defattr(-,root,root,-)
3f06bd6
  %dir %minitsvcdir
3f06bd6
  %minitsvcdir/run
3f06bd6
  %minitsvcdir/respawn
3f06bd6
  %config(noreplace) %minitsvcdir/params
3615676
%endif
3615676
3615676
%changelog
3f06bd6
* Sat Dec 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 2.0.2-2
3f06bd6
- use /var/run/milter-greylist as directory for the socket (bz #162334#6)
3f06bd6
- do not set user and socket in the sysv-initscript anymore; instead
3f06bd6
  of uncomment the configfile entries
3f06bd6
- ship minit params file as SOURCE instead of generating it on-the-fly
3f06bd6
- added -initng subpackage
3f06bd6
- minor specfile cleanups
3f06bd6
c2b28a1
* Sat Oct 22 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 2.0.2-1
c2b28a1
- updated to 2.0.2
c2b28a1
4e46448
* Sat Jun 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 2.0-2
44a5784
- updated to final 2.0
44a5784
3068b9d
* Sat Jun 25 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 2.0-0.1.rc5
3068b9d
- updated to 2.0rc5
3068b9d
- added patch which changes the way how the user will be switched in
3068b9d
  the SysV initscript
3068b9d
- removed all other patches as they are upstream now
3068b9d
2c420c1
* Thu May 19 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 1.6-3
2c420c1
- set %%dist
2c420c1
- use %%global instead of %%define
2c420c1
- do not require 'setuidgid' for -minit anymore
2c420c1
b09c518
* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
b09c518
- rebuilt
b09c518
3615676
* Thu Feb  3 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:1.6
3615676
- updated to 1.6
3615676
3615676
* Thu Oct  7 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:1.4-0.fdr.2
3615676
- rebuilt
3615676
- applied patch to build with libspf-1.0.0
3615676
3615676
* Tue Jun 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:1.4-0.fdr.1
3615676
- updated to 1.4
3615676
3615676
* Fri Jun 11 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:1.3.9-0.fdr.1
3615676
- updated to 1.3.9
3615676
3615676
* Thu Apr 29 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:1.2.1-1
3615676
- Initial build.