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

inherit eutils

DESCRIPTION="A small daemon to collect system statistics into RRD files."
HOMEPAGE="http://collectd.org/"
SRC_URI="http://collectd.org/files/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="lm_sensors hddtemp mysql perl"

DEPEND="net-misc/curl
	>=net-analyzer/rrdtool-1.2
	hddtemp? ( app-admin/hddtemp )
	lm_sensors? ( >=sys-apps/lm_sensors-2.9.0 )
	mysql? ( >=dev-db/mysql-4.1 )"

src_compile() {
	econf $(use_enable lm_sensors sensors) $(use_enable mysql) \
		$(use_enable perl)
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "install failed"

	dodoc AUTHORS ChangeLog README NEWS TODO

	docinto contrib
	dodoc contrib/*

	keepdir /var/lib/collectd

	newinitd "${FILESDIR}/${P}.initd" collectd
	newconfd "${FILESDIR}/${P}.confd" collectd

	insinto /etc
	newins "${FILESDIR}/${P}.conf" collectd.conf
}

pkg_postinst() {
	einfo "collectd introduced some changes in the new 4.x series."
	einfo "For further information, read http://collectd.org/migrate-v3-v4.shtml"
	einfo "The migration script can be found at:"
	einfo "/usr/share/doc/${P}/contrib/migrate-3-4.px.bz2"
}