sophie.spec 4.8 KB

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