+# Conditional build:
+# bcond_on_pgsql - build wihtout PostgreSQ support
+# bcond_on_mysql - build with MySQL support
+# bcond_off_ldap - build without LDAP support
+
Summary: University of Cambridge Mail Transfer Agent
Summary(pl): Agent Transferu Poczty Uniwersytetu w Cambridge
Name: exim
-Version: 3.16
+Version: 3.22
Release: 2
License: GPL
Group: Networking/Daemons
Group(de): Netzwerkwesen/Server
Group(pl): Sieciowe/Serwery
-Source0: ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-%{version}.tar.gz
-Source1: ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-texinfo-3.10.tar.gz
+Source0: ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-%{version}.tar.bz2
+Source1: ftp://ftp.cus.cam.ac.uk/pub/software/programs/exim/%{name}-texinfo-3.20.tar.bz2
Source2: %{name}.init
Source3: %{name}.cron.db
Source4: %{name}.8
Patch1: %{name}-monitor-EDITME.patch
Patch2: %{name}-texinfo.patch
Patch3: %{name}-use_system_pcre.patch
+Patch4: %{name}-Makefile-Default.patch
URL: http://www.exim.org/
-BuildRequires: openldap-devel
+%{!?bcond_off_ldap:BuildRequires: openldap-devel >= 2.0.0}
+%{?bcond_on_mysql:BuildRequires: mysql-devel}
+%{?bcond_on_pgsql:BuildRequires: postgresql-devel}
+BuildRequires: XFree86-devel
BuildRequires: texinfo
BuildRequires: perl
BuildRequires: pam-devel
BuildRequires: pcre-devel
BuildRequires: db3-devel
+BuildRequires: openssl-devel
Provides: smtpdaemon
Prereq: /usr/sbin/useradd
Prereq: /usr/sbin/groupadd
administracyjny.
%prep
-#%set_MAIL qwe
-#exit 1
%setup -q -T -b 0
%setup -q -T -D -a 1
%patch1 -p1
%patch2 -p0
%patch3 -p1
+%patch4 -p1
install %{SOURCE14} doc/FAQ.txt.gz
install %{SOURCE15} doc/config.samples.tar.gz
cp exim_monitor/EDITME Local/eximon.conf
%build
-%{__make} CFLAGS="%{!?debug:$RPM_OPT_FLAGS}%{?debug:-O -g}"
+%{__make} CFLAGS="%{?debug:-O0 -g}%{!?debug:$RPM_OPT_FLAGS}" \
+ %{?bcond_on_mysql:LOOKUP_MYSQL=yes} \
+ %{?bcond_on_pgsql:LOOKUP_PGSQL=yes} \
+ %{!?bcond_off_ldap:LOOKUP_LDAP=yes LDAP_LIB_TYPE=OPENLDAP2} \
+ LOOKUP_LIBS="%{!?bcond_off_ldap:-lldap -llber} %{?bcond_on_mysql:-lmysqlclient} %{?bcond_on_pgsql:-lpq}" \
+ LOOKUP_INCLUDE="%{?bcond_on_mysql:-I/usr/include/mysql} %{?bcond_on_pgsql:-I/usr/include/pgsql}"
makeinfo exim-texinfo-*/doc/{oview,spec,filter}.texinfo
doc/{ChangeLog,NewStuff,dbm.discuss.txt,filter.txt,oview.txt,spec.txt}
%pre
-/usr/sbin/groupadd -g 79 -r -f exim
-if [ -n "`id -u exim 2>/dev/null`" ]; then
+if [ -n "`/usr/bin/getgid exim`" ]; then
+ if [ "`getgid exim`" != "79" ]; then
+ echo "Warning: group exim haven't gid=79. Corect this before install exim" 1>&2
+ exit 1
+ fi
+else
+ /usr/sbin/groupadd -g 79 -r -f exim
+fi
+
+if [ -n "`/bin/id -u exim 2>/dev/null`" ]; then
if [ "`id -u exim`" != "79" ]; then
echo "Warning: user exim doesn't have uid=79. Corect this before installing Exim" 1>&2
exit 1
fi
else
/usr/sbin/useradd -u 79 -r -d /var/spool/exim -s /bin/false -c "Exim pseudo user" -g exim exim 1>&2
- if [ -f /var/db/passwd.db ]; then
- /usr/bin/update-db 1>&2
- fi
fi
+
%post
umask 022
/sbin/chkconfig --add %{name}
-if [ -r /var/run/exim*.pid ]; then
+if [ -f /var/lock/subsys/exim ]; then
/etc/rc.d/init.d/%{name} restart >&2
else
echo "Run \"/etc/rc.d/init.d/%{name} start\" to start exim daemon."
%preun
if [ "$1" = "0" ]; then
+ if [ -f /var/lock/subsys/exim ]; then
+ /etc/rc.d/init.d/exim stop >&2
+ fi
/sbin/chkconfig --del %{name}
- /etc/rc.d/init.d/%{name} stop >&2
fi
%postun
%attr( 644,root,root) /etc/logrotate.d/exim
%attr( 754,root,root) /etc/rc.d/init.d/exim
%attr(4755,root,root) %{_bindir}/exim
-%attr( 775,root,mail) %dir %{_var}/mail
-%attr( 700,exim,root) %dir %{_var}/spool/exim
+%attr(1777,root,mail) %dir %{_var}/mail
+%attr( 770,root,exim) %dir %{_var}/spool/exim
%attr( 750,exim,exim) %dir %{_var}/spool/exim/db
%attr( 700,exim,root) %dir %{_var}/spool/exim/input
%attr( 750,exim,root) %dir %{_var}/spool/exim/msglog