Explorar o código

add OSSP fsl support to Postfix

Ralf S. Engelschall %!s(int64=24) %!d(string=hai) anos
pai
achega
73c3086e20
Modificáronse 2 ficheiros con 44 adicións e 0 borrados
  1. 16 0
      postfix/fsl.postfix
  2. 28 0
      postfix/postfix.spec

+ 16 - 0
postfix/fsl.postfix

@@ -0,0 +1,16 @@
+##
+##  fsl.postfix -- OSSP fsl configuration for Postfix
+##
+
+ident (postfix/.+)/.+ q{
+    prefix(
+        prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
+    ) 
+    -> {
+        debug: file(
+            path="@l_prefix@/var/postfix/log/postfix.log",
+            append=1, perm=0644
+        )
+    }
+}
+

+ 28 - 0
postfix/postfix.spec

@@ -35,6 +35,9 @@
 %ifndef       with_sasl
 %define       with_sasl   no
 %endif
+%ifndef       with_fsl
+%define       with_fsl    no
+%endif
 
 #   package information
 Name:         postfix
@@ -56,6 +59,7 @@ Source3:      etc.tar
 Source4:      http://jimsun.linxnet.com/downloads/pflogsumm-%{V_pflogsumm}.pl
 Source5:      rc.postfix
 Source6:      postfix-sasl2.patch
+Source7:      fsl.postfix
 
 #   build information
 Prefix:       %{l_prefix}
@@ -70,6 +74,10 @@ BuildPreReq:  openssl, patch
 BuildPreReq:  sasl
 PreReq:       sasl
 %endif
+%if "%{with_fsl}" == "yes"
+BuildPreReq:  fsl
+PreReq:       fsl
+%endif
 AutoReq:      no
 AutoReqProv:  no
 Provides:     MTA
@@ -121,6 +129,7 @@ Provides:     MTA
 %build
 
     #   build faked syslog(3) library
+%if "%{with_fsl}" != "yes"
     fakesyslogdir="`pwd`/fakesyslog"
     ( cd fakesyslog
       CC="%{l_cc}" \
@@ -129,6 +138,7 @@ Provides:     MTA
           --with-logfile=%{l_prefix}/var/postfix/log/postfix.log
       %{l_make} %{l_mflags}
     )
+%endif
 
     #   configure Postfix
     cd postfix-%{V_postfix}
@@ -154,7 +164,11 @@ Provides:     MTA
         AUXLIBS="$AUXLIBS -ldl"
     fi
 %endif
+%if "%{with_fsl}" == "yes"
+    AUXLIBS="$AUXLIBS `%{l_prefix}/bin/fsl-config --all --ldflags --libs`"
+%else
     AUXLIBS="$AUXLIBS -L$fakesyslogdir -lfakesyslog"
+%endif
     %{l_make} %{l_mflags} makefiles \
         CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS"
 
@@ -250,6 +264,16 @@ Provides:     MTA
         -e 's;@l_mgrp@;%{l_mgrp};g' \
         %{SOURCE rc.postfix} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
 
+    #   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.postfix} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+%endif
+
     #   adjust installation to avoid file name conflicts
     ( cd $RPM_BUILD_ROOT%{l_prefix}/man/man8
       mv master.8 postfix_master.8
@@ -259,6 +283,10 @@ Provides:     MTA
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
         %{l_files_std} \
         '%attr(-,root,%{l_mgrp}) %{l_prefix}/etc/postfix' \
+%if "%{with_fsl}" == "yes"
+        '%config %{l_prefix}/etc/fsl/fsl.postfix' \
+        '%not %dir %{l_prefix}/etc/fsl' \
+%endif
         '%config %attr(-,root,%{l_mgrp}) %{l_prefix}/etc/postfix/*' \
         '%attr(-,root,%{l_mgrp}) %{l_prefix}/libexec/postfix/*' \
         '%attr(2755,%{l_musr},%{l_rgrp}) %{l_prefix}/sbin/{postdrop,postqueue}' \