File gld.spec of Package gld

# norootforbuild
%define makeinstall make install DESTDIR=%{buildroot}
#
%define home_dir /var/lib/empty
Name: gld
Version: 1.7
Release: 3
#
%if 0%{?suse_version}
PreReq: %insserv_prereq %fillup_prereq
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: mysql-devel postgresql-devel
#
License: GPL
Group: Productivity/Networking/Email/Servers
#
URL: http://www.gasmi.net/gld.html
Source: http://www.gasmi.net/down/gld-%{version}.tgz
Source1: %{name}.init
Patch: gld-1.6_cflags.patch
Patch1: gld-1.7_user_group.patch
#
Summary: GreyList Daemon for Postfix (MySQL backend)
%description
If you use Postfix SMTP Server you may need to implement the greylisting
algorithm to reduce spams.

Gld is a standalone greylisting server for Postfix it listen on a TCP port and
use MySQL for storing data.

The server supports whitelists based on sender,sender_domain and client_ip.  it
supports also light greylisting and DNS white lists.

Authors:
--------
    Salim Gasmi <salim@gasmi.net> 

%prep
%setup
%patch
%patch1

%build
%configure --bindir=%{_sbindir} --with-mysql=%{_prefix}
#--with-pgsql=%{_prefix}
%{__make} CFLAGS="%{optflags}"

%install 
%makeinstall
%{__install} -D -m 0755 %{S:1} %{buildroot}%{_sysconfdir}/init.d/%{name}
%{__ln_s} %{_sysconfdir}/init.d/%{name} %{buildroot}%{_sbindir}/rc%{name}
%{__install} -m 0640 gld.conf %{buildroot}%{_sysconfdir}/gld.conf

%clean
%{__rm} -rf %{buildroot};

%pre
/usr/sbin/groupadd -r %{name} &>/dev/null ||:
/usr/sbin/useradd -o -g %{name} -s /bin/false -r -c "user for %{name}" -d %{home_dir} %{name} &>/dev/null ||:

%post
%fillup_and_insserv %{name}

%preun
%stop_on_removal %{name}

%postun
%restart_on_update %{name}
%{insserv_cleanup}

%files
%defattr(-,root,root)
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/gld.conf
%{_sbindir}/%{name}
%{_sbindir}/rc%{name}
%{_sysconfdir}/init.d/%{name}
%doc README README-SECURITY HISTORY tables.mysql table-whitelist.sql

openSUSE Build Service is sponsored by