milter.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ##
  2. ## milter.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://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. # package version
  25. %define V_libmilter 8.13.8
  26. %define V_sendmail_pmilter 0.95
  27. %define V_mail_milter 0.07
  28. # package information
  29. Name: milter
  30. Summary: Mail Filtering API
  31. URL: http://www.milter.org/
  32. Vendor: Eric Allman, Todd Vierling
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: EVAL
  36. Group: Mail
  37. License: BSD/Artistic
  38. Version: %{V_libmilter}
  39. Release: 20061228
  40. # package options
  41. %option with_perl no
  42. # list of sources
  43. Source0: ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{V_libmilter}.tar.gz
  44. Source1: http://switch.dl.sourceforge.net/sourceforge/pmilter/Sendmail-PMilter-%{V_sendmail_pmilter}.tar.gz
  45. Source2: http://switch.dl.sourceforge.net/sourceforge/pmilter/Mail-Milter-%{V_mail_milter}.tar.gz
  46. Source3: milter.pc
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20060823
  51. PreReq: OpenPKG, openpkg >= 20060823
  52. %if "%{with_perl}" == "yes"
  53. BuildPreReq: perl, perl-openpkg
  54. PreReq: perl
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. MILTER is the mail and SMTP protocol filtering API developed with
  60. the Sendmail 8 MTA. This package provides Sendmail's original
  61. client-side C API (libmilter) and optionally the alternative
  62. client-side Perl APIs (Sendmail::Milter, Sendmail::PMilter,
  63. Mail::Milter).
  64. %track
  65. prog milter:libmilter = {
  66. version = %{V_libmilter}
  67. url = ftp://ftp.sendmail.org/pub/sendmail/
  68. regex = sendmail.(\d+\.\d+\.\d+)\.tar\.gz
  69. }
  70. prog milter:Sendmail-PMilter = {
  71. version = %{V_sendmail_pmilter}
  72. url = http://prdownloads.sourceforge.net/pmilter/
  73. regex = Sendmail-PMilter-(__VER__)\.tar\.gz
  74. }
  75. prog milter:Mail-Milter = {
  76. version = %{V_mail_milter}
  77. url = http://prdownloads.sourceforge.net/pmilter/
  78. regex = Mail-Milter-(__VER__)\.tar\.gz
  79. }
  80. %prep
  81. %setup -q -c
  82. %if "%{with_perl}" == "yes"
  83. %setup -q -T -D -a 1
  84. %setup -q -T -D -a 2
  85. %endif
  86. %build
  87. # build C API
  88. ( cd sendmail-%{V_libmilter}
  89. extlibs="%{l_fsl_libs} -ldb"
  90. case "%{l_platform -t}" in
  91. *-sunos* ) extlibs="$extlibs -lrt" ;;
  92. esac
  93. ( echo "define(\`confCC', \`%{l_cc} %{l_cflags}')dnl"
  94. echo "APPENDDEF(\`confINCDIRS', \`%{l_cppflags}')dnl"
  95. echo "APPENDDEF(\`confLIBDIRS', \`%{l_ldflags}')dnl"
  96. echo "APPENDDEF(\`confLIBS', \`$extlibs')dnl"
  97. echo "define(\`confSTDIO_TYPE', \`portable')dnl"
  98. echo "APPENDDEF(\`conf_sendmail_ENVDEF', \`-DMILTER=1')dnl"
  99. echo "APPENDDEF(\`conf_libmilter_ENVDEF', \`-D_FFR_MILTER_ROOT_UNSAFE')dnl"
  100. ) >devtools/Site/site.config.m4
  101. ( cd libmilter
  102. ./Build
  103. ) || exit $?
  104. ) || exit $?
  105. # build Perl API
  106. %if "%{with_perl}" == "yes"
  107. %{l_prefix}/bin/perl-openpkg prepare
  108. %{l_prefix}/bin/perl-openpkg -d Sendmail-PMilter-%{V_sendmail_pmilter} configure build
  109. %{l_prefix}/bin/perl-openpkg -d Mail-Milter-%{V_mail_milter} configure build
  110. %endif
  111. %install
  112. rm -rf $RPM_BUILD_ROOT
  113. # install C API
  114. ( cd sendmail-%{V_libmilter}
  115. %{l_shtool} mkdir -f -p -m 755 \
  116. $RPM_BUILD_ROOT%{l_prefix}/include/milter \
  117. $RPM_BUILD_ROOT%{l_prefix}/lib/milter
  118. %{l_shtool} install -c -m 644 \
  119. include/libmilter/*.h \
  120. $RPM_BUILD_ROOT%{l_prefix}/include/milter/
  121. %{l_shtool} install -c -m 644 \
  122. obj.*/libmilter/libmilter.a \
  123. $RPM_BUILD_ROOT%{l_prefix}/lib/
  124. ) || exit $?
  125. libs=`grep "^LDOPTS=" sendmail-%{V_libmilter}/obj.*/libmilter/Makefile | sed -e 's;^LDOPTS=;;'`
  126. libs="$libs -lmilter"
  127. case "%{l_platform -t}" in
  128. *-sunos* ) libs="$libs -lrt" ;;
  129. esac
  130. %{l_shtool} mkdir -f -p -m 755 \
  131. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  132. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  133. -e "s;@version@;%{version};" \
  134. -e "s;@libs@;$libs;" \
  135. %{SOURCE milter.pc} $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  136. # install Perl API
  137. %if "%{with_perl}" == "yes"
  138. %{l_prefix}/bin/perl-openpkg -d Sendmail-PMilter-%{V_sendmail_pmilter} install
  139. %{l_prefix}/bin/perl-openpkg -d Mail-Milter-%{V_mail_milter} install
  140. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  141. %else
  142. >perl-openpkg-files
  143. %endif
  144. # determine installation files
  145. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  146. %{l_files_std} `cat perl-openpkg-files`
  147. %files -f files
  148. %clean
  149. rm -rf $RPM_BUILD_ROOT