diff --git a/sendmail/sendmail.spec b/sendmail/sendmail.spec index c045f298c8..5b61b2f064 100644 --- a/sendmail/sendmail.spec +++ b/sendmail/sendmail.spec @@ -24,9 +24,10 @@ ## # TODO: -# 1 Add fakesyslog library -# 2 User and group ids in file list must be reviewed -# 3 Test, test, and more test (also with smtpfeed) +# 1 Link to fsl(3) and don't just build it +# 2 User, group ids in %files must be reviewed +# 3 Fix sys_nerr on Linux platforms +# 4 Test alot (also with smtpfeed) # # Bugs: # 1 All mitgelieferte config files use 8.11.6 options @@ -36,6 +37,11 @@ # README file in the mail.local directory. You can force # the install using 'Build force-install'. +# package options +%ifndef with_fsl +%define with_fsl no +%endif + # package information Name: sendmail Summary: Mail Transfer Agent @@ -50,15 +56,21 @@ Release: 20020809 # list of sources Source0: ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{version}.tar.gz -Source1: etc.sendmail.tar -Source2: cf.tar -Source2: rc.sendmail +Source1: ftp://ftp.openpkg.org/DST/inn/fakesyslog.tar.gz +Source2: fsl.sendmail +Source3: etc.sendmail.tar +Source4: cf.tar +Source5: rc.sendmail # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 20020206, m4, make, db, openssl, sfio PreReq: OpenPKG, openpkg >= 20020206, m4, make, perl, procmail +%if "%{with_fsl}" == "yes" +BuildPreReq: fsl +PreReq: fsl +%endif AutoReq: no AutoReqProv: no Provides: MTA @@ -76,7 +88,10 @@ Conflicts: ssmtp %prep # unpack standard tarballs %setup0 -q -c +%if "%{with_fsl}" != "yes" %setup1 -q -T -D -a 1 +%endif + %setup3 -q -T -D -a 3 # add own M4 stuff to Sendmail configuration set ( cd sendmail-%{version} @@ -84,7 +99,21 @@ Conflicts: ssmtp ) %build - PATH="%{l_prefix}/bin:$PATH"; export PATH + # make sure sendmail finds its own files + PATH="%{l_prefix}/bin:$PATH" + export PATH + + # build faked syslog(3) library +%if "%{with_fsl}" != "yes" + fakesyslogdir="`pwd`/fakesyslog" + ( cd fakesyslog + CC="%{l_cc}" \ + CFLAGS="%{l_cflags -O} -I%{l_prefix}/include" \ + ./configure \ + --with-logfile=%{l_prefix}/var/sendmail/log/sendmail.log + %{l_make} %{l_mflags} + ) +%endif # build Sendmail ( cd sendmail-%{version} @@ -192,6 +221,16 @@ Conflicts: ssmtp MSPQ=%{l_prefix}$MSPQ MAILDIR=%{l_prefix} mv $RPM_BUILD_ROOT%{l_prefix}/bin/rmail \ $RPM_BUILD_ROOT%{l_prefix}/sbin/rmail + + # install optional OSSP fsl support +%if "%{with_fsl}" == "yes" + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl + %{l_shtool} install -c -m 644 \ + -e 's;@l_prefix@;%{l_prefix};g' \ + %{SOURCE fsl.sendmail} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ +%endif + # remember the Sendmail M4 stuff for re-configuration (%{l_tar} cf $RPM_BUILD_ROOT%{l_prefix}/etc/sendmail/cf.tar cf) compress $RPM_BUILD_ROOT%{l_prefix}/etc/sendmail/cf.tar @@ -264,6 +303,10 @@ Conflicts: ssmtp '%config %attr(644,root,%{l_mgrp}) %{l_prefix}/etc/sendmail/ca.crt' \ '%config %attr(644,root,%{l_mgrp}) %{l_prefix}/etc/sendmail/sendmail.crt' \ '%config %attr(600,root,%{l_mgrp}) %{l_prefix}/etc/sendmail/sendmail.key' \ +%if "%{with_fsl}" == "yes" + '%config %{l_prefix}/etc/fsl/fsl.sendmail' \ + '%not %dir %{l_prefix}/etc/fsl' \ +%endif '%attr(700,root,%{l_mgrp}) %{l_prefix}/var/sendmail/mqueue' \ '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/sendmail/clientmqueue' \ '%attr(644,root,%{l_mgrp}) %{l_prefix}/var/sendmail/sendmail.log' \