summaryrefslogtreecommitdiff
blob: 0e8b5fecb1a842ed7fc0f5c7b5d7d4519a7382cc (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nessus-bin/nessus-bin-3.0.2.ebuild,v 1.3 2006/10/09 11:55:08 jokey Exp $

inherit rpm

MY_P="Nessus-${PV}-suse9.3.i586"
# We are using SuSE's binary

DESCRIPTION="A remote security scanner for Linux"
HOMEPAGE="http://nessus.org"
SRC_URI="${MY_P}.rpm"
RESTRICT="nomirror fetch nostrip"

LICENSE="Nessus-EULA"
SLOT="0"
KEYWORDS="~x86"
IUSE="X"

DEPEND="=sys-libs/db-4.3*
	dev-libs/openssl"

PDEPEND="X? ( net-analyzer/nessus-client )"

pkg_nofetch() {
	einfo "Please download ${MY_P}.rpm from ${HOMEPAGE}/download"
	einfo "The archive should then be placed into ${DISTDIR}."
}

pkg_setup() {
	case ${CHOST} in
		i586-pc-linux-gnu*)	einfo "Found compatible architecture." ;;
		i686-pc-linux-gnu*)	einfo "Found compatible architecture." ;;
		*)			die "No compatible architecture found." ;;
	esac
}

src_install() {
	# copy files
	cp -pPR "${WORKDIR}"/opt "${D}"

	# make sure these directories do not vanish
	# nessus will not run properly without them
	keepdir /opt/nessus/etc/nessus
	keepdir /opt/nessus/var/nessus/jobs
	keepdir /opt/nessus/var/nessus/logs
	keepdir /opt/nessus/var/nessus/tmp
	keepdir /opt/nessus/var/nessus/users

	# add /opt/nessus/lib to LD_PATH
	# nessus will not run properly without it
	doenvd "${FILESDIR}"/90nessus-bin

	# we have /bin/gzip, not /usr/bin/gzip
	sed -i -e "s:/usr/bin/gzip:/bin/gzip:g" \
		"${D}"/opt/nessus/sbin/nessus-update-plugins

	# init script
	newinitd "${FILESDIR}"/nessusd-r8 nessusd-bin
}

pkg_postinst() {
	einfo "You can get started running the following commands:"
	einfo "/opt/nessus/sbin/nessus-add-first-user"
	einfo "/opt/nessus/sbin/nessus-mkcert"
	einfo "/etc/init.d/nessusd-bin start"
	einfo
	einfo "For more information about nessus, please visit"
	einfo "${HOMEPAGE}/documentation/"
}