Search
j0ke.net Open Build Service
>
Projects
>
server:mail
>
qmail-spp-plugins-spf
> qmail-spp-spf.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File qmail-spp-spf.spec of Package qmail-spp-plugins-spf
#!BuildIgnore: post-build-checks %define qdir /var/qmail Summary: "SPF" plugin for qmail-smtp Name: qmail-spp-spf Version: 20091020 Release: 1 License: GPLv2 Group: System/Mail URL: https://www.caputo.com/foss/qmail-spp-spf/ Source0: https://www.caputo.com/foss/qmail-spp-spf/%{name}-%{version}.c Source1: Changes Requires: qmail BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: libspf2-devel netqmail %description This is an implementation of SPF as a qmail-spp module. It requires libspf2. For more information, consult: http://www.openspf.org/ http://qmail-spp.sourceforge.net/ http://www.libspf2.org/ If an SPF record is not found or doesn't process, a fallback SPF record of "v=spf1 mx -all" can be used to test if the client is listed in the MX records of the envelope domain. %prep %setup -T -c cp %{S:0} . %build gcc -Wall -o %{name} %{name}-%{version}.c -lspf2 -I/usr/include/spf2 %install mkdir -p $RPM_BUILD_ROOT%{qdir}/plugins install -m 0755 %{name} $RPM_BUILD_ROOT%{qdir}/plugins %post cd %{qdir}/control if [ "$1" -ge 1 -a `grep -c plugins/%{name} smtpplugins` -eq 0 ]; then echo Trying to insert plugin into %{qdir}/control/smtpplugins... if grep '^\[mail\]$' smtpplugins >/dev/null; then i=1 while [ `head -$i smtpplugins | grep -c '^\[mail\]$'` -lt 1 ]; do i=$(($i + 1)) done head -$i smtpplugins >smtpplugins.new tail +$(($i + 1)) smtpplugins >>smtpplugins.new && \ mv smtpplugins.new smtpplugins else echo "[mail]" >>smtpplugins fi if grep '^\[rcpt\]$' smtpplugins >/dev/null; then i=1 while [ `head -$i smtpplugins | grep -c '^\[rcpt\]$'` -lt 1 ]; do i=$(($i + 1)) done head -$i smtpplugins >smtpplugins.new echo "plugins/%{name}" >>smtpplugins.new tail +$(($i + 1)) smtpplugins >>smtpplugins.new && \ mv smtpplugins.new smtpplugins else echo "[rcpt]" >>smtpplugins echo "plugins/%{name}" >>smtpplugins fi echo "Don't forget to set the required environment variables" echo "when invoking qmail-smtpd." echo "And think about whitelisting some addresses, see %{_docdir}/%{name}." fi %preun if [ "$1" = 0 ]; then cd %{qdir}/control if [ -r smtpplugins ]; then echo Trying to remove %{name} from %{qdir}/control/smtpplugins... egrep -v '^#*plugins/%{name}$' smtpplugins >smtpplugins.new && \ mv smtpplugins.new smtpplugins fi fi %clean [ "$RPM_BUILD_ROOT" = "/" ] || rm -rf "$RPM_BUILD_ROOT" %files %defattr(-,root,qmail) %{qdir}/plugins/%{name} %changelog * Sat Aug 07 2010 Carsten Schoene <cs@linux-administrator.com> - 20091020-1 - initial build