nessus-tool.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ##
  2. ## nessus-tool.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: nessus-tool
  27. Summary: Nessus Security Scanner (Tool)
  28. URL: http://www.nessus.org/
  29. Vendor: Renaud Deraison
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [EVAL]
  32. Group: Security
  33. License: GPL
  34. Version: 2.0.7
  35. Release: 20030704
  36. # list of sources
  37. Source0: ftp://ftp.nessus.org/pub/nessus/nessus-%{version}/src/nessus-core-%{version}.tar.gz
  38. Source1: ftp://ftp.nessus.org/pub/nessus/nessus-%{version}/src/nessus-plugins-%{version}.tar.gz
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20030103, X11, nessus-libs, glib, gtk, gcc, make
  43. PreReq: OpenPKG, openpkg >= 20030103, X11
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. This is the Tool package of the Nessus Security Scanner, a security
  48. scanner which will audit remotely a given network and determine
  49. whether attackers may break into it, or misuse it in some way.
  50. %prep
  51. %setup0 -q -c
  52. %setup1 -q -T -D -a 1
  53. %build
  54. # build nessus-core part
  55. pushd nessus-core
  56. CC="%{l_cc}" \
  57. CFLAGS="%{l_cflags -O}" \
  58. CPPFLAGS="%{l_cppflags}" \
  59. LDFLAGS="%{l_ldflags}" \
  60. ./configure \
  61. --prefix=%{l_prefix} \
  62. --enable-unix-socket=%{l_prefix}/var/nessus-tool/nessus.socket \
  63. --disable-syslog \
  64. --with-x \
  65. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  66. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  67. --enable-gtk
  68. %{l_make} %{l_mflags -O}
  69. popd
  70. # temporarily install nessus-core for nessus-plugins building
  71. pushd nessus-core
  72. nessus_core=`pwd`
  73. %{l_make} %{l_mflags -O} \
  74. install DESTDIR=${nessus_core}/tmp
  75. popd
  76. # build nessus-plugins part
  77. pushd nessus-plugins
  78. CC="%{l_cc}" \
  79. CFLAGS="-I${nessus_core}/tmp%{l_prefix}/include/nessus %{l_cflags -O}" \
  80. CPPFLAGS="-I${nessus_core}/tmp%{l_prefix}/include/nessus %{l_cppflags}" \
  81. LDFLAGS="%{l_ldflags}" \
  82. ./configure \
  83. --prefix=%{l_prefix} \
  84. --enable-install="`%{l_shtool} echo -e %u`" \
  85. --enable-shared
  86. %{l_shtool} subst \
  87. -e 's;getinterfaces;local_getinterfaces;g' \
  88. -e 's;routethrough;local_routethrough;g' \
  89. -e 's;ipaddr2devname;local_ipaddr2devname;g' \
  90. -e 's;islocalhost;local_islocalhost;g' \
  91. -e 's;get_random_bytes;local_get_random_bytes;g' \
  92. -e 's;getsourceip;local_getsourceip;g' \
  93. plugins/nmap_osfingerprint/*.[ch]
  94. %{l_make} %{l_mflags -O}
  95. popd
  96. %install
  97. rm -rf $RPM_BUILD_ROOT
  98. # install nessus-core part
  99. pushd nessus-core
  100. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  101. popd
  102. # install nessus-plugins part
  103. pushd nessus-plugins
  104. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  105. popd
  106. # strip down installation
  107. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  108. # determine installation files
  109. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  110. %files -f files
  111. %clean
  112. rm -rf $RPM_BUILD_ROOT