# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils webapp DESCRIPTION="Argus System and Network Monitoring Software." HOMEPAGE="http://argus.tcp4me.com" SRC_URI="http://www.tcp4me.com/code/argus-archive/${P}.tgz" LICENSE="Artistic" #SLOT="0" KEYWORDS="~x86" IUSE="qpage crypt ipv6 ssl" DEPEND="qpage? ( sys-apps/qpage ) crypt? ( dev-perl/Crypt-DES dev-perl/Digest-HMAC dev-perl/Digest-MD5 dev-perl/Digest-SHA1 ) ipv6? ( dev-perl/Socket6 ) ssl? ( dev-perl/Crypt-SSLeay ) >=sys-libs/db-3.2 >=dev-lang/perl-5.6.1 net-analyzer/fping dev-perl/DB_File dev-perl/DBI dev-perl/GD apache" pkg_setup() { webapp_pkg_setup enewuser argus -1 /bin/bash /dev/null apache } src_unpack() { use qpage || ewarn " Not building with qpage, if you want qpage: USE="qpage" emerge net-misc/argus" unpack ${A} && cd "${P}" } src_compile() { dir_bin="${D}/usr/bin" dir_sbin="${D}/usr/sbin" dir_lib="${D}/usr/lib/argus" dir_data="${D}/usr/share/argus" export dir_bin dir_sbin dir_lib dir_data ./Configure sed -e 's^/var/tmp/portage/argus-3.3/image/^^' Makefile > Makefile.out #bait and switch the real makefile with the makefile that has the correct paths #Makefile(.bak) = the original Makefile generated by ./Configure #we need this to install within the sandbox, but we also need #Makefile.out because it contains the correct paths to "compile" into the scripts mv Makefile Makefile.bak mv Makefile.out Makefile emake || die "compile problem" mv Makefile.bak Makefile } src_install() { webapp_src_preinst make install || die mkdir -p ${D}/etc/init.d install -g root -o root -m 0755 ${FILESDIR}/rc.argusd \ ${D}/etc/init.d/argusd || die "could not install init script" exeinto /var/www/localhost/cgi-bin; doexe built/arguscgi || die "could not install arguscgi script" touch .keep dodir /usr/share/argus/stats touch ${D}/usr/share/argus/stats/.keep dodir /usr/share/argus/notify touch ${D}/usr/share/argus/notify/.keep dodir /usr/share/argus/gdata touch ${D}/usr/share/argus/gdata/.keep dodir /usr/share/argus/html touch ${D}/usr/share/argus/html/.keep dodir /usr/share/argus/gcache touch ${D}/usr/share/argus/gcache/.keep rm -f ${D}/usr/sbin/arguscgi || die "Could not unlink ${D}/usr/sbin/arguscgi" #ok the "important stuff" is done now this above makes argus work, #but it's pretty quiet without sound and icons. lets add those here #these directories and paths are created to work with the default#argus config dodir /var/www/localhost/htdocs/sound touch ${D}/var/www/localhost/htdocs/sound/.keep dodir /var/www/localhost/htdocs/img touch ${D}/var/www/localhost/htdocs/img/.keep install -g root -o root -m 0644 misc/whoopwhoop.wav ${D}/var/www/localhost/htdocs/sound install -g root -o root -m 0644 misc/argus.logo.gif ${D}/var/www/localhost/htdocs/img install -g root -o root -m 0644 misc/sad.gif ${D}/var/www/localhost/htdocs/img install -g root -o root -m 0644 misc/smile.gif ${D}/var/www/localhost/htdocs/img install -g root -o root -m 0644 misc/nospkr.gif ${D}/var/www/localhost/htdocs/img install -g root -o root -m 0644 misc/argus.css ${D}/var/www/localhost/htdocs/ webapp_src_install } pkg_postinst() { webapp_pkg_postinst einfo " Configuration: /usr/share/argus/config.example " einfo " User Config: /usr/share/argus/users.example " echo ewarn " You must configure users before running " ewarn " See /usr/share/argus/apache.example for " ewarn " for apache config modifications " echo einfo " Don't forget to set argus on startup: " einfo " rc-update add argusd default " echo einfo " To enable Graphing support add " einfo " graph: yes " einfo " to /usr/share/argus/config " }