summaryrefslogtreecommitdiff
blob: c7e845daa1090b87bcc6e6f2011337258eda541d (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright 1999-2006 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.11 2006/03/04 17:02:59 chtekk 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="~ppc ~x86"

DEPEND="dev-db/mysql
	virtual/libpcap
	media-libs/gd"
RDEPEND="net-www/apache
	virtual/httpd-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/etc
	dodir /usr/bin

	cp MIDASa/MIDASa.cf.dist ${D}/usr/etc
	cp MIDASb/MIDASb.cf.dist ${D}/usr/etc
	cp MIDASc/MIDASc.cf.dist ${D}/usr/etc
	cp MIDASd/MIDASd.cf.dist ${D}/usr/etc
	cp MIDASs/MIDASs.cf.dist ${D}/usr/etc
	cp MIDASn/MIDASn.cf.dist ${D}/usr/etc
	cp MIDASa/MIDASa ${D}/usr/bin
	cp MIDASb/MIDASb ${D}/usr/bin
	cp MIDASc/MIDASc ${D}/usr/bin
	cp MIDASd/MIDASd ${D}/usr/bin
	cp MIDASs/MIDASs ${D}/usr/bin
	cp MIDASn/MIDASn ${D}/usr/bin

	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
}