summaryrefslogtreecommitdiff
blob: 3bb75f85af80a6a2e13d14840074c246b1526dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#Copyright 2000 Achim Gottinger
#Distributed under the GPL
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nessus/nessus-1.0.7a-r1.ebuild,v 1.1 2001/10/06 10:08:19 azarah Exp $


# It's better to split it in four different packages

A="nessus-libraries-${PV}.tar.gz nessus-core-${PV}.tar.gz
   nessus-plugins-${PV}.tar.gz libnasl-${PV}.tar.gz"
S=${WORKDIR}
DESCRIPTION="A remote security scanner for Linux"
SRC_URI="ftp://ftp.nessus.org/pub/nessus/nessus-${PV}/src/nessus-libraries-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/nessus/nessus-${PV}/src/nessus-core-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/nessus/nessus-${PV}/src/nessus-plugins-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/nessus/nessus-${PV}/src/libnasl-${PV}.tar.gz"

HOMEPAGE="http://www.nessus.org/"

DEPEND="virtual/glibc virtual/x11 sys-devel/m4
        >=dev-libs/gmp-3.1.1
        >=sys-libs/zlib-1.1.3
	>=x11-libs/gtk+-1.2.10-r4"
RDEPEND="virtual/glibc virtual/x11
        >=dev-libs/gmp-3.1.1
        >=sys-libs/zlib-1.1.3
	>=x11-libs/gtk+-1.2.10-r4"

src_compile() {

  export PATH=${D}/usr/bin:$PATH
  export LD_LIBRARY_PATH=${D}/usr/lib:$LD_LIBRARY_PATH
  echo "Compiling libraries..."
  cd ${S}/nessus-libraries
  try ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/state \
	--mandir=/usr/share/man --enable-pthread
  try make
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install
  cd ${D}/usr/bin
  cp nessus-config nessus-config.orig
  sed -e "s:^PREFIX=:PREFIX=${D}:" \
      -e "s:-I/usr:-I${D}/usr: " nessus-config.orig > nessus-config

  echo "Compiling libnasl..."
  cd ${S}/libnasl
  try ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/state --mandir=/usr/share/man
  try make
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install
  cd ${D}/usr/bin
  cp nasl-config nasl-config.orig
  sed -e "s:^PREFIX=:PREFIX=${D}:" nasl-config.orig > nasl-config

  echo "Compiling core..."
  cd ${S}/nessus-core
  try ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/state --mandir=/usr/share/man
  try make
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install


  echo "Compiling plugins..."
  cd ${S}/nessus-plugins
  try ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/state --mandir=/usr/share/man
  try make
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install

}

src_install() {
  cd ${S}/nessus-libraries
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install

  cd ${S}/libnasl
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install

  cd ${S}/nessus-core
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install
  cp ${ROOT}/config/nessusd.conf ${D}/etc/nessus/

  cd ${S}/nessus-plugins
  try make prefix=${D}/usr sysconfdir=${D}/etc localstatedir=${D}/var/state mandir=${D}/usr/share/man install

  cd ${S}/nessus-libraries
  docinto nessus-libraries
  dodoc README*

  cd ${S}/libnasl
  docinto libnasl
  dodoc COPYING TODO

  cd ${S}/nessus-core
  docinto nessus-core
  dodoc README* UPGRADE_README CHANGES
  dodoc doc/*.txt doc/ntp/*

  cd ${S}/nessus-plugins
  docinto nessus-plugins
  dodoc docs/*.txt plugins/accounts/accounts.txt

  insinto /etc/rc.d/init.d
  insopts -m 755
  doins ${FILESDIR}/nessusd
}