summaryrefslogtreecommitdiff
blob: d292e23bdbb877864bb1f157566562d023a0c620 (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
67
68
69
70
71
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/midas-nms/midas-nms-2.2f.ebuild,v 1.5 2004/10/22 02:49:20 mr_bones_ Exp $

inherit webapp

S="${WORKDIR}/MIDAS-${PV}"
DESCRIPTION="Monitoring, Intrusion Detection, Administration System"
SRC_URI="mirror://sourceforge/midas-nms/MIDAS-${PV}.tar.gz"
HOMEPAGE="http://midas-nms.sf.net"
LICENSE="MIT"

KEYWORDS="~x86"

DEPEND="dev-db/mysql
	net-libs/libpcap
	net-www/webapp-config
	media-libs/gd"
RDEPEND="net-www/apache
	dev-php/mod_php"

pkg_setup() {
	webapp_pkg_setup
}

src_compile() {
	econf || die "./configure failed"
	emake || die
}

src_install () {
	webapp_src_preinst

	make DESTDIR=${D} install || die

	dodir /usr/share/midas-nms
	dodir /usr/share/midas-nms/sql
	insinto /usr/share/midas-nms/sql
	doins sql/* /usr/share/midas-nms/sql/

	# web
	cp -r MIDAS/* ${D}${MY_HTDOCSDIR}/
	webapp_serverowned ${MY_HTDOCSDIR}
	webapp_src_install

	# Install documentation.
	dodoc COPYING
	dodoc docs/CHANGELOG
	dodoc docs/INSTALL.txt

	# Init files
	newconfd ${FILESDIR}/midas-nms.conf midas-nms
	newinitd ${FILESDIR}/midas-nms.init midas-nms
}

pkg_postinst() {
	webapp_pkg_postinst
	chown -R :apache /var/www/localhost/htdocs/midas-nms/{inc/config,php-graph}
	chmod g+w /var/www/localhost/htdocs/midas-nms/{inc/config,php-graph}
	cp ${FILESDIR}/install.php /var/www/localhost/htdocs/midas-nms/install

	einfo
	einfo "To install the web interface go to:"
	einfo "http://localhost/midas-nms/install/install.php"
	einfo
	einfo "The conf files are located in /usr/etc/MIDAS*.cf.dist"
	einfo "Please read INSTALL.txt for more info."
	einfo
	einfo "To use the sniffer and IDS you need install snort too."
	einfo
}