summaryrefslogtreecommitdiff
blob: c3f762672f5fcce5bf37ac438daa34f684958dfc (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Copyright 2000-2002 Achim Gottinger
# Distributed under the GPL by Gentoo Technologies, Inc.
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nessus/nessus-1.2.2.ebuild,v 1.2 2002/07/11 06:30:43 drobbins Exp $


S=${WORKDIR}
DESCRIPTION="A remote security scanner for Linux"
SRC_URI="ftp://ftp.nessus.org/pub/${PN}/${P}/src/${PN}-libraries-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/${PN}/${P}/src/${PN}-core-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/${PN}/${P}/src/${PN}-plugins-${PV}.tar.gz
	 ftp://ftp.nessus.org/pub/${PN}/${P}/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.4
	=x11-libs/gtk+-1.2*"

RDEPEND="virtual/glibc virtual/x11
	>=dev-libs/gmp-3.1.1
	>=sys-libs/zlib-1.1.4
	=x11-libs/gtk+-1.2*"


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
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var/state \
		--mandir=/usr/share/man \
		--enable-pthread || die
	make || die
	make \
		prefix=${D}/usr \
		sysconfdir=${D}/etc \
		localstatedir=${D}/var/state \
		mandir=${D}/usr/share/man \
		install || die

	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
	./configure \
		--host=${CHOST} \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var/state \
		--mandir=/usr/share/man	|| die
	make || die
	make \
		prefix=${D}/usr \
		sysconfdir=${D}/etc \
		localstatedir=${D}/var/state \
		mandir=${D}/usr/share/man \
		install || die

	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
	./configure \
		--host=${CHOST} \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var/state \
		--mandir=/usr/share/man || die
	make || die
	make \
		prefix=${D}/usr \
		sysconfdir=${D}/etc \
		localstatedir=${D}/var/state \
		mandir=${D}/usr/share/man \
		install || die


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

}

src_install() {

	cd ${S}/nessus-libraries
	make \
		prefix=${D}/usr \
		sysconfdir=${D}/etc \
		localstatedir=${D}/var/state \
		mandir=${D}/usr/share/man \
		install || die

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

	cd ${S}/nessus-core
	make \
		prefix=${D}/usr \
		sysconfdir=${D}/etc \
		localstatedir=${D}/var/state \
		mandir=${D}/usr/share/man \
		install || die

	cp ${ROOT}/config/nessusd.conf ${D}/etc/nessus/

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

	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/init.d
	insopts -m 755
	newins ${FILESDIR}/nessusd-r6 nessusd
}