sav.spec 5.4 KB

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