clamav.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ##
  2. ## clamav.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. # package information
  26. Name: clamav
  27. Summary: Clam Antivirus
  28. URL: http://www.clamav.org/
  29. Vendor: Tomasz Kojm
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Filesystem
  33. License: GPL
  34. Version: 0.60
  35. Release: 20030707
  36. # list of sources
  37. Source0: http://www.clamav.org/stable/clamav-%{version}.tar.gz
  38. Source1: rc.clamav
  39. Patch0: clamav.patch
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20030103, gcc, bzip2
  44. PreReq: OpenPKG, openpkg >= 20030103
  45. BuildPreReq: zlib
  46. PreReq: zlib
  47. AutoReq: no
  48. AutoReqProv: no
  49. %description
  50. Clam AntiVirus is an anti-virus toolkit for UNIX. The main
  51. purpose of this software is the integration with mail servers
  52. (attachment scanning). The package provides a flexible and scalable
  53. multi-threaded daemon, a command line scanner, and a tool for
  54. automatic updating via Internet. The programs are based on a shared
  55. library distributed with the Clam AntiVirus package, which you can
  56. use with your own software. The virus database is based on the virus
  57. database from OpenAntiVirus, but contains additional signatures.
  58. %prep
  59. %setup -q
  60. %patch -p0
  61. %build
  62. # configure package
  63. CC="%{l_cc}" \
  64. CFLAGS="%{l_cflags -O}" \
  65. CPPFLAGS="%{l_cppflags}" \
  66. LDFLAGS="%{l_ldflags}" \
  67. ./configure \
  68. --prefix=%{l_prefix} \
  69. --sysconfdir=%{l_prefix}/etc/clamav \
  70. --with-user=%{l_rusr} \
  71. --with-group=%{l_rgrp} \
  72. --disable-clamav \
  73. --disable-clamuko \
  74. --disable-urandom \
  75. --disable-cr \
  76. --disable-shared
  77. # build package
  78. %{l_make} %{l_mflags -O}
  79. %install
  80. rm -rf $RPM_BUILD_ROOT
  81. # perform standard package installation
  82. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  83. # install default configuration
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/clamav
  86. %{l_shtool} install -c -m 644 \
  87. -e 's;^\(Example\);#\1;' \
  88. -e 's;^#\(LogFile\).*;\1 %{l_prefix}/var/clamav/clamd.log;' \
  89. -e 's;^#\(PidFile\).*;\1 %{l_prefix}/var/clamav/clamd.pid;' \
  90. -e 's;^\(LocalSocket\).*;\1 %{l_prefix}/var/clamav/clamd.sock;' \
  91. -e 's;^#\(DataDirectory\).*;\1 %{l_prefix}/share/clamav;' \
  92. -e 's;^#\(User\).*;\1 %{l_rusr};' \
  93. etc/clamav.conf \
  94. $RPM_BUILD_ROOT%{l_prefix}/etc/clamav/
  95. # install run-command script
  96. %{l_shtool} mkdir -f -p -m 755 \
  97. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  98. %{l_shtool} install -c -m 755 \
  99. -e 's;@l_prefix@;%{l_prefix};g' \
  100. -e 's;@l_rusr@;%{l_rusr};g' \
  101. -e 's;@l_rgrp@;%{l_rgrp};g' \
  102. %{SOURCE rc.clamav} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  103. # strip-down installation hierarchy
  104. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  105. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/clamav-milter.1
  107. # create additional installation directory
  108. %{l_shtool} mkdir -f -p -m 755 \
  109. $RPM_BUILD_ROOT%{l_prefix}/var/clamav
  110. # determine installation files
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  112. %{l_files_std} \
  113. '%config %{l_prefix}/etc/clamav/clamav.conf' \
  114. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/clamav' \
  115. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/clamav'
  116. %files -f files
  117. %clean
  118. rm -rf $RPM_BUILD_ROOT