]>
Commit | Line | Data |
---|---|---|
dbcc502d ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without systemd # systemd | |
4 | %bcond_with nfacct # build with nfacct plugin | |
5 | ||
6 | Summary: Linux real time system monitoring, over the web | |
7 | Name: netdata | |
8 | Version: 1.0.0 | |
1229dd1c | 9 | Release: 0.3 |
4f48df40 | 10 | License: GPL v3+ |
dbcc502d ER |
11 | Group: Applications/System |
12 | Source0: https://github.com/firehol/netdata/archive/v%{version}/%{name}-%{version}.tar.gz | |
13 | # Source0-md5: 53a432f8849da6bd49b0853dd79551c5 | |
14 | URL: http://netdata.firehol.org/ | |
085a70e6 ER |
15 | BuildRequires: autoconf |
16 | BuildRequires: automake | |
65ecfdca | 17 | %{?with_nfacct:BuildRequires: libmnl-devel} |
dbcc502d | 18 | %{?with_nfacct:BuildRequires: libnetfilter_acct-devel} |
085a70e6 | 19 | BuildRequires: pkgconfig |
1229dd1c | 20 | BuildRequires: rpmbuild(macros) >= 1.202 |
dbcc502d | 21 | BuildRequires: zlib-devel |
1229dd1c ER |
22 | Provides: group(netdata) |
23 | Provides: user(netdata) | |
24 | Requires(postun): /usr/sbin/groupdel | |
25 | Requires(postun): /usr/sbin/userdel | |
26 | Requires(pre): /bin/id | |
27 | Requires(pre): /usr/bin/getgid | |
28 | Requires(pre): /usr/sbin/groupadd | |
29 | Requires(pre): /usr/sbin/useradd | |
dbcc502d ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | netdata is the fastest way to visualize metrics. It is a resource | |
34 | efficient, highly optimized system for collecting and visualizing any | |
35 | type of realtime timeseries data, from CPU usage, disk activity, SQL | |
36 | queries, API calls, web site visitors, etc. | |
37 | ||
38 | netdata tries to visualize the truth of now, in its greatest detail, | |
39 | so that you can get insights of what is happening now and what just | |
40 | happened, on your systems and applications. | |
41 | ||
42 | %prep | |
43 | %setup -q | |
44 | ||
45 | %build | |
46 | %{__aclocal} -I m4 | |
47 | %{__autoconf} | |
48 | %{__autoheader} | |
49 | %{__automake} | |
50 | %configure \ | |
51 | --with-zlib \ | |
52 | --with-math \ | |
53 | %{__enable_disable nfacct plugin-nfacct} \ | |
54 | --with-user=netdata | |
55 | %{__make} | |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | %{__make} install \ | |
60 | DESTDIR=$RPM_BUILD_ROOT | |
61 | ||
62 | %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep | |
63 | ||
64 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
65 | cp -p system/netdata-systemd $RPM_BUILD_ROOT%{systemdunitdir}/netdata.service | |
66 | ||
dbcc502d | 67 | %pre |
1229dd1c ER |
68 | %groupadd -g 329 netdata |
69 | %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata | |
70 | ||
71 | %postun | |
72 | if [ "$1" = "0" ]; then | |
73 | %userremove netdata | |
74 | %groupremove netdata | |
75 | fi | |
dbcc502d | 76 | |
1229dd1c | 77 | %if 0 |
dbcc502d ER |
78 | %post |
79 | %systemd_post netdata.service | |
80 | ||
81 | %preun | |
82 | %systemd_preun netdata.service | |
83 | ||
84 | %postun | |
85 | %systemd_postun_with_restart netdata.service | |
86 | %endif | |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %files | |
92 | %defattr(644,root,root,755) | |
93 | %dir %{_sysconfdir}/%{name} | |
94 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
95 | %attr(755,root,root) %{_sbindir}/%{name} | |
96 | %{_datadir}/%{name} | |
5c048d80 | 97 | %dir %{_libexecdir}/%{name} |
dbcc502d ER |
98 | %{systemdunitdir}/netdata.service |
99 | %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name} | |
100 | %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name} | |
5c048d80 ER |
101 | |
102 | %defattr(-,root,root,-) | |
103 | %{_libexecdir}/%{name}/charts.d | |
104 | %{_libexecdir}/%{name}/node.d | |
105 | %{_libexecdir}/%{name}/plugins.d |