amavisd.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. # version numbers
  27. # package information
  28. Name: amavisd
  29. Summary: Badly Packaged Program
  30. URL: http://www.amavisd.org/
  31. Vendor: John Doe
  32. Packager: The OpenPKG Project
  33. Distribution: OpenPKG [JUNK]
  34. Group: Mail
  35. License: GPL
  36. Version: 20030314
  37. Release: 20030422
  38. # package options
  39. %option with_milter no
  40. # list of sources
  41. Source0: http://www.ijs.si/software/amavisd/amavisd-new-%{version}.tar.gz
  42. Source1: rc.amavisd
  43. Patch0: http://www.ijs.si/software/amavisd/amavisd-new-%{version}-p1A.patch
  44. Patch1: http://www.ijs.si/software/amavisd/amavisd-new-%{version}-p1B.patch
  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
  54. PreReq: sendmail, sendmail::with_milter
  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 %{name}-new-%{version}
  67. %patch0 -p0
  68. %patch1 -p0
  69. %build
  70. %if "%{with_milter}" == "yes"
  71. cd helper-progs
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. LDFLAGS="%{l_ldflags}" \
  75. ./configure
  76. --prefix="%{l_prefix}" \
  77. --with-sendmail="%{l_prefix}/sbin/sendmail" \
  78. --with-runtime-dir="%{l_prefix}/var/amavisd" \
  79. --with-sockname="%{l_prefix}/var/amavisd/amavisd.sock" \
  80. --with-user="@l_rusr@" \
  81. --with-milterinc="%{l_prefix}/include/libmilter" \
  82. --with-milterlib="%{l_prefix}/lib"
  83. %endif
  84. %install
  85. rm -rf $RPM_BUILD_ROOT
  86. %{l_shtool} mkdir -f -p -m 755 \
  87. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  88. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  89. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd \
  90. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages \
  91. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES \
  92. $RPM_BUILD_ROOT%{l_prefix}/var/amavisd \
  93. $RPM_BUILD_ROOT%{l_prefix}/var/amavisd/virusmails
  94. %{l_shtool} install -c -m 755 \
  95. -e '1s;/usr/bin/perl;%{l_prefix}/bin/perl;' \
  96. -e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \
  97. -e 's;/etc/amavisd.conf;%{l_prefix}/etc/amavisd/amavisd.conf;g' \
  98. amavisd \
  99. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  100. %{l_shtool} install -c -m 644 \
  101. -e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \
  102. -e 's;/var/virusmails;%{l_prefix}/var/amavisd/virusmails;g' \
  103. -e 's;/usr/bin/sendmail;%{l_prefix}/bin/sendmail;g' \
  104. -e 's; -C/etc/sendmail.orig.cf ;;g' \
  105. -e 's;/usr/bin/exim;%{l_prefix}/bin/exim;g' \
  106. -e 's;/usr/local/sbin;%{l_prefix}/sbin;g' \
  107. -e 's;/usr/local/bin;%{l_prefix}/bin;g' \
  108. -e 's;\(daemon_user *= \)[^;]*;\1q{%{l_rusr}};' \
  109. -e 's;\(daemon_group *= \)[^;]*;\1q{%{l_rgrp}};' \
  110. amavisd.conf \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/
  112. %{l_shtool} install -c -m 644 \
  113. test-messages/* \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages/
  115. %{l_shtool} install -c -m 644 \
  116. README_FILES/* \
  117. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES/
  118. %{l_shtool} install -c -m 644 \
  119. RELEASE_NOTES \
  120. $RPM_BUILD_ROOT%{l_prefix}/share/amavisd/
  121. %{l_shtool} install -c -m 755 \
  122. -e 's;@l_prefix@;%{l_prefix};g' \
  123. -e 's;@l_rusr@;%{l_rusr};g' \
  124. %{SOURCE rc.amavisd} \
  125. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  127. '%config %{l_prefix}/etc/amavisd/amavisd.conf' \
  128. '%config %{l_prefix}/etc/amavisd/test-message/*' \
  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