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