## ## postfix.spec -- OpenPKG RPM Specification ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH ## Copyright (c) 2000-2001 Ralf S. Engelschall ## ## 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 20010228.5 %define V_real 20010228-pl05 %define V_tls 0.7.9-20010228-pl04-0.9.6b %define V_pflogsumm 1.0.3 # package information Name: postfix Summary: Mail Transfer Agent (MTA) URL: http://www.postfix.org/ Vendor: Wietse Venema Packager: The OpenPKG Project Distribution: OpenPKG [EXP] Group: Mail License: GPL Version: %{V_here} Release: 11 # 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: http://jimsun.linxnet.com/downloads/pflogsumm-%{V_pflogsumm}.pl Source4: rc.postfix # build information Prefix: %{l_prefix} BuildRoot: %{l_buildroot} BuildPreReq: OpenPKG, openpkg >= 0.9-33, db, openssl, perl >= 5.6.1-10, pcre, patch PreReq: OpenPKG, openpkg >= 0.9-33, db, openssl, perl >= 5.6.1-10, pcre AutoReq: no AutoReqProv: no Provides: MTA %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 %{l_rpmtool} subst \ 's/var_config_dir, /var_command_dir, /' \ -- src/postfix/postfix.c %{l_rpmtool} subst \ 's;config_directory/postfix-script;command_directory/postfix-script;' \ -- conf/postfix-script* %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/log/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_PCRE -DHAS_DB -DHAS_SSL" AUXLIBS="" AUXLIBS="$AUXLIBS -L%{l_prefix}/lib -ldb -lssl -lcrypto -lpcre" 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 \ setgid=no \ sh INSTALL.sh /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 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/install.cf mv $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/postfix-script \ $RPM_BUILD_ROOT%{l_prefix}/sbin/postfix-script rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/postfix-script* ( cd $RPM_BUILD_ROOT%{l_prefix}/etc/postfix %{l_shtool} mkdir -f -p -m 755 sample for cfg in access aliases canonical pcre_table regexp_table \ relocated sample-* transport virtual main.cf.default; do mv $cfg sample/ done ) # 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 \ log pid public queue %{l_shtool} install -c -m 755 \ /dev/null log/postfix.log %{l_shtool} install -c -m 755 \ /dev/null log/postfix.sum ) # install addons %{l_shtool} install -c -m 755 \ -e 's;/usr/bin/perl;%{l_prefix}/bin/perl;g' \ %{SOURCE3} $RPM_BUILD_ROOT%{l_prefix}/sbin/pflogsumm # 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' \ -e 's;@l_fsusr@;%{l_fsusr};g' \ -e 's;@l_fsgrp@;%{l_fsgrp};g' \ %{SOURCE4} $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/*.cf' \ '%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 %preun $RPM_INSTALL_PREFIX/sbin/postfix stop rm -rf $RPM_INSTALL_PREFIX/etc/postfix/prng_exch rm -rf $RPM_INSTALL_PREFIX/var/postfix/pid/* rm -rf $RPM_INSTALL_PREFIX/var/postfix/private/* rm -rf $RPM_INSTALL_PREFIX/var/postfix/public/*