amavisd.spec 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ##
  2. ## amavisd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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. # FIXME: mlelstv: junk because untested, especially milter option
  26. # package version
  27. %define V_major 20030616
  28. %define V_minor p2
  29. # package information
  30. Name: amavisd
  31. Summary: Interface Daemon between MTA and Content Checker
  32. URL: http://www.ijs.si/software/amavisd/
  33. Vendor: Mark Martinec
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [JUNK]
  36. Group: Mail
  37. License: GPL
  38. Version: %{V_major}%{V_minor}
  39. Release: 20030708
  40. # package options
  41. %option with_milter no
  42. # list of sources
  43. Source0: http://www.ijs.si/software/amavisd/amavisd-new-%{V_major}-%{V_minor}.tar.gz
  44. Source1: rc.amavisd
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20030103
  49. PreReq: OpenPKG, openpkg >= 20030103, perl
  50. PreReq: perl-net, perl-util, perl-mail, perl-time
  51. PreReq: perl-sys, perl-comp, perl-conv, spamassassin
  52. %if "%{with_milter}" == "yes"
  53. BuildPreReq: sendmail, sendmail::with_milter = yes
  54. PreReq: sendmail, sendmail::with_milter = yes
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. amavisd-new is a high-performance interface between mailer (MTA) and
  60. content checkers: virus scanners, and/or SpamAssasin. It is written
  61. in Perl for maintainability, without paying a significant price
  62. for speed. It talks to MTA via (E)SMTP or LMTP, or by using helper
  63. programs. Best with Postfix, works with Exim, sendmail/milter, or
  64. with any MTA as a SMTP relay.
  65. %prep
  66. %setup -q -n amavisd-new-%{V_major}
  67. %build
  68. %if "%{with_milter}" == "yes"
  69. cd helper-progs
  70. CC="%{l_cc}" \
  71. CFLAGS="%{l_cflags -O}" \
  72. LDFLAGS="%{l_ldflags}" \
  73. ./configure
  74. --prefix="%{l_prefix}" \
  75. --with-sendmail="%{l_prefix}/sbin/sendmail" \
  76. --with-runtime-dir="%{l_prefix}/var/amavisd" \
  77. --with-sockname="%{l_prefix}/var/amavisd/amavisd.sock" \
  78. --with-user="@l_rusr@" \
  79. --with-milterinc="%{l_prefix}/include/libmilter" \
  80. --with-milterlib="%{l_prefix}/lib"
  81. %endif
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  87. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages \
  89. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES \
  90. $RPM_BUILD_ROOT%{l_prefix}/var/amavisd \
  91. $RPM_BUILD_ROOT%{l_prefix}/var/amavisd/virusmails
  92. %{l_shtool} install -c -m 755 \
  93. -e '1s;/usr/bin/perl;%{l_prefix}/bin/perl;' \
  94. -e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \
  95. -e 's;/etc/amavisd.conf;%{l_prefix}/etc/amavisd/amavisd.conf;g' \
  96. amavisd \
  97. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  98. %{l_shtool} install -c -m 644 \
  99. -e "s;'clamscan';%{l_prefix}/bin/clamscan;g" \
  100. -e "s;'uvscan';%{l_prefix}/bin/uvscan;g" \
  101. -e 's;/var/amavis/clamd;%{l_prefix}/var/clamav/clamd.sock;g' \
  102. -e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \
  103. -e 's;/var/virusmails;%{l_prefix}/var/amavisd/virusmails;g' \
  104. -e 's;/usr/bin/sendmail;%{l_prefix}/bin/sendmail;g' \
  105. -e 's; -C/etc/sendmail.orig.cf ;;g' \
  106. -e 's;/usr/bin/exim;%{l_prefix}/bin/exim;g' \
  107. -e 's;/usr/local/sbin;%{l_prefix}/sbin;g' \
  108. -e 's;/usr/local/bin;%{l_prefix}/bin;g' \
  109. -e 's;\(daemon_user *= \)[^;]*;\1q{%{l_rusr}};' \
  110. -e 's;\(daemon_group *= \)[^;]*;\1q{%{l_rgrp}};' \
  111. amavisd.conf \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/
  113. %{l_shtool} install -c -m 644 \
  114. test-messages/* \
  115. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages/
  116. %{l_shtool} install -c -m 644 \
  117. README_FILES/* \
  118. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES/
  119. %{l_shtool} install -c -m 644 \
  120. RELEASE_NOTES \
  121. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/
  122. %{l_shtool} install -c -m 755 \
  123. -e 's;@l_prefix@;%{l_prefix};g' \
  124. -e 's;@l_rusr@;%{l_rusr};g' \
  125. %{SOURCE rc.amavisd} \
  126. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  127. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  128. '%config %{l_prefix}/etc/amavisd/amavisd.conf' \
  129. '%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/amavisd' \
  130. '%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/amavisd/virusmails'
  131. %files -f files
  132. %clean
  133. rm -rf $RPM_BUILD_ROOT