sav.spec 5.9 KB

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