summaryrefslogtreecommitdiff
blob: 72ae8abf7e1110aa06e7bf805579b5d61aac9125 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-perl/JKFlow/JKFlow-3.5.2.ebuild,v 1.1 2009/11/01 23:07:04 jer Exp $

inherit depend.apache eutils

MY_PN="${PN/JKF/jkf}"
MY_P="${MY_PN}-v${PV}"

DESCRIPTION="XML configurable FlowScan module for processing flows"
HOMEPAGE="http://users.telenet.be/jurgen.kobierczynski/jkflow/JKFlow.html"
SRC_URI="http://users.telenet.be/jurgen.kobierczynski/${MY_PN}/${MY_P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

RDEPEND="dev-lang/perl
		net-analyzer/FlowScan
		dev-perl/XML-Simple
		dev-perl/Net-Patricia"
DEPEND=""

need_apache

S="${WORKDIR}/${PN}-v${PV}"

src_unpack() {
	unpack ${A}

	cd "${S}"
	sed -i "s%my \$rrddir = \"/var/flows/reports/rrds/\";%my \$rrddir = \"/var/lib/flows/rrds/\";%" JKGrapher.pl \
		|| die "sed failed"
}

src_install() {
	exeinto /var/lib/flows/bin
	doexe JKFlow.pm
	insinto /var/lib/flows/bin
	doins JKFlow_example_routers.xml JKFlow_example_sites.xml
	exeinto /var/www/localhost/cgi-bin
	doexe JKGrapher.pl
	ewarn "JKGrapher.pl has been placed in /var/www/localhost/cgi-bin"
	ewarn "If this is not where your cgi-bin directory is then you must"
	ewarn "move it manually"

}

pkg_postinst() {
	chown flows:flows /var/lib/flows/bin/JKFlow.pm
	chown flows:flows /var/lib/flows/bin/JKFlow_example_routers.xml
	chown flows:flows /var/lib/flows/bin/JKFlow_example_sites.xml
	elog
	elog "You will need to add the following line to flowscan.cf:"
	elog "	ReportClasses JKFlow"
	elog "You must also comment out any other lines that contain"
	elog "ReportClasses."
	elog
	elog "JKFlows configuration is complex. You should review"
	elog "the two sample configuration files in /var/lib/flows/bin"
	elog "and use them as a basis for configuration for your own"
	elog "network. More information can be found at:"
	elog "http://users.telenet.be/jurgen.kobierczynski/jkflow/eindwerk.pdf"
	elog
}