exim.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## exim.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: exim
  27. Summary: Exim Mail Transfer Agent
  28. URL: http://www.exim.org/
  29. Vendor: Philip Hazel
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Mail
  33. License: GPL
  34. Version: 4.20
  35. Release: 20030717
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.csx.cam.ac.uk/pub/software/email/exim/exim4/exim-%{version}.tar.bz2
  40. Source1: exim-man.tar.gz
  41. Source2: rc.exim
  42. Source3: fsl.exim
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 20030717, perl, gzip, tar
  47. PreReq: OpenPKG, openpkg >= 20030717, perl, gzip
  48. BuildPreReq: openssl, db >= 4.1.24
  49. PreReq: openssl, db >= 4.1.24
  50. %if "%{with_fsl}" == "yes"
  51. BuildPreReq: fsl >= 1.2.0
  52. PreReq: fsl >= 1.2.0
  53. %endif
  54. AutoReq: no
  55. AutoReqProv: no
  56. Provides: MTA
  57. Conflicts: sendmail, postfix, ssmtp
  58. %description
  59. Exim is a message transfer agent (MTA) developed at the University
  60. of Cambridge for use on Unix systems connected to the Internet.
  61. In style it is similar to Smail 3, but its facilities are more
  62. extensive, and in particular it has some defences against mail
  63. bombs and unsolicited junk mail in the form of options for refusing
  64. messages from particular hosts, networks, or senders. It can be
  65. installed in place of sendmail, although the configuration of Exim
  66. is quite different to that of Sendmail.
  67. %prep
  68. %setup -q
  69. %{l_gzip} -d -c %{SOURCE exim-man.tar.gz} | %{l_tar} xvf -
  70. %build
  71. cp src/EDITME Local/Makefile
  72. ( echo 'CC=%{l_cc}'
  73. echo 'CFLAGS=%{l_cflags -O}'
  74. echo 'LDFLAGS=%{l_fsl_ldflags}'
  75. echo 'LIBS+=%{l_fsl_libs}'
  76. echo 'EXIM_UID=%{l_muid}'
  77. echo 'EXIM_GID=%{l_mgid}'
  78. echo 'EXIM_USER=%{l_nusr}'
  79. echo 'EXIM_GROUP=%{l_ngrp}'
  80. echo 'LOG_FILE_PATH=%{l_prefix}/var/exim/log/%s.log'
  81. echo 'PID_FILE_PATH=%{l_prefix}/var/exim/run/%s.pid'
  82. echo 'SPOOL_DIRECTORY=%{l_prefix}/var/exim/spool'
  83. echo 'INFO_DIRECTORY=%{l_prefix}/info'
  84. echo 'SUPPORT_MOVE_FROZEN_MESSAGES=yes'
  85. echo 'SUPPORT_TLS=yes'
  86. echo 'TLS_INCLUDE=%{l_cppflags}'
  87. echo 'TLS_LIBS=%{l_ldflags} -lssl -lcrypto'
  88. echo 'TRANSPORT_LMTP=yes'
  89. echo 'INCLUDE=%{l_cppflags}'
  90. echo 'DBMLIB=%{l_ldflags} -ldb'
  91. echo 'USE_DB=yes'
  92. echo 'PERL_COMMAND=%{l_prefix}/bin/perl'
  93. echo 'CHOWN_COMMAND=true'
  94. echo 'NO_SYMLINK=yes'
  95. ) >>Local/Makefile
  96. %{l_shtool} subst \
  97. -e 's;^\(BIN_DIRECTORY=\).*;\1%{l_prefix}/bin;' \
  98. -e 's;^\(COMPRESS_COMMAND=\).*;\1%{l_prefix}/bin/gzip;' \
  99. -e 's;^\(ZCAT_COMMAND=\).*;\1%{l_prefix}/bin/zcat;' \
  100. -e 's;^\(CONFIGURE_FILE=\).*;\1%{l_prefix}/etc/exim/exim.conf;' \
  101. -e 's;^\(EXIM_MONITOR=.*\);#\1;' \
  102. Local/Makefile
  103. %{l_shtool} subst \
  104. -e 's;^\(CHOWN_COMMAND=\).*;\1true;' \
  105. OS/Makefile-`uname`
  106. make="%{l_make}"
  107. mflags="%{l_mflags}"
  108. case "%{l_target}" in
  109. *-freebsd* ) make="make"; mflags=""; PATH="/usr/bin:$PATH" ;;
  110. esac
  111. $make $mflags makefile
  112. $make $mflags
  113. %install
  114. rm -rf $RPM_BUILD_ROOT
  115. %{l_shtool} mkdir -f -p -m 755 \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  117. $RPM_BUILD_ROOT%{l_prefix}/bin \
  118. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  119. $RPM_BUILD_ROOT%{l_prefix}/etc/exim \
  120. $RPM_BUILD_ROOT%{l_prefix}/var/exim \
  121. $RPM_BUILD_ROOT%{l_prefix}/var/exim/run \
  122. $RPM_BUILD_ROOT%{l_prefix}/var/exim/log \
  123. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  124. %{l_shtool} install -c -m 644 \
  125. exim-man/*.8 $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  126. INST_CHOWN=true; export INST_CHOWN
  127. INST_BIN_DIRECTORY=$RPM_BUILD_ROOT%{l_prefix}/bin; export INST_BIN_DIRECTORY
  128. INST_CONFIGURE_FILE=$RPM_BUILD_ROOT%{l_prefix}/etc/exim/exim.conf; export INST_CONFIGURE_FILE
  129. INST_INFO_DIRECTORY=$RPM_BUILD_ROOT%{l_prefix}/info; export INST_INFO_DIRECTORY
  130. make="%{l_make}"
  131. mflags="%{l_mflags}"
  132. case "%{l_target}" in
  133. *-freebsd* ) make="make"; mflags=""; PATH="/usr/bin:$PATH" ;;
  134. esac
  135. $make $mflags install
  136. mv $RPM_BUILD_ROOT%{l_prefix}/bin/exim-%{version}* \
  137. $RPM_BUILD_ROOT%{l_prefix}/bin/exim
  138. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  139. ( cd $RPM_BUILD_ROOT%{l_prefix}/sbin
  140. ln -s ../bin/exim sendmail
  141. ln -s ../bin/exim mailq
  142. ln -s ../bin/exim rmail
  143. )
  144. ( echo "#!/bin/sh"
  145. echo "%{l_prefix}/sbin/sendmail -bi"
  146. ) >$RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  147. chmod 755 $RPM_BUILD_ROOT%{l_prefix}/sbin/newaliases
  148. # install run-command script
  149. %{l_shtool} mkdir -f -p -m 755 \
  150. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  151. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  152. %{SOURCE rc.exim} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  153. # install OSSP fsl configuration
  154. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  155. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  156. %{SOURCE fsl.exim} \
  157. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  158. # determine installation files
  159. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  160. %{l_files_std} \
  161. '%not %dir %{l_prefix}/etc/fsl' \
  162. '%config %{l_prefix}/etc/fsl/fsl.exim' \
  163. '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/bin/exim'
  164. %files -f files
  165. %clean
  166. rm -rf $RPM_BUILD_ROOT