amavisd.spec 5.4 KB

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