postfix.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. %description
  51. Postfix is a new-generation Mail Transfer Agent (MTA) aimed to
  52. replace the Sendmail MTA.
  53. %prep
  54. %setup0 -q -c
  55. %setup1 -q -T -D -a 1
  56. %setup2 -q -T -D -a 2
  57. cd postfix-%{V_real}
  58. %{l_patch} -p1 < ../pfixtls-%{V_tls}/pfixtls.diff
  59. %build
  60. # build faked syslog(3) library
  61. fakesyslogdir="`pwd`/fakesyslog"
  62. ( cd fakesyslog
  63. CC="%{l_cc}" \
  64. CFLAGS="%{l_cflags -O}" \
  65. ./configure \
  66. --with-logfile=%{l_prefix}/var/postfix/postfix.log
  67. %{l_make} %{l_mflags}
  68. )
  69. # configure Postfix
  70. cd postfix-%{V_real}
  71. unset LD_LIBRARY_PATH || true
  72. CCARGS=""
  73. CCARGS="$CCARGS %{l_cflags -O}"
  74. CCARGS="$CCARGS -I%{l_prefix}/include"
  75. CCARGS="$CCARGS -DDEF_CONFIG_DIR=\\\\\\\"%{l_prefix}/etc/postfix\\\\\\\""
  76. CCARGS="$CCARGS -DHAS_DB -DHAS_SSL"
  77. AUXLIBS=""
  78. AUXLIBS="$AUXLIBS -L%{l_prefix}/lib -ldb -lssl -lcrypto"
  79. AUXLIBS="$AUXLIBS -L$fakesyslogdir -lfakesyslog"
  80. %{l_make} %{l_mflags} makefiles \
  81. CC="%{l_cc}" CCARGS="$CCARGS" AUXLIBS="$AUXLIBS"
  82. # build Postfix
  83. %{l_make} %{l_mflags -O}
  84. %install
  85. rm -rf $RPM_BUILD_ROOT
  86. # perform standard installation procedure
  87. ( cd postfix-%{V_real}
  88. %{l_rpmtool} subst "s;chown;true;" -- INSTALL.sh
  89. install_root=$RPM_BUILD_ROOT \
  90. config_directory=%{l_prefix}/etc/postfix \
  91. daemon_directory=%{l_prefix}/libexec/postfix \
  92. command_directory=%{l_prefix}/sbin \
  93. queue_directory=%{l_prefix}/var/postfix \
  94. sendmail_path=%{l_prefix}/sbin/sendmail \
  95. newaliases_path=%{l_prefix}/sbin/newaliases \
  96. mailq_path=%{l_prefix}/sbin/mailq \
  97. mail_user=%{l_fsusr} \
  98. manpages=%{l_prefix}/man \
  99. sh INSTALL.sh </dev/null
  100. )
  101. # post-adjust binaries
  102. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
  103. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
  104. $RPM_BUILD_ROOT%{l_prefix}/sbin/mailq
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  106. ln $RPM_BUILD_ROOT%{l_prefix}/sbin/sendmail \
  107. $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  108. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  109. strip $RPM_BUILD_ROOT%{l_prefix}/libexec/postfix/* >/dev/null 2>&1 || true
  110. # post-adjust configuration
  111. %{l_rpmtool} subst \
  112. "s;^\\(mail_owner[^=]*=\\).*;\\1 %{l_fsusr};" \
  113. -- $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/main.cf
  114. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/*.orig
  115. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/postfix/LICENSE
  116. # pre-create variable stuff
  117. ( cd $RPM_BUILD_ROOT%{l_prefix}/var/postfix
  118. %{l_shtool} mkdir -f -p -m 700 \
  119. active bounce corrupt defer deferred flush incoming private saved
  120. %{l_shtool} mkdir -f -p -m 755 \
  121. pid public queue
  122. %{l_shtool} install -c -m 755 \
  123. /dev/null postfix.log
  124. )
  125. # install run-command script
  126. %{l_shtool} mkdir -f -p -m 755 \
  127. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  128. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  129. %{SOURCE rc.postfix} \
  130. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  131. # generate file list
  132. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  133. %{l_files_std} \
  134. '%config %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix/*' \
  135. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/etc/postfix' \
  136. '%attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix/*' \
  137. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/libexec/postfix' \
  138. '%dir %attr(-,root,%{l_fsgrp}) %{l_prefix}/var/postfix'
  139. %files -f files
  140. %clean
  141. # rm -rf $RPM_BUILD_ROOT