summaryrefslogtreecommitdiff
blob: d5579e65c26b330aa604b6ca1878ff6fde0026f1 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit toolchain-funcs eutils multilib

DESCRIPTION="highly configurable service monitoring daemon"
HOMEPAGE="http://www.kernel.org/software/mon/"
SRC_URI="mirror://kernel/software/admin/mon/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc x86"
IUSE="ldap mysql pam"

DEPEND=">=dev-perl/Mon-0.11
	>=virtual/perl-Time-HiRes-1.20
	dev-perl/Convert-BER
	dev-perl/Filesys-DiskSpace
	dev-perl/Net-Telnet
	ldap? ( dev-perl/perl-ldap )
	dev-perl/Expect
	dev-perl/Net-DNS
	mysql? ( dev-perl/DBD-mysql )
	pam? ( dev-perl/Authen-PAM )
	>=dev-perl/Period-1.20-r2"

src_unpack() {
	unpack "${A}"
	cd "${S}"
	epatch "${FILESDIR}/${P}-sendmail.patch"
	epatch "${FILESDIR}/${P}-syslog.patch"
}

src_compile() {
	cd "${S}"/mon.d
	make CC="$(tc-getCC) ${CFLAGS}" || die
}

src_install() {
	dosbin mon clients/mon*

	insinto /usr/$(get_libdir)/mon/utils
	doins utils/*

	exeinto /usr/$(get_libdir)/mon/alert.d
	doexe alert.d/*

	exeinto /usr/$(get_libdir)/mon/mon.d
	doexe mon.d/*.monitor

	insopts -g uucp -m 02555
	doins mon.d/*.wrap

	dodir /var/log/mon.d
	dodir /var/lib/mon.d

	doman doc/*.{1,8}
	dodoc CHANGES doc/CHANGES* CREDITS \
		KNOWN-PROBLEMS README TODO VERSION \
		doc/README* doc/*.txt
	docinto etc; dodoc etc/*
	newdoc "${FILESDIR}"/mon.cf mon.cf.sample

	newinitd "${FILESDIR}"/mon.init mon
	insinto /etc/mon
	newins "${FILESDIR}"/mon.cf mon.cf.sample
}