# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Network Management and Monitoring System." HOMEPAGE="http://www.jffnms.org/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="mysql postgres snmp" DEPEND="net-www/apache mysql? ( dev-db/mysql ) postgres? ( dev-db/postgresql ) >=net-analyzer/rrdtool-1.0.33 media-libs/gd dev-php/php dev-php/mod_php snmp? ( net-analyzer/net-snmp ) sys-apps/diffutils media-gfx/graphviz net-analyzer/nmap net-analyzer/fping" pkg_setup() { if ! built_with_use php gd ; then eerror "You need to build php with gd flag" die "Flag gd not found in php" fi if ! built_with_use mod_php gd ; then eerror "You need to build mod_php with gd flag" die "Flag gd not found in mod_php" fi enewgroup jffnms enewuser jffnms -1 /bin/bash /dev/null jffnms # Check a better way to do this. usermod -G jffnms apache } src_install(){ dodir /opt/jffnms cp -r * "${D}"/opt/jffnms || die chown -R jffnms:jffnms "${D}"/opt/jffnms || die chmod 770 "${D}"/opt/jffnms || die chmod -R ug+gw "${D}"/opt/jffnms || die einfo "If you want UDP port monitoring and discovery, you still need" einfo "to set nmap and fping as a SUID programns. This may give you " einfo "a security hole in case there's a bug in one of them, as such" einfo "ebuild itself won't do that for you. To set them as a SUID" einfo "programs you can run the following commands:" einfo "" einfo "chmod +s /usr/bin/nmap && chmod a+x /usr/bin/nmap" einfo "chmod +s /usr/sbin/fping && chmod a+x /usr/sbin/fping" }