File dkimproxy.spec of Package dkimproxy

#
# spec file for package dkimproxy
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define dkimproxy_prefix /usr/share/dkimproxy
Summary:        DKIMproxy is an SMTP-proxy that implements the DKIM and DomainKeys standards

Name:           dkimproxy
Version:        1.0.1
Release:        20
License:        GPLv2
Group:          Productivity/Networking/Email/Utilities
Url:            http://dkimproxy.sourceforge.net/
Source:         %{name}-%{version}.tar.gz
Source1:        %{name}.init
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  git-core perl-Mail-DKIM perl-Net-Server pwdutils
PreReq:         pwdutils %insserv_prereq
Requires:       perl-Mail-DKIM perl-Net-Server git-core

%description
DKIMproxy is an SMTP-proxy that signs and/or verifies emails, using the
Mail::DKIM module. It is designed for Postfix, but should work with any
mail server. It comprises two separate proxies, an "outbound" proxy for
signing outgoing email, and an "inbound" proxy for verifying signatures
of incoming email. With Postfix, the proxies can operate as either
Before-Queue or After-Queue content filters.

%prep
%setup -q -n %{name}-%{version}
# ---------------------------------------------------------------------------

%build
./configure --prefix %{dkimproxy_prefix}
# ---------------------------------------------------------------------------

%install
%makeinstall
chmod 644 $( find %{buildroot}/%{dkimproxy_prefix} -name "*.pm" )
mkdir -p %{buildroot}{%{_sbindir},/etc/init.d}
install -m755  %{SOURCE1} %{buildroot}/etc/init.d/%{name}
ln -sf ../../etc/init.d/%{name} %{buildroot}/usr/sbin/rc%{name}
# ---------------------------------------------------------------------------
### Clean up buildroot
find %{buildroot} -name .packlist -exec %{__rm} {} \;

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

%pre
/usr/sbin/groupadd -o -r dkim  2> /dev/null || :
/usr/sbin/useradd -r -o -g dkim -s /bin/false -c "DKIMproxy Daemon" -d /var/spool/dkim dkim 2> /dev/null || :
# ---------------------------------------------------------------------------

%preun
%stop_on_removal %{name}
# ---------------------------------------------------------------------------

%post

%postun
%restart_on_update %{name}
%insserv_cleanup

%files
%defattr(-, root, root, 0755)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README TODO smtpprox.ChangeLog smtpprox.README smtpprox.TODO 
%{dkimproxy_prefix}
%{_sbindir}/rcdkimproxy
%config /etc/init.d/%{name}
# ---------------------------------------------------------------------------

%changelog
openSUSE Build Service is sponsored by