LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File proxsmtp.spec of Package proxsmtp (Project home:bastianfriedrich)

Name:           proxsmtp
Group:		Productivity/Networking/Email/Servers
BuildRequires:	libcap-devel, sed, pwdutils
Requires:	pwdutils
Url:            http://thewalter.net/stef/software/proxsmtp/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Version:        1.10
Release:        1
Summary:        A flexible and powerful yet simple mail filtering proxy
License:	Other free
Source:		http://thewalter.net/stef/software/proxsmtp/proxsmtp-%{version}.tar.gz
Source1:	proxsmtpd.init
Patch1:		001-fix-strncat.patch
Patch2:		002-remove-unused-retvar.patch
Patch3:		003-various-fixes.patch
Patch4:		004-handle-write-error-during-failure.patch
Patch5:		005-uninitialized-header_len.patch
Patch6:		006-uninitialized-pid.patch
Patch7:		007-pseudo-handling-failing-fwrite.patch

%description
ProxSMTP is a flexible tool that allows you to reject, change or log email
based on arbitrary critera. It accepts SMTP connections and forwards the SMTP
commands and responses to another SMTP server. The 'DATA' email body is
intercepted and filtered before forwarding.

You need to be able to write the filtering scripts that integrate it with
your particular needs.

ProxSMTP was written with the Postfix mail server in mind.

ProxSMTP can also be used as a transparent proxy to filter an entire network's
SMTP traffic at the router.

Authors:
--------
    Stefan Walter

%prep
%setup
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
export CFLAGS="$RPM_OPT_FLAGS -O0"	# WTF?
%if %{defined suse_version}
%if 0%{?suse_version} > 1140
export CFLAGS="$RPM_OPT_FLAGS -O2"
%endif
%endif
%configure \
	--prefix=%{_prefix} \
	--enable-capabilities \
	--enable-strict

%build
make %{?jobs:-j%jobs}
%{__sed} -i -e 's/^#User:.*$/User: proxsmtp/' doc/%{name}d.conf

%install
%makeinstall
%{__mkdir} -p \
	%{buildroot}%{_initrddir} \
	%{buildroot}%{_sysconfdir}/%{name} \
	%{buildroot}/var/lib/proxsmtp

%{__install} -m 0644 -p doc/%{name}d.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
%{__install} -m 0755 -p %{SOURCE1} %{buildroot}%{_initrddir}/%{name}d
ln -s ../../%{_initrddir}/%{name}d %{buildroot}/usr/sbin/rc%{name}d

%files
%defattr(-,root,root)
%attr(0755,root,root) %{_sbindir}/*
%attr(0750,proxsmtp,root) /var/lib/proxsmtp

%{_initrddir}/%{name}d
%dir %{_sysconfdir}/%{name}/
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/%{name}/proxsmtp.conf

%doc AUTHORS ChangeLog COPYING NEWS README scripts/{add_header.sh,spamassassin.sh}
%{_mandir}/man5/proxsmtpd.conf.5*
%{_mandir}/man8/proxsmtpd.8*

%pre
/usr/sbin/groupadd -r proxsmtp 2> /dev/null || :

if id proxsmtp 2>/dev/null; then
	usermod -d /var/lib/proxsmtp proxsmtp
else
	/usr/sbin/useradd -r -g proxsmtp -s /bin/false -c "ProxSMTP account" -d /var/lib/proxsmtp proxsmtp
fi

%post
chown proxsmtp:root /var/lib/proxsmtp
chmod 0750 /var/lib/proxsmtp

%preun
if [ $1 -eq 0 ]; then
	/sbin/insserv -r proxsmtpd
	/etc/init.d/proxsmtpd stop > /dev/null 2>&1 || :
fi

%changelog
* Mon Oct 24 2011 Bastian Friedrich <bastian@bastian-friedrich.de> 1.10
- Update to newest release 1.10
* Wed Feb 02 2011 Bastian Friedrich <bastian@bastian-friedrich.de> 1.9
- Initial package