# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ MY_P="Nessus-${PV}" DESCRIPTION="A remote security scanner for Linux" HOMEPAGE="http://www.nessus.org" SRC_URI="x86? ( ${MY_P}-linux-generic32.tar.gz ) amd64? ( ${MY_P}-linux-generic64.tar.gz )" RESTRICT="mirror fetch strip" LICENSE="Nessus-EULA" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="X" DEPEND="X? ( net-analyzer/nessus-client ) sys-libs/zlib" pkg_nofetch() { if use x86; then einfo "Please download ${MY_P}-linux-generic32.tar.gz from ${HOMEPAGE}/download" einfo "The archive should then be placed into ${DISTDIR}." fi if use amd64; then einfo "Please download ${MY_P}-linux-generic64.tar.gz from ${HOMEPAGE}/download" einfo "The archive should then be placed into ${DISTDIR}." fi } pkg_setup() { case ${CHOST} in i586-pc-linux-gnu*) einfo "Found compatible architecture." ;; i686-pc-linux-gnu*) einfo "Found compatible architecture." ;; x86_64-pc-linux-gnu*) einfo "Found compatible architecture." ;; *) die "No compatible architecture found." ;; esac } src_install() { # unpack the inner nessus.tar.gz cd ${WORKDIR}/${MY_P} tar zxvf nessus.tar.gz # copy files cp -pPR ${WORKDIR}/${MY_P}/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 PATH and MANPATH for convenience 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-initd nessusd-bin } pkg_postinst() { elog "You can get started running the following commands:" elog "/opt/nessus/sbin/nessus-adduser" elog "/opt/nessus/sbin/nessus-mkcert" elog "/opt/nessus/bin/nessus-fetch --register " elog "/etc/init.d/nessusd-bin start" elog elog "If you had a previous version of Nessus installed, use" elog "the following command to update the plugin database:" elog "/opt/nessus/sbin/nessusd -R" elog elog "For more information about nessus, please visit" elog "${HOMEPAGE}/documentation/" }