]>
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 | |
f241237d | 9 | Release: 0.7 |
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 |
f241237d | 23 | Suggests: %{name}-nodejs |
1229dd1c ER |
24 | Provides: group(netdata) |
25 | Provides: user(netdata) | |
26 | Requires(postun): /usr/sbin/groupdel | |
27 | Requires(postun): /usr/sbin/userdel | |
28 | Requires(pre): /bin/id | |
29 | Requires(pre): /usr/bin/getgid | |
30 | Requires(pre): /usr/sbin/groupadd | |
31 | Requires(pre): /usr/sbin/useradd | |
dbcc502d ER |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
f241237d ER |
34 | %define _libexecdir %{_prefix}/lib |
35 | ||
dbcc502d ER |
36 | %description |
37 | netdata is the fastest way to visualize metrics. It is a resource | |
38 | efficient, highly optimized system for collecting and visualizing any | |
39 | type of realtime timeseries data, from CPU usage, disk activity, SQL | |
40 | queries, API calls, web site visitors, etc. | |
41 | ||
42 | netdata tries to visualize the truth of now, in its greatest detail, | |
43 | so that you can get insights of what is happening now and what just | |
44 | happened, on your systems and applications. | |
45 | ||
f241237d ER |
46 | %package nodejs |
47 | Summary: netdata node.js plugins | |
48 | Group: Applications/System | |
49 | URL: https://github.com/firehol/netdata/wiki/General-Info---node.d | |
50 | Requires: %{name} = %{version}-%{release} | |
51 | Requires: nodejs | |
52 | %if "%{_rpmversion}" >= "5" | |
53 | BuildArch: noarch | |
54 | %endif | |
55 | ||
56 | %description nodejs | |
57 | node.d.plugin is a netdata plugin that provides an abstraction layer | |
58 | to allow easy and quick development of data collectors in node.js. It | |
59 | also manages all its data collectors (placed in node.d) using a single | |
60 | instance of node, thus lowering the memory footprint of data | |
61 | collection. | |
62 | ||
dbcc502d ER |
63 | %prep |
64 | %setup -q | |
65 | ||
66 | %build | |
67 | %{__aclocal} -I m4 | |
68 | %{__autoconf} | |
69 | %{__autoheader} | |
70 | %{__automake} | |
71 | %configure \ | |
f241237d | 72 | --libdir=%{_libexecdir} \ |
dbcc502d ER |
73 | --with-zlib \ |
74 | --with-math \ | |
75 | %{__enable_disable nfacct plugin-nfacct} \ | |
76 | --with-user=netdata | |
77 | %{__make} | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | %{__make} install \ | |
82 | DESTDIR=$RPM_BUILD_ROOT | |
83 | ||
f241237d | 84 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf |
01f0b59e | 85 | |
dbcc502d ER |
86 | %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep |
87 | ||
88 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
89 | cp -p system/netdata-systemd $RPM_BUILD_ROOT%{systemdunitdir}/netdata.service | |
90 | ||
dbcc502d | 91 | %pre |
1229dd1c ER |
92 | %groupadd -g 329 netdata |
93 | %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata | |
94 | ||
95 | %postun | |
96 | if [ "$1" = "0" ]; then | |
97 | %userremove netdata | |
98 | %groupremove netdata | |
99 | fi | |
dbcc502d | 100 | |
1229dd1c | 101 | %if 0 |
dbcc502d ER |
102 | %post |
103 | %systemd_post netdata.service | |
104 | ||
105 | %preun | |
106 | %systemd_preun netdata.service | |
107 | ||
108 | %postun | |
109 | %systemd_postun_with_restart netdata.service | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %files | |
116 | %defattr(644,root,root,755) | |
117 | %dir %{_sysconfdir}/%{name} | |
118 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
119 | %attr(755,root,root) %{_sbindir}/%{name} | |
120 | %{_datadir}/%{name} | |
5c048d80 | 121 | %dir %{_libexecdir}/%{name} |
dbcc502d ER |
122 | %{systemdunitdir}/netdata.service |
123 | %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name} | |
124 | %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name} | |
5c048d80 ER |
125 | |
126 | %defattr(-,root,root,-) | |
127 | %{_libexecdir}/%{name}/charts.d | |
5c048d80 | 128 | %{_libexecdir}/%{name}/plugins.d |
f241237d ER |
129 | |
130 | %files nodejs | |
131 | %defattr(644,root,root,755) | |
132 | %dir %{_libexecdir}/%{name}/node.d | |
133 | %{_libexecdir}/%{name}/node.d/README.md | |
134 | %{_libexecdir}/%{name}/node.d/node_modules | |
135 | %attr(755,root,root) %{_libexecdir}/%{name}/node.d/*.node.js |