# Conditional build:
-%bcond_without pgsql # without PostgreSQL support
-%bcond_without mysql # without MySQL support
-%bcond_without whoson # without whoson support
+%bcond_without pgsql # without PostgreSQL support
+%bcond_without mysql # without MySQL support
+%bcond_without whoson # without whoson support
%bcond_without ldap # without LDAP support
-%bcond_without exiscan # without exiscan support
+%bcond_without exiscan # without exiscan support
+%bcond_without spf # without spf support
+%bcond_without srs # without srs support
+%bcond_with saexim # with sa-exim support
#
-%define exiscan_version 4.30-14
+%define exiscan_version 4.42-27
+%define saexim_version 3.1
Summary: University of Cambridge Mail Transfer Agent
Summary(pl): Agent Transferu Poczty Uniwersytetu w Cambridge
Summary(pt_BR): Servidor de correio eletrĂ´nico exim
Name: exim
-Version: 4.30
-Release: 2
+Version: 4.42
+Release: 1
Epoch: 2
License: GPL
Group: Networking/Daemons
Source0: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/%{name}-%{version}.tar.bz2
-# Source0-md5: be53ba6801a019452f06b68c112a2ec1
-Source1: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/%{name}-texinfo-4.30.tar.bz2
-# Source1-md5: dceb3ce755543ababd7362437a3c1141
+# Source0-md5: eb6a06e70a78a03200b4e4aefbb7b0aa
+Source1: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/%{name}-texinfo-4.40.tar.bz2
+# Source1-md5: cc91bd804ee0f7fd70991e2e6b529033
Source2: %{name}.init
Source3: %{name}.cron.db
Source4: %{name}4.conf
Source7: %{name}4-man-021016.tar.bz2
# Source7-md5: b552704ebf853a401946038a2b7e8e98
Source8: http://duncanthrax.net/exiscan-acl/exiscan-acl-%{exiscan_version}.patch.bz2
-# Source8-md5: 017bc42058d00ebce78472dcd5eecb28
+# Source8-md5: bc81a47009d24433a282e5c3a668fcb3
Source9: %{name}.aliases
Source10: newaliases
Source11: %{name}.logrotate
Source12: %{name}.sysconfig
Source13: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/FAQ.txt.bz2
-# Source13-md5: 60be625d8a2c91219554ec31b15a8d18
+# Source13-md5: 7c695675e5e60693916b787001252d56
Source14: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/config.samples.tar.bz2
-# Source14-md5: 73b68438e0032ca63185c9aa38f44bd8
+# Source14-md5: 42c7d5c02d06fdd3d8b6ba124ad9fd05
Source15: %{name}4-smtp.pamd
Source16: %{name}on.png
+Source17: http://marc.merlins.org/linux/exim/files/sa-exim-%{saexim_version}.tar.gz
+# Source17-md5: 34892f195384c127f7c40c461a9ef421
Patch0: %{name}4-EDITME.patch
Patch1: %{name}4-monitor-EDITME.patch
Patch2: %{name}4-texinfo.patch
Patch5: %{name}4-exiscan-pld.patch
URL: http://www.exim.org/
%{?with_ldap:BuildRequires: openldap-devel >= 2.0.0}
+%{?with_spf:BuildRequires: libspf2-devel}
+%{?with_srs:BuildRequires: libsrs_alt-devel}
%{?with_mysql:BuildRequires: mysql-devel}
%{?with_pgsql:BuildRequires: postgresql-devel}
%{?with_whoson:BuildRequires: whoson-devel}
BuildRequires: XFree86-devel
BuildRequires: db-devel
-BuildRequires: openssl-devel >= 0.9.7c
+BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pam-devel
BuildRequires: pcre-devel
-BuildRequires: perl-devel >= 5.6.0
+BuildRequires: perl-devel >= 1:5.6.0
BuildRequires: texinfo
PreReq: rc-scripts
Requires(pre): /bin/id
Requires(postun): /usr/sbin/groupdel
Requires(postun): /usr/sbin/userdel
Requires(post): fileutils
+Requires(post): /bin/hostname
Requires(post,preun): /sbin/chkconfig
Requires: pam >= 0.77.3
Provides: smtpdaemon
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Obsoletes: courier
Obsoletes: masqmail
+Obsoletes: nullmailer
Obsoletes: omta
Obsoletes: postfix
Obsoletes: qmail
Obsoletes: sendmail-doc
Obsoletes: smail
Obsoletes: smtpdaemon
+Obsoletes: ssmtp
Obsoletes: zmailer
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Smail like Mail Transfer Agent with single configuration file.
%patch3 -p1
%patch4 -p1
%patch5 -p0
+
%{?with_exiscan:test -f %{SOURCE8} || exit 1; bzip2 -d -c %{SOURCE8} | patch -p1 || exit 1}
+%{?with_saexim:test -f %{SOURCE17} || exit 1; gzip -d -c %{SOURCE17} | tar -x || exit 1}
install %{SOURCE13} doc/FAQ.txt.bz2
install %{SOURCE14} doc/config.samples.tar.bz2
cp -f exim_monitor/EDITME Local/eximon.conf
%build
-%{__make} \
+
+%if %{with saexim}
+ cd sa-exim-%{saexim_version}
+ %{__make} -j1 sa-exim.h
+ echo '#define SPAMASSASSIN_CONF "%{_sysconfdir}/mail/spamassassin/local.cf"' >> sa-exim.h
+ cat sa-exim.c > ../src/local_scan.c
+ cat sa-exim.h > ../src/sa-exim.h
+ cd ..
+%endif
+
+%{__make} -j1 \
CC="%{__cc}" \
- CFLAGS="%{rpmcflags}" \
+ CFLAGS="%{rpmcflags} %{?with_spf:-DSPF} %{?with_srs:-DSRS}" \
LOOKUP_CDB=yes \
- XLFLAGS=-L/usr/X11R6/%{_lib} \
- X11_LD_LIB=/usr/X11R6/%{_lib} \
+XLFLAGS=-L%{_prefix}/X11R6/%{_lib} \
+X11_LD_LIB=%{_prefix}/X11R6/%{_lib} \
%{?with_mysql:LOOKUP_MYSQL=yes} \
%{?with_pgsql:LOOKUP_PGSQL=yes} \
%{?with_whoson:LOOKUP_WHOSON=yes} \
%{?with_ldap:LOOKUP_LDAP=yes LDAP_LIB_TYPE=OPENLDAP2} \
- LOOKUP_LIBS="%{?with_ldap:-lldap -llber} %{?with_mysql:-lmysqlclient} %{?with_pgsql:-lpq} %{?with_whoson:-lwhoson}" \
+ LOOKUP_LIBS="%{?with_ldap:-lldap -llber} %{?with_mysql:-lmysqlclient} %{?with_pgsql:-lpq} %{?with_whoson:-lwhoson} %{?with_spf:-lspf2} %{?with_srs:-lsrs_alt}" \
LOOKUP_INCLUDE="%{?with_mysql:-I%{_includedir}/mysql} %{?with_pgsql:-I%{_includedir}/pgsql}"
makeinfo --force exim-texinfo-*/doc/*.texinfo
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_sysconfdir}/mail
install -d $RPM_BUILD_ROOT/etc/{cron.{daily,weekly},logrotate.d,rc.d/init.d,sysconfig,pam.d}
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,%{_libdir}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_mandir}/man8,/usr/lib}
install -d $RPM_BUILD_ROOT%{_var}/{spool/exim/{db,input,msglog},log/{archiv,}/exim,mail}
install -d $RPM_BUILD_ROOT{%{_infodir},%{_prefix}/X11R6/bin,%{_desktopdir},%{_pixmapsdir}}
install *.info* $RPM_BUILD_ROOT%{_infodir}/
install %{SOURCE15} $RPM_BUILD_ROOT/etc/pam.d/smtp
+%{?with_saexim:install sa-exim-%{saexim_version}/sa-exim.conf $RPM_BUILD_ROOT/%{_sysconfdir}/mail/sa-exim.conf}
+
ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/sendmail
-ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_libdir}/sendmail
+ln -sf %{_bindir}/exim $RPM_BUILD_ROOT/usr/lib/sendmail
ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/mailq
ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rsmtp
ln -sf %{_bindir}/exim $RPM_BUILD_ROOT%{_sbindir}/rmail
%defattr(644,root,root,755)
%doc README* NOTICE LICENCE analyse-log-errors doc/{ChangeLog,NewStuff,dbm.discuss.txt,filter.txt,spec.txt,Exim*.upgrade,OptionLists.txt%{?with_exiscan:,exiscan-*.txt}} build-Linux-*/transport-filter.pl
%attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/exim.conf
+%{?with_saexim:%attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/sa-exim.conf}
%attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mail/aliases
%attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/exim
%attr( 644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/exim
%attr( 755,root,root) %{_bindir}/newaliases
%attr( 755,root,root) %{_bindir}/convert4r4
%attr( 755,root,root) %{_sbindir}/*
-%attr( 755,root,root) %{_libdir}/*
+%attr( 755,root,root) /usr/lib/sendmail
%attr( 754,root,root) /etc/cron.weekly/exim.cron.db
%attr( 750,exim,root) %dir %{_var}/log/exim
%attr( 750,exim,root) %dir %{_var}/log/archiv/exim
%attr( 640,exim,root) %ghost %{_var}/log/exim/*
-%attr( 640,root,root) /etc/pam.d/smtp
+%attr( 640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/pam.d/smtp
%{_infodir}/*
%{_mandir}/man8/*