]> arthur.barton.de Git - netdata.git/blob - netdata-9999.ebuild
build: rename systemd service and reorg system directory
[netdata.git] / netdata-9999.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 inherit linux-info systemd user
8
9 if [[ ${PV} == "9999" ]] ; then
10         EGIT_REPO_URI="git://github.com/firehol/${PN}.git"
11         EGIT_BRANCH="master"
12         inherit git-r3 autotools
13         SRC_URI=""
14         KEYWORDS=""
15 else
16         SRC_URI="http://firehol.org/download/${PN}/releases/v${PV}/${P}.tar.xz"
17 fi
18
19
20 DESCRIPTION="Linux real time system monitoring, over the web!"
21 HOMEPAGE="https://github.com/firehol/netdata"
22
23 LICENSE="GPL-3+"
24 SLOT="0"
25 KEYWORDS="~amd64 ~x86"
26 IUSE="+zlib nfacct nodejs"
27
28 # most unconditional dependencies are for plugins.d/charts.d.plugin:
29 RDEPEND=">=app-shells/bash-4
30         sys-apps/sed
31         sys-apps/grep
32         virtual/awk
33         net-misc/curl
34         net-misc/wget
35         
36         zlib? ( sys-libs/zlib )
37         
38         nfacct? (
39                 net-firewall/nfacct
40                 net-libs/libmnl
41         )
42
43         nodejs? (
44                 net-libs/nodejs
45         )"
46
47 DEPEND="${RDEPEND}
48         virtual/pkgconfig"
49
50 # check for Kernel-Samepage-Merging (CONFIG_KSM)
51 CONFIG_CHECK="
52         ~KSM
53 "
54
55 pkg_setup() {
56         linux-info_pkg_setup
57
58         enewgroup ${PN}
59         enewuser ${PN} -1 -1 / ${PN}
60 }
61
62 src_unpack() {
63         if [[ ${PV} == "9999" ]] ; then
64                 git-r3_src_unpack
65         fi
66         default
67 }
68
69 src_prepare() {
70         if [[ ${PV} == "9999" ]] ; then
71                 eautoreconf
72         fi
73         default
74 }
75
76 src_configure() {
77         econf \
78                 --localstatedir=/var \
79                 $(use_enable nfacct plugin-nfacct) \
80                 $(use_with zlib) \
81                 --with-user=${PN} \
82                 || die "configure failed"
83 }
84
85 src_install() {
86         default
87
88         fowners ${PN} /var/log/netdata
89
90         newinitd system/netdata-openrc ${PN}
91         systemd_dounit system/netdata.service
92 }