sav.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## sav.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 version
  26. %define V_engine 2.18
  27. %define V_ides 3.78d
  28. # package information
  29. Name: sav
  30. Summary: Sophos Anti-Virus
  31. URL: http://www.sophos.com/products/sav/
  32. Vendor: Sophos Plc.
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: System
  37. License: Commercial/Free-Trial
  38. Version: %{V_engine}+%{V_ides}
  39. Release: 20040220
  40. # list of sources
  41. Source0: http://downloads.sophos.com/dp/full/freebsd.elf.tar.Z
  42. Source1: http://downloads.sophos.com/dp/full/linux.intel.libc6.tar.Z
  43. Source2: http://downloads.sophos.com/dp/full/solaris.sparc.tar.Z
  44. Source3: rc.sav
  45. Source4: sav.conf
  46. Source5: sweep.sh
  47. Source6: sweep.c
  48. Source7: sweep.mk
  49. %NoSource 0
  50. %NoSource 1
  51. %NoSource 2
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  56. PreReq: OpenPKG, openpkg >= 20040130, curl, infozip
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. This is the free-trail version of the Sophos Anti-Virus virus
  61. scanner for Unix.
  62. %track
  63. prog sav:ides = {
  64. comment = "thl: vcheck url for tracking only; download url see spec, look for vdl-...dat in tarball"
  65. version = 378
  66. url = http://www.sophos.com/downloads/ide/
  67. regex = (__VER__)_ides.zip
  68. }
  69. %prep
  70. %setup -q -T -c
  71. # select and decompress platform specific anti-virus engine
  72. case "%{l_platform -t}" in
  73. *-freebsd* ) engine="%{SOURCE freebsd.elf.tar.Z}" ;;
  74. *-linux* ) engine="%{SOURCE linux.intel.libc6.tar.Z}" ;;
  75. *-sunos* ) engine="%{SOURCE solaris.sparc.tar.Z}" ;;
  76. * ) echo "Sorry, platform %{l_platform -t} not supported" 1>&2; exit 1 ;;
  77. esac
  78. %{l_gzip} -d -c $engine | %{l_tar} xf -
  79. %build
  80. # build open(2) wrapper DSO
  81. # (for mapping hard-coded /etc/sav.conf to %{l_prefix}/etc/sav/sav.conf)
  82. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  83. %{SOURCE sweep.c} %{SOURCE sweep.mk} ./
  84. case "%{l_platform -t}" in
  85. *-freebsd* ) target="freebsd" ;;
  86. *-linux* ) target="linux" ;;
  87. *-sunos* ) target="solaris" ;;
  88. esac
  89. %{l_make} %{l_mflags} -f sweep.mk $target
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. # create directory structure
  93. %{l_shtool} mkdir -f -p -m 755 \
  94. $RPM_BUILD_ROOT%{l_prefix}/bin \
  95. $RPM_BUILD_ROOT%{l_prefix}/etc/sav \
  96. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  97. $RPM_BUILD_ROOT%{l_prefix}/lib/sav \
  98. $RPM_BUILD_ROOT%{l_prefix}/libexec/sav \
  99. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  100. $RPM_BUILD_ROOT%{l_prefix}/var/sav/data
  101. # install open(2) wrapper library
  102. %{l_shtool} install -c -m 755 \
  103. sweep.so \
  104. $RPM_BUILD_ROOT%{l_prefix}/libexec/sav/
  105. # install binary wrapper script
  106. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  107. %{SOURCE sweep.sh} \
  108. $RPM_BUILD_ROOT%{l_prefix}/bin/sweep
  109. # install run-command script
  110. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  111. %{SOURCE rc.sav} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  113. # install default configuration
  114. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  115. %{SOURCE sav.conf} \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/sav/
  117. # install SAVI library and add compatibility links
  118. %{l_shtool} install -c -m 755 \
  119. sav-install/libsavi.so* \
  120. $RPM_BUILD_ROOT%{l_prefix}/lib/sav/
  121. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/sav
  122. %{l_shtool} mkln -s -f libsavi.so.3.* libsavi.so.3
  123. %{l_shtool} mkln -s -f libsavi.so.3.* libsavi.so
  124. ) || exit $?
  125. # install original binary
  126. %{l_shtool} install -c -m 755 \
  127. sav-install/sweep \
  128. $RPM_BUILD_ROOT%{l_prefix}/libexec/sav/sweep
  129. # install man page
  130. %{l_shtool} install -c -m 644 \
  131. sav-install/sweep.1 \
  132. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  133. # install virus description and identity files
  134. %{l_shtool} install -c -m 644 \
  135. sav-install/vdl-%{V_ides}.dat \
  136. $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/vdl.dat
  137. %{l_shtool} install -c -m 644 \
  138. sav-install/vdl*.vdb \
  139. $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/
  140. # install message catalog
  141. %{l_shtool} install -c -m 644 \
  142. sav-install/swpmess.dat \
  143. $RPM_BUILD_ROOT%{l_prefix}/var/sav/data/
  144. # determine installation files
  145. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  146. %{l_files_std} \
  147. '%config %{l_prefix}/etc/sav/*'
  148. %files -f files
  149. %clean
  150. rm -rf $RPM_BUILD_ROOT