nessus-libs.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## nessus-libs.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 information
  26. Name: nessus-libs
  27. Summary: Nessus Security Scanner (Libraries)
  28. URL: http://www.nessus.org/
  29. Vendor: Renaud Deraison
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: PLUS
  33. Group: Security
  34. License: GPL
  35. Version: 2.2.0
  36. Release: 20041028
  37. # list of sources
  38. Source0: ftp://ftp.nessus.org/pub/nessus/nessus-%{version}/src/nessus-libraries-%{version}.tar.gz
  39. Source1: ftp://ftp.nessus.org/pub/nessus/nessus-%{version}/src/libnasl-%{version}.tar.gz
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20040130, libpcap, openssl, gcc, bison, make
  44. PreReq: OpenPKG, openpkg >= 20040130, libpcap, openssl
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. This is the Library package of the Nessus Security Scanner, a
  49. security scanner which will audit remotely a given network and
  50. determine whether attackers may break into it, or misuse it in some
  51. way.
  52. %track
  53. prog nessus-libs:libnasl = {
  54. version = %{version}
  55. url = ftp://ftp.nessus.org/pub/nessus/
  56. regex = (nessus-\d+\.\d+\.\d+)
  57. url = ftp://ftp.nessus.org/pub/nessus/__NEWVER__/src/
  58. regex = libnasl-(__VER__)\.tar\.gz
  59. }
  60. prog nessus-libs:nessus-libraries = {
  61. version = %{version}
  62. url = ftp://ftp.nessus.org/pub/nessus/
  63. regex = (nessus-\d+\.\d+\.\d+)
  64. url = ftp://ftp.nessus.org/pub/nessus/__NEWVER__/src/
  65. regex = nessus-libraries-(__VER__)\.tar\.gz
  66. }
  67. %prep
  68. %setup -q -c
  69. %setup -q -T -D -a 1
  70. %build
  71. tmproot=`pwd`/tmp
  72. # build nessus-libraries part
  73. ( cd nessus-libraries
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags -O}"
  76. CPPFLAGS="%{l_cppflags}"
  77. LDFLAGS="%{l_ldflags}"
  78. ./configure \
  79. --prefix=%{l_prefix} \
  80. --with-ssl=%{l_prefix} \
  81. --disable-nessuspcap \
  82. --enable-bpf-sharing \
  83. --disable-cipher \
  84. --disable-shared \
  85. --enable-static
  86. %{l_make} %{l_mflags -O}
  87. ) || exit $?
  88. # temporarily install nessus-libraries for libnasl building
  89. ( cd nessus-libraries
  90. %{l_make} %{l_mflags -O} \
  91. install DESTDIR=$tmproot
  92. %{l_shtool} subst \
  93. -e "s;^\\(PREFIX=\\)\\(.*\\);\\1$tmproot\\2;" \
  94. $tmproot%{l_prefix}/bin/nessus-config
  95. ) || exit $?
  96. # build libnasl part
  97. ( cd libnasl
  98. CC="%{l_cc}" \
  99. CFLAGS="%{l_cflags -O}" \
  100. CPPFLAGS="%{l_cppflags}" \
  101. LDFLAGS="%{l_ldflags}" \
  102. NESSUSCONFIG=$tmproot%{l_prefix}/bin/nessus-config \
  103. ./configure \
  104. --prefix=%{l_prefix} \
  105. --disable-shared \
  106. --enable-static
  107. %{l_make} %{l_mflags}
  108. ) || exit $?
  109. %install
  110. rm -rf $RPM_BUILD_ROOT
  111. # install nessus-libraries
  112. ( cd nessus-libraries
  113. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  114. ) || exit $?
  115. # install libnasl
  116. ( cd libnasl
  117. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  118. ) || exit $?
  119. # strip down installation
  120. rm -rf $RPM_BUILD_ROOT%{l_prefix}/sbin/uninstall-nessus
  121. rm -f $RPM_BUILD_ROOT%{l_prefix}/include/nessus/includes.h
  122. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  123. # determine installation files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  125. %files -f files
  126. %clean
  127. rm -rf $RPM_BUILD_ROOT