forked from netdata/netdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
netdata.spec.in
93 lines (78 loc) · 2.21 KB
/
netdata.spec.in
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
87
88
89
90
91
92
93
%if 0%{?fedora} || 0%{?rhel} >= 7
%global do_systemd 1
%else
%global do_systemd 0
%endif
Summary: Linux real time system monitoring, over the web
Name: @PACKAGE_NAME@
Version: @PACKAGE_RPM_VERSION@
Release: @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
License: GPLv2+
URL: http://firehol.org
Source: %{name}-@[email protected]
BuildRequires: libmnl-devel
BuildRequires: zlib-devel
Requires: libmnl
Requires: zlib
%if !0%{?rhel}
BuildRequires: libnetfilter_acct-devel
Requires: libnetfilter_acct
%endif
%if 0%{do_systemd}
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Real-time performance monitoring, in the greatest possible detail!
%pre
getent group netdata > /dev/null || groupadd -r netdata
getent passwd netdata > /dev/null || useradd -r -g netdata -c netdata -s /sbin/nologin -d / netdata
%if 0%{do_systemd}
%post
%systemd_post netdata.service
%preun
%systemd_preun netdata.service
%postun
%systemd_postun_with_restart netdata.service
%endif
%global ovirt_create_user_engine \
%_ovirt_create_user %{engine_user} %{engine_uid} %{engine_group} %{engine_gid} "%{ovirt_user_description}" %{engine_state}
%prep
%setup -q -n %{name}-@PACKAGE_VERSION@
%build
%configure \
--docdir="%{_docdir}/%{name}-%{version}" \
--with-zlib \
--with-math \
--with-user=netdata \
%if !0%{?rhel}
--enable-plugin-nfacct \
%endif
%{?conf}
make %{?_smp_mflags}
%install
rm -rf "%{buildroot}"
make %{?_smp_mflags} install DESTDIR="%{buildroot}"
find "%{buildroot}" -name .keep -exec rm {} \;
%if 0%{do_systemd}
install -m 0755 -d "%{buildroot}/%{_unitdir}"
install -m 0644 system/netdata.service "%{buildroot}/%{_unitdir}"
%endif
%files
%attr(-, netdata, netdata) %dir %{_localstatedir}/cache/%{name}/
%attr(-, netdata, netdata) %dir %{_localstatedir}/log/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/
%{_datadir}/%{name}/
%{_libexecdir}/%{name}/
%{_sbindir}/%{name}
%if 0%{do_systemd}
%{_unitdir}/netdata.service
%endif
%changelog
* Tue Mar 22 2016 Costa Tsaousis <[email protected]> - 1.0.0-1
- First public release.
* Sun Nov 15 2015 Alon Bar-Lev <[email protected]> - 0.0.0-1
- Initial add.