1Name:		dkimproxy
2Version:	@VERSION@
3Release:	1%{?dist}
4Summary:	DKIMproxy
5
6Group:		System Environment/Daemons
7License:	GPLv2+
8URL:		http://dkimproxy.sourceforge.net
9Source0:	http://sourceforge.net/projects/dkimproxy/files/dkimproxy/%{version}/%{name}-%{version}.tar.gz
10BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
11
12BuildArch:	noarch
13BuildRequires:	perl-Mail-DKIM perl-Net-Server
14Requires:	perl-Mail-DKIM perl-Net-Server
15Autoreq:	0
16
17%description
18DKIMproxy is an SMTP-proxy that implements the DKIM and DomainKeys standards, to sign and verify email messages using digital signatures and DNS records. It can be used to add DKIM support to nearly any existing SMTP mail server.
19
20
21%prep
22%setup -q
23
24
25%build
26CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr/local/dkimproxy --mandir=%{_mandir} --sysconfdir=/etc/dkimproxy
27make %{?_smp_mflags}
28
29
30%install
31rm -rf $RPM_BUILD_ROOT
32make install DESTDIR=$RPM_BUILD_ROOT
33install -D -m 755 sample-dkim-init-script.sh ${RPM_BUILD_ROOT}%{_initrddir}/dkimproxy
34
35
36%clean
37rm -rf $RPM_BUILD_ROOT
38
39%pre
40# On install (but not upgrade) create a user account specifically for
41# DKIMproxy. Note: we leave the account even after package removal.
42if [ "$1" = "1" ]; then
43	/usr/sbin/useradd -r -s /sbin/nologin dkim 2>/dev/null || :
44fi
45
46%post
47if [ "$1" = "1" ]; then   #first install
48	/sbin/chkconfig --add dkimproxy
49fi
50
51%preun
52if [ "$1" = "1" ]; then   #last uninstall
53	/sbin/service dkimproxy stop || :
54	/sbin/chkconfig --del dkimproxy
55fi
56
57
58%files
59%defattr(-,root,root,-)
60%doc ChangeLog README AUTHORS NEWS
61/usr/local/dkimproxy/*
62%{_mandir}/man8/*
63/etc/dkimproxy/*
64%{_initrddir}/dkimproxy
65
66
67
68
69%changelog
70
71