uvscan.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## uvscan.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_engine 4.32
  26. %define V_engine_comp 432
  27. %define V_datfiles 4830
  28. # package information
  29. Name: uvscan
  30. Summary: McAfee VirusScan
  31. URL: http://www.mcafee.com/
  32. Vendor: Network Associates
  33. Packager: OpenPKG
  34. Distribution: OpenPKG
  35. Class: EVAL
  36. Group: Filesystem
  37. License: Commercial/Free-Trial
  38. Version: %{V_engine}.%{V_datfiles}
  39. Release: 20060816
  40. # list of sources
  41. Source0: ftp://ftp.mcafee.com/pub/antivirus/datfiles/4.x/dat-%{V_datfiles}.tar
  42. Source1: http://download.nai.com/products/evaluation/virusscan/english/cmdline/bsd/v%{V_engine}/vbsd%{V_engine_comp}e.tar.Z
  43. Source2: http://download.nai.com/products/evaluation/virusscan/english/cmdline/linux/v%{V_engine}/intel/vlnx%{V_engine_comp}e.tar.Z
  44. Source3: http://download.nai.com/products/evaluation/virusscan/english/cmdline/sun/v%{V_engine}/vsun%{V_engine_comp}e.tar.Z
  45. Source4: uvscan.sh
  46. Source5: rc.uvscan
  47. %NoSource 0
  48. %NoSource 1
  49. %NoSource 2
  50. %NoSource 3
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20040130
  55. PreReq: OpenPKG, openpkg >= 20040130, curl, tar
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. This is the free-trail version of the NAI McAfee VirusScan 4
  60. command line virus scanner for Unix.
  61. %track
  62. prog uvscan:datfiles = {
  63. comment = "rse: updates occur partly bi-daily, so track only every tenths version"
  64. version = %{V_datfiles}
  65. url = ftp://ftp.mcafee.com/pub/antivirus/datfiles/4.x/
  66. regex = dat-(\d\d\d0).tar
  67. }
  68. %prep
  69. %setup -q -c -T
  70. # unpack platform-specific Engine
  71. case "%{l_platform -t}" in
  72. *-freebsd* ) engine="%{SOURCE1}" ;;
  73. *-linux* ) engine="%{SOURCE2}" ;;
  74. *-sunos* ) engine="%{SOURCE3}" ;;
  75. * ) echo "Sorry, platform %{l_platform -t} not supported" 1>&2; exit 1 ;;
  76. esac
  77. ( mkdir engine; cd engine
  78. %{l_gzip} -d -c $engine | %{l_tar} xf -
  79. ) || exit $?
  80. # unpack latest DAT file set
  81. ( mkdir datfiles; cd datfiles
  82. %{l_tar} xf %{SOURCE0}
  83. ) || exit $?
  84. %build
  85. %install
  86. rm -rf $RPM_BUILD_ROOT
  87. # create installation hierarchy
  88. %{l_shtool} mkdir -f -p -m 755 \
  89. $RPM_BUILD_ROOT%{l_prefix}/bin \
  90. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  91. $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan \
  92. $RPM_BUILD_ROOT%{l_prefix}/var/uvscan/data \
  93. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  94. # install Engine
  95. ( cd engine
  96. (echo "n"; echo "n"; echo "n"; echo "n"; echo "n") |\
  97. ./install-uvscan $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/
  98. ) || exit $?
  99. # post-adjust Engine installation
  100. for dat in clean names scan; do
  101. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/$dat.dat
  102. done
  103. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/*.txt
  104. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/*.pdf
  105. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/uninstall-uvscan
  106. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/uvscan/uvscan.1 \
  107. $RPM_BUILD_ROOT%{l_prefix}/man/man1/uvscan.1
  108. # install Engine command line wrapper
  109. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  110. %{SOURCE uvscan.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/uvscan
  111. # install initial DAT file set
  112. %{l_shtool} install -c -m 644 \
  113. datfiles/*.dat $RPM_BUILD_ROOT%{l_prefix}/var/uvscan/data/
  114. echo "%{V_datfiles}" >VERSION
  115. %{l_shtool} install -c -m 644 \
  116. VERSION $RPM_BUILD_ROOT%{l_prefix}/var/uvscan/data/
  117. # install run-command script
  118. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  119. %{SOURCE rc.uvscan} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  120. # determine installation files
  121. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT