From cb16b4d13af95c6a553afffa02a2b5344b70d399 Mon Sep 17 00:00:00 2001 From: Marek Szuba Date: Mon, 6 Mar 2017 10:21:33 +0100 Subject: net-analyzer/nessus-agent-bin: new package Gentoo-Bug: 611864 Package-Manager: Portage-2.3.3, Repoman-2.3.1 --- net-analyzer/nessus-agent-bin/Manifest | 1 + .../nessus-agent-bin/files/nessusagent.initd | 21 +++++++ net-analyzer/nessus-agent-bin/metadata.xml | 8 +++ .../nessus-agent-bin-6.10.5.ebuild | 64 ++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 net-analyzer/nessus-agent-bin/Manifest create mode 100644 net-analyzer/nessus-agent-bin/files/nessusagent.initd create mode 100644 net-analyzer/nessus-agent-bin/metadata.xml create mode 100644 net-analyzer/nessus-agent-bin/nessus-agent-bin-6.10.5.ebuild (limited to 'net-analyzer/nessus-agent-bin') diff --git a/net-analyzer/nessus-agent-bin/Manifest b/net-analyzer/nessus-agent-bin/Manifest new file mode 100644 index 000000000000..a04d1b6e7096 --- /dev/null +++ b/net-analyzer/nessus-agent-bin/Manifest @@ -0,0 +1 @@ +DIST NessusAgent-6.10.5-es7.x86_64.rpm 15573580 SHA256 47df9f78bc2e79721c4d50c27c7f5d8bf4ddd4f5616ad1dd757d8d6e2d62e853 SHA512 671219b52ad70e5713379447884c4d38488dba62ac44fa9a56145e414ae4890ce9824b99c99218bba1fb3d8ac91ae81674b3c548cf4dc33712ae4ec6438ab826 WHIRLPOOL 75bc381ca9138f0a01a234d34ec45925ef46d08060d35fda0d732efb5779af5d93077b96d592a003542c1534ebb0659464d4129c4b25ce92ceed61c70bbe091c diff --git a/net-analyzer/nessus-agent-bin/files/nessusagent.initd b/net-analyzer/nessus-agent-bin/files/nessusagent.initd new file mode 100644 index 000000000000..6f43fc421e1b --- /dev/null +++ b/net-analyzer/nessus-agent-bin/files/nessusagent.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +start() { + ebegin "Starting nessusagent" + start-stop-daemon --start --quiet --exec /opt/nessus_agent/sbin/nessus-service -- -D --quiet + eend $? +} + +stop() { + ebegin "Stopping nessusagent" + start-stop-daemon --stop --quiet --exec /opt/nessus_agent/sbin/nessus-service + einfo "Waiting for the environment to be sane" + while [ -n "$RUNNING" ] ; do + sleep 1 + RUNNING=$(ps aux | grep -m 1 nessusd: | grep -v grep) + done + sleep 3 + eend $? +} diff --git a/net-analyzer/nessus-agent-bin/metadata.xml b/net-analyzer/nessus-agent-bin/metadata.xml new file mode 100644 index 000000000000..3e5026ee3754 --- /dev/null +++ b/net-analyzer/nessus-agent-bin/metadata.xml @@ -0,0 +1,8 @@ + + + + + marecki@gentoo.org + Marek Szuba + + diff --git a/net-analyzer/nessus-agent-bin/nessus-agent-bin-6.10.5.ebuild b/net-analyzer/nessus-agent-bin/nessus-agent-bin-6.10.5.ebuild new file mode 100644 index 000000000000..f7e50ca245a6 --- /dev/null +++ b/net-analyzer/nessus-agent-bin/nessus-agent-bin-6.10.5.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit rpm pax-utils systemd + +MY_P="NessusAgent-${PV}-es7" + +DESCRIPTION="A remote security scanner for Linux - agent component" +HOMEPAGE="https://www.tenable.com/" +SRC_URI="${MY_P}.x86_64.rpm" + +LICENSE="GPL-2 Nessus-EULA" +SLOT="0" +KEYWORDS="~amd64" + +RESTRICT="mirror fetch strip" + +QA_PREBUILT="opt/nessus_agent/bin/nasl + opt/nessus_agent/bin/nessus-mkrand + opt/nessus_agent/lib/nessus/libjemalloc.so.${PV} + opt/nessus_agent/lib/nessus/libnessus-glibc-fix.so + opt/nessus_agent/lib/nessus/plugins/ovaldi64-rhel7.inc + opt/nessus_agent/sbin/nessus-check-signature + opt/nessus_agent/sbin/nessus-service + opt/nessus_agent/sbin/nessuscli + opt/nessus_agent/sbin/nessusd" + +S="${WORKDIR}" + +pkg_nofetch() { + einfo "Please download ${A} from ${HOMEPAGE}/agent-download" + einfo "The archive should then be placed into ${DISTDIR}." +} + +src_install() { + # Using doins -r would strip executable bits from all binaries + cp -pPR "${S}"/opt "${D}"/ || die "Failed to copy files" + + pax-mark m "${D}"/opt/nessus_agent/sbin/nessusd + + # Make sure these originally empty directories do not vanish, + # Nessus will not run properly without them + keepdir /opt/nessus_agent/com/nessus/CA + keepdir /opt/nessus_agent/etc/nessus + keepdir /opt/nessus_agent/var/nessus/logs + keepdir /opt/nessus_agent/var/nessus/tmp + keepdir /opt/nessus_agent/var/nessus/users + + newinitd "${FILESDIR}"/nessusagent.initd nessusagent + systemd_dounit usr/lib/systemd/system/nessusagent.service +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "In order to link the agent to Tenable.io or an instance of Nessus Manager," + elog "obtain an appropriate linking key and run" + elog "" + elog " /opt/nessus_agent/sbin/nessuscli agent link --key= --host= --port= [optional parameters]" + elog "" + elog "This can be done before the agent is started." + fi +} -- cgit v1.2.3-65-gdbad