postfix.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ##
  2. ## postfix.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. %define V_here 20010228pl05
  25. %define V_real 20010228-pl05
  26. %define V_tls 0.7.9-20010228-pl04-0.9.6b
  27. # package information
  28. Name: postfix
  29. Summary: Mail Transfer Agent (MTA)
  30. Group: Mail
  31. URL: http://www.postfix.org/
  32. Vendor: Wietse Venema
  33. Packager: rse@openpkg.org
  34. Distribution: OpenPKG
  35. License: GPL
  36. Version: %{V_here}
  37. Release: 5
  38. # list of sources
  39. Source0: ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-%{V_real}.tar.gz
  40. Source1: ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/pfixtls-%{V_tls}.tar.gz
  41. Source2: ftp://ftp.openpkg.org/DST/postfix/fakesyslog.tar.gz
  42. Source3: rc.postfix
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 0.9-30, db, openssl
  47. PreReq: OpenPKG, openpkg >= 0.9-30, db, openssl
  48. AutoReq: no
  49. AutoReqProv: no
  50. Provides: MTA
  51. %description
  52. Postfix is a new-generation Mail Transfer Agent (MTA) aimed to
  53. replace the Sendmail MTA.
  54. %prep
  55. %setup0 -q -c
  56. %setup1 -q -T -D -a 1
  57. %setup2 -q -T -D -a 2
  58. cd postfix-%{V_real}
  59. %{l_patch} -p1 < ../pfixtls-%{V_tls}/pfixtls.diff
  60. %build
  61. # build faked syslog(3) library
  62. fakesyslogdir="`pwd`/fakesyslog"
  63. ( cd fakesyslog
  64. CC="%{l_cc}" \
  65. CFLAGS="%{l_cflags -O}" \
  66. ./configure \
  67. --with-logfile=%{l_prefix}/var/postfix/postfix.log
  68. %{l_make} %{l_mflags}
  69. )
  70. # configure Postfix
  71. cd postfix-%{V_real}
  72. unset LD_LIBRARY_PATH || true
  73. CCARGS=""
  74. CCARGS="$CCARGS %{l_cflags -O}"
  75. CCARGS="$CCARGS -I%{l_prefix}/include"
  76. CCARGS="$CCARGS -DDEF_CONFIG_DIR=\\\\\\\"%{l_prefix}/etc/postfix\\\\\\\""
  77. CCARGS="$CCARGS -DHAS_DB -DHAS_SSL"
  78. AUXLIBS=""
  79. AUXLIBS="$AUXLIBS -L%{l_prefix}/lib -ldb -lssl -lcrypto"
  80. AUXLIBS="$AUXLIBS -L$fakesyslogdir -lfakesyslog"
  81. %{l_make} %{l_mflags} makefiles \
  82. CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS"
  83. # build Postfix
  84. %{l_make} %{l_mflags -O}
  85. %install
  86. rm -rf $RPM_BUILD_ROOT
  87. # perform standard installation procedure
  88. ( cd postfix-%{V_real}
  89. %{l_rpmtool} subst "s;chown;true;" -- INSTALL.sh
  90. install_root=$RPM_BUILD_ROOT \
  91. config_directory=%{l_prefix}/etc/postfix \
  92. daemon_directory=%{l_prefix}/libexec/postfix \
  93. command_directory=%{l_prefix}/sbin \
  94. queue_directory=%{l_prefix}/var/postfix \
  95. sendmail_path=%{l_prefix}/sbin/sendmail \
  96. newaliases_path=%{l_prefix}/sbin/newaliases \
  97. mailq_path=%{l_prefix}/sbin/mailq \
  98. mail_user=%{l_fsusr} \
  99. manpages=%{l_prefix}/man \
  100. sh INSTALL.sh </dev/null
  101. )
  102. # post-adjust binaries
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
  104. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
  105. $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  107. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
  108. $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  109. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  110. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/postfix/* >/dev/null 2>&1 || true
  111. # post-adjust configuration
  112. %{l_rpmtool} subst \
  113. "s;^\\(mail_owner[^=]*=\\).*;\\1 %{l_fsusr};" \
  114. -- $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/main.cf
  115. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/*.orig
  116. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/LICENSE
  117. # pre-create variable stuff
  118. ( cd $RPM_BUILD_ROOT%{l_prefix}/var/postfix
  119. %{l_shtool} mkdir -f -p -m 700 \
  120. active bounce corrupt defer deferred flush incoming private saved
  121. %{l_shtool} mkdir -f -p -m 755 \
  122. pid public queue
  123. %{l_shtool} install -c -m 755 \
  124. /dev/null postfix.log
  125. )
  126. # install run-command script
  127. %{l_shtool} mkdir -f -p -m 755 \
  128. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  129. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  130. %{SOURCE rc.postfix} \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  132. # generate file list
  133. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  134. %{l_files_std} \
  135. '%config %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix/*' \
  136. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix' \
  137. '%attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix/*' \
  138. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix' \
  139. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/var/postfix'
  140. %files -f files
  141. %clean
  142. # rm -rf $RPM_BUILD_ROOT