浏览代码

upgrade to Postfix 20010228pl05

Ralf S. Engelschall 24 年之前
父节点
当前提交
8ffaa574d4
共有 1 个文件被更改,包括 161 次插入0 次删除
  1. 161 0
      postfix/postfix.spec

+ 161 - 0
postfix/postfix.spec

@@ -0,0 +1,161 @@
+##
+##  postfix.spec -- OpenPKG RPM Specification
+##  Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
+##  Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE. 
+##  
+
+%define       V_here    20010228pl05
+%define       V_real    20010228-pl05
+%define       V_tls     0.7.9-20010228-pl04-0.9.6b
+
+#   package information
+Name:         postfix
+Summary:      Mail Transfer Agent (MTA)
+Group:        Mail
+URL:          http://www.postfix.org/
+Vendor:       Wietse Venema
+Packager:     rse@openpkg.org
+Distribution: OpenPKG
+License:      GPL
+Version:      %{V_here}
+Release:      5
+
+#   list of sources
+Source0:      ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-%{V_real}.tar.gz
+Source1:      ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/pfixtls-%{V_tls}.tar.gz
+Source2:      ftp://ftp.openpkg.org/DST/postfix/fakesyslog.tar.gz
+Source3:      rc.postfix
+
+#   build information
+Prefix:       %{l_prefix}
+BuildRoot:    %{l_buildroot}
+BuildPreReq:  OpenPKG, openpkg >= 0.9-30, db, openssl
+PreReq:       OpenPKG, openpkg >= 0.9-30, db, openssl
+AutoReq:      no
+AutoReqProv:  no
+
+%description
+    Postfix is a new-generation Mail Transfer Agent (MTA) aimed to
+    replace the Sendmail MTA.
+
+%prep
+    %setup0 -q -c
+    %setup1 -q -T -D -a 1
+    %setup2 -q -T -D -a 2
+    cd postfix-%{V_real}
+    %{l_patch} -p1 < ../pfixtls-%{V_tls}/pfixtls.diff
+
+%build
+
+    #   build faked syslog(3) library
+    fakesyslogdir="`pwd`/fakesyslog"
+    ( cd fakesyslog
+      CC="%{l_cc}" \
+      CFLAGS="%{l_cflags -O}" \
+      ./configure \
+          --with-logfile=%{l_prefix}/var/postfix/postfix.log
+      %{l_make} %{l_mflags} 
+    )
+
+    #   configure Postfix
+    cd postfix-%{V_real}
+    unset LD_LIBRARY_PATH || true
+    CCARGS=""
+    CCARGS="$CCARGS %{l_cflags -O}"
+    CCARGS="$CCARGS -I%{l_prefix}/include"
+    CCARGS="$CCARGS -DDEF_CONFIG_DIR=\\\\\\\"%{l_prefix}/etc/postfix\\\\\\\""
+    CCARGS="$CCARGS -DHAS_DB -DHAS_SSL"
+    AUXLIBS=""
+    AUXLIBS="$AUXLIBS -L%{l_prefix}/lib -ldb -lssl -lcrypto"
+    AUXLIBS="$AUXLIBS -L$fakesyslogdir -lfakesyslog"
+    %{l_make} %{l_mflags} makefiles \
+        CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS"
+
+    #   build Postfix
+    %{l_make} %{l_mflags -O}
+
+%install
+    rm -rf $RPM_BUILD_ROOT
+
+    #   perform standard installation procedure
+    ( cd postfix-%{V_real}
+      %{l_rpmtool} subst "s;chown;true;" -- INSTALL.sh
+      install_root=$RPM_BUILD_ROOT \
+      config_directory=%{l_prefix}/etc/postfix \
+      daemon_directory=%{l_prefix}/libexec/postfix \
+      command_directory=%{l_prefix}/sbin \
+      queue_directory=%{l_prefix}/var/postfix \
+      sendmail_path=%{l_prefix}/sbin/sendmail \
+      newaliases_path=%{l_prefix}/sbin/newaliases \
+      mailq_path=%{l_prefix}/sbin/mailq \
+      mail_user=%{l_fsusr} \
+      manpages=%{l_prefix}/man \
+      sh INSTALL.sh </dev/null
+    )
+    
+    #   post-adjust binaries
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
+    ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
+       $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
+    ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
+       $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
+    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
+    strip $RPM_BUILD_ROOT%{l_prefix}/libexec/postfix/* >/dev/null 2>&1 || true
+
+    #   post-adjust configuration
+    %{l_rpmtool} subst \
+        "s;^\\(mail_owner[^=]*=\\).*;\\1 %{l_fsusr};" \
+        -- $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/main.cf
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/*.orig
+    rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/LICENSE
+
+    #   pre-create variable stuff
+    ( cd $RPM_BUILD_ROOT%{l_prefix}/var/postfix
+      %{l_shtool} mkdir -f -p -m 700 \
+          active bounce corrupt defer deferred flush incoming private saved
+      %{l_shtool} mkdir -f -p -m 755 \
+          pid public queue
+      %{l_shtool} install -c -m 755 \
+          /dev/null postfix.log
+    ) 
+
+    #   install run-command script
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
+    %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
+        %{SOURCE rc.postfix} \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+
+    #   generate file list
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix/*' \
+        '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix' \
+        '%attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix/*' \
+        '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix' \
+        '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/var/postfix'
+
+%files -f files
+
+%clean
+    # rm -rf $RPM_BUILD_ROOT
+