mimedefang.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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.43
  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: 20040527
  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. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. BuildPreReq: sendmail > 8.12.0, perl, perl-mail, perl-crypto, perl-ds
  52. PreReq: sendmail > 8.12.0, perl, perl-mail, perl-crypto, perl-ds
  53. %if "%{with_clamav}" == "yes"
  54. BuildPreReq: clamav
  55. PreReq: clamav
  56. %endif
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. MIMEDefang is a framework for filtering e-mail. It uses Sendmail's
  61. "Milter" API, some C glue code, and some Perl code to let you write
  62. high-performance mail filters in Perl.
  63. %track
  64. prog mimedefang = {
  65. version = %{V_mimedefang}
  66. url = http://www.mimedefang.org/node.php?id=1
  67. regex = mimedefang-(\d+\.\d+)\.tar\.gz
  68. }
  69. prog mimedefang:MIME-tools = {
  70. version = %{V_mime_tools}
  71. url = http://www.mimedefang.org/node.php?id=1
  72. regex = MIME-tools-(.+?)\.tar\.gz
  73. }
  74. %prep
  75. %setup -q
  76. %setup -q -T -D -a 1
  77. %build
  78. # configure program
  79. %{l_shtool} subst \
  80. -e 's,use warnings,use warnings; use lib "%{l_prefix}/lib/mimedefang",g' \
  81. mimedefang.pl.in
  82. CC="%{l_cc}" \
  83. CFLAGS="%{l_cflags} %{l_cppflags}" \
  84. CPPFLAGS="%{l_cppflags}" \
  85. LDFLAGS="%{l_ldflags}" \
  86. ./configure \
  87. --cache-file=./config.cache \
  88. --prefix=%{l_prefix} \
  89. --sysconfdir=%{l_prefix}/etc/mimedefang \
  90. --with-confsubdir="" \
  91. %if "%{with_clamav}" == "yes"
  92. --enable-clamav \
  93. --enable-clamd \
  94. --disable-antivir \
  95. --disable-vexira\
  96. --disable-uvscan \
  97. --disable-bdc \
  98. --disable-sweep \
  99. --disable-trend \
  100. --disable-AvpLinux \
  101. --disable-aveclient \
  102. --disable-clamav \
  103. --disable-fsav \
  104. --disable-fprot \
  105. --disable-sophie \
  106. --disable-nvcc \
  107. --disable-trophie \
  108. %else
  109. --disable-anti-virus \
  110. %endif
  111. --with-sendmail=%{l_prefix}/sbin/sendmail \
  112. --with-spooldir=%{l_prefix}/var/mimedefang/spool \
  113. --with-quarantinedir=%{l_prefix}/var/mimedefang/quarantine \
  114. --with-user=%{l_rusr}
  115. # build program
  116. %{l_make} %{l_mflags} install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT
  117. # build local copy of Perl extension module
  118. %{l_prefix}/bin/perl-openpkg prepare
  119. %{l_prefix}/bin/perl-openpkg \
  120. -l %{l_prefix}/lib/mimedefang \
  121. -d MIME-tools-%{V_mime_tools} \
  122. --args "LIBS=$RPM_BUILD_ROOT/%{l_prefix}/lib/mimedefang" \
  123. configure build
  124. %install
  125. # install program
  126. rm -rf $RPM_BUILD_ROOT
  127. %{l_make} %{l_mflags} install RPM_INSTALL_ROOT=$RPM_BUILD_ROOT
  128. # install local copy of Perl extension module
  129. %{l_prefix}/bin/perl-openpkg \
  130. -l %{l_prefix}/lib/mimedefang \
  131. -d MIME-tools-%{V_mime_tools} \
  132. --args "LIBS=$RPM_BUILD_ROOT/%{l_prefix}/lib/mimedefang" \
  133. install
  134. %{l_prefix}/bin/perl-openpkg \
  135. -l %{l_prefix}/lib/mimedefang \
  136. -F perl-openpkg-files \
  137. fixate cleanup
  138. # install run-command script
  139. %{l_shtool} mkdir -f -p -m 755 \
  140. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  141. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  142. %{SOURCE rc.mimedefang} \
  143. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  144. # create run-time data directories
  145. %{l_shtool} mkdir -f -p -m 750 \
  146. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang \
  147. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang/spool \
  148. $RPM_BUILD_ROOT%{l_prefix}/var/mimedefang/quarantine
  149. # determine installation files
  150. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  151. %{l_files_std} \
  152. '%config %{l_prefix}/etc/mimedefang/*' \
  153. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mimedefang' \
  154. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mimedefang/*'
  155. %files -f files
  156. %clean
  157. rm -rf $RPM_BUILD_ROOT