sophie.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## sophie.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 information
  26. Name: sophie
  27. Summary: Sophie Anti-Virus Scanner Daemon
  28. URL: http://www.vanja.com/tools/sophie/
  29. Vendor: Vanja Hrustic et al.
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: EVAL
  33. Group: System
  34. License: GPL
  35. Version: 3.04rc2
  36. Release: 20040203
  37. # package options
  38. %option with_fsl yes
  39. # list of sources
  40. Source0: http://www.vanja.com/tools/sophie/sophie-%{version}.tar.bz2
  41. Source1: fsl.sophie
  42. Source2: rc.sophie
  43. Source3: sophie.cfg
  44. Source4: sophie.savi
  45. Source5: sophie.sh
  46. Patch0: sophie.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, sav, make, gcc
  51. PreReq: OpenPKG, openpkg >= 20040130, sav
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl >= 1.0.6
  54. PreReq: fsl >= 1.0.6
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. Sophie is a daemon which uses the libsavi library from Sophos
  60. Anti-Virus. On startup, Sophie initializes SAVI (Sophos Anti-Virus
  61. Interface), loads virus patterns into memory, opens local UNIX
  62. domain socket, and waits for someone to connect and instructs it
  63. which path to scan. Since it is loaded in RAM, scanning is very
  64. fast. Of course, speed of scanning also depends on SAVI settings and
  65. size of the file.
  66. %track
  67. prog sophie = {
  68. version = 3.04rc2
  69. url = http://www.vanja.com/tools/sophie/
  70. regex = sophie-(__VER__)\.tar\.bz2
  71. }
  72. %prep
  73. %setup -q
  74. %patch -p1
  75. %{l_shtool} subst %{l_value -s -a} \
  76. sophie.c \
  77. sophie_init.c
  78. %{l_shtool} subst \
  79. -e 's;^\(#define[ ]*DEFAULT_PIDFILE\)[ ].*$;\1 "%{l_prefix}/var/sophie/sophie.pid";' \
  80. -e 's;^\(#define[ ]*DEFAULT_SOCKETFILE\)[ ].*$;\1 "%{l_prefix}/var/sophie/sophie.sock";' \
  81. sophie.h
  82. case "%{l_platform -t}" in
  83. *-freebsd* ) %{l_shtool} subst -e 's; -lrt;;' configure ;;
  84. esac
  85. %build
  86. LD_LIBRARY_PATH="%{l_prefix}/lib/sav:${LD_LIBRARY_PATH-/usr/lib}"
  87. export LD_LIBRARY_PATH
  88. CC="%{l_cc}" \
  89. CFLAGS="%{l_cflags -O}" \
  90. CPPFLAGS="%{l_cppflags}" \
  91. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  92. LIBS="%{l_fsl_libs}" \
  93. ./configure \
  94. --prefix=%{l_prefix} \
  95. --with-savilib=%{l_prefix}/lib/sav \
  96. --disable-net
  97. %{l_make} %{l_mflags -O}
  98. %install
  99. rm -rf $RPM_BUILD_ROOT
  100. %{l_shtool} mkdir -f -p -m 755 \
  101. $RPM_BUILD_ROOT%{l_prefix}/bin \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  104. $RPM_BUILD_ROOT%{l_prefix}/etc/sophie \
  105. $RPM_BUILD_ROOT%{l_prefix}/man/man8 \
  106. $RPM_BUILD_ROOT%{l_prefix}/libexec/sophie \
  107. $RPM_BUILD_ROOT%{l_prefix}/var/sophie
  108. %{l_shtool} install -c -s -m 755 \
  109. sophie \
  110. $RPM_BUILD_ROOT%{l_prefix}/libexec/sophie/
  111. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  112. %{SOURCE sophie.sh} \
  113. $RPM_BUILD_ROOT%{l_prefix}/bin/sophie
  114. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  115. %{SOURCE fsl.sophie} \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  117. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  118. %{SOURCE rc.sophie} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  119. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  120. %{SOURCE sophie.cfg} \
  121. %{SOURCE sophie.savi} \
  122. $RPM_BUILD_ROOT%{l_prefix}/etc/sophie/
  123. %{l_shtool} install -c -m 644 \
  124. sophie.8 \
  125. $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  127. '%not %dir %{l_prefix}/etc/fsl' \
  128. '%config %{l_prefix}/etc/fsl/fsl.sophie' \
  129. '%config %{l_prefix}/etc/sophie/*' \
  130. '%dir %attr(1777,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/sophie'
  131. %files -f files
  132. %clean
  133. rm -rf $RPM_BUILD_ROOT