mimedefang.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. ##
  2. ## mimedefang.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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 versions
  26. %define V_mimedefang 2.44
  27. %define V_mime_tools 5.411a-RP-Patched-02
  28. # package information
  29. Name: mimedefang
  30. Summary: Mail Processing Filter for Sendmail
  31. URL: http://www.mimedefang.org/
  32. Vendor: Roaring Penguing Software
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: Mail
  37. License: GPL
  38. Version: %{V_mimedefang}
  39. Release: 20040716
  40. # package options
  41. %option with_clamav no
  42. # list of sources
  43. Source0: http://www.mimedefang.org/static/mimedefang-%{V_mimedefang}.tar.gz
  44. Source1: http://www.mimedefang.org/static/MIME-tools-%{V_mime_tools}.tar.gz
  45. Source2: rc.mimedefang
  46. Patch0: mimedefang.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  51. PreReq: OpenPKG, openpkg >= 20040130
  52. BuildPreReq: sendmail > 8.12.0, perl, perl-mail, perl-crypto, perl-ds
  53. PreReq: sendmail > 8.12.0, perl, perl-mail, perl-crypto, perl-ds
  54. %if "%{with_clamav}" == "yes"
  55. BuildPreReq: clamav
  56. PreReq: clamav
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. MIMEDefang is a framework for filtering e-mail. It uses Sendmail's
  62. "Milter" API, some C glue code, and some Perl code to let you write
  63. high-performance mail filters in Perl.
  64. %track
  65. prog mimedefang = {
  66. version = %{V_mimedefang}
  67. url = http://www.mimedefang.org/node.php?id=1
  68. regex = mimedefang-(\d+\.\d+)\.tar\.gz
  69. }
  70. prog mimedefang:MIME-tools = {
  71. version = %{V_mime_tools}
  72. url = http://www.mimedefang.org/node.php?id=1
  73. regex = MIME-tools-(.+?)\.tar\.gz
  74. }
  75. %prep
  76. %setup -q
  77. %setup -q -T -D -a 1
  78. %patch -p0
  79. %build
  80. # configure program
  81. %{l_shtool} subst \
  82. -e 's,use warnings,use warnings; use lib "%{l_prefix}/lib/mimedefang",g' \
  83. mimedefang.pl.in
  84. CC="%{l_cc}" \
  85. CFLAGS="%{l_cflags} %{l_cppflags}" \
  86. CPPFLAGS="%{l_cppflags}" \
  87. LDFLAGS="%{l_ldflags}" \
  88. ./configure \
  89. --cache-file=./config.cache \
  90. --prefix=%{l_prefix} \
  91. --sysconfdir=%{l_prefix}/etc/mimedefang \
  92. --with-confsubdir="" \
  93. %if "%{with_clamav}" == "yes"
  94. --enable-clamav \
  95. --enable-clamd \
  96. --disable-antivir \
  97. --disable-vexira\
  98. --disable-uvscan \
  99. --disable-bdc \
  100. --disable-sweep \
  101. --disable-trend \
  102. --disable-AvpLinux \
  103. --disable-aveclient \
  104. --disable-clamav \
  105. --disable-fsav \
  106. --disable-fprot \
  107. --disable-sophie \
  108. --disable-nvcc \
  109. --disable-trophie \
  110. %else
  111. --disable-anti-virus \
  112. %endif
  113. --with-sendmail=%{l_prefix}/sbin/sendmail \
  114. --with-spooldir=%{l_prefix}/var/mimedefang/spool \
  115. --with-quarantinedir=%{l_prefix}/var/mimedefang/quarantine \
  116. --with-user=%{l_rusr}
  117. # build program
  118. %{l_make} %{l_mflags} install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT
  119. # build local copy of Perl extension module
  120. %{l_prefix}/bin/perl-openpkg prepare
  121. %{l_prefix}/bin/perl-openpkg \
  122. -l %{l_prefix}/lib/mimedefang \
  123. -d MIME-tools-%{V_mime_tools} \
  124. --args "LIBS=$RPM_BUILD_ROOT/%{l_prefix}/lib/mimedefang" \
  125. configure build
  126. %install
  127. # install program
  128. rm -rf $RPM_BUILD_ROOT
  129. %{l_make} %{l_mflags} install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT
  130. # install local copy of Perl extension module
  131. %{l_prefix}/bin/perl-openpkg \
  132. -l %{l_prefix}/lib/mimedefang \
  133. -d MIME-tools-%{V_mime_tools} \
  134. --args "LIBS=$RPM_BUILD_ROOT/%{l_prefix}/lib/mimedefang" \
  135. install
  136. %{l_prefix}/bin/perl-openpkg \
  137. -l %{l_prefix}/lib/mimedefang \
  138. -F perl-openpkg-files \
  139. fixate cleanup
  140. # install run-command script
  141. %{l_shtool} mkdir -f -p -m 755 \
  142. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  143. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  144. %{SOURCE rc.mimedefang} \
  145. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  146. # create run-time data directories
  147. %{l_shtool} mkdir -f -p -m 750 \
  148. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang \
  149. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang/spool \
  150. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang/quarantine
  151. # determine installation files
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  153. %{l_files_std} \
  154. '%config %{l_prefix}/etc/mimedefang/*' \
  155. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mimedefang' \
  156. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mimedefang/*'
  157. %files -f files
  158. %clean
  159. rm -rf $RPM_BUILD_ROOT