]>
Commit | Line | Data |
---|---|---|
dbcc502d ER |
1 | # |
2 | # Conditional build: | |
dbcc502d ER |
3 | %bcond_with nfacct # build with nfacct plugin |
4 | ||
94cfc344 | 5 | Summary: Linux real time performance monitoring |
dbcc502d | 6 | Name: netdata |
94cfc344 | 7 | Version: 1.2.0 |
cf647efe | 8 | Release: 1 |
4f48df40 | 9 | License: GPL v3+ |
dbcc502d | 10 | Group: Applications/System |
94cfc344 ER |
11 | Source0: https://github.com/firehol/netdata/releases/download/v%{version}/%{name}-%{version}.tar.xz |
12 | # Source0-md5: c23fd94e899e8934c47b14151043be27 | |
01f0b59e | 13 | Source1: %{name}.conf |
1aa35efd | 14 | Source2: %{name}.init |
ea1ae9aa | 15 | Patch0: nodejs.patch |
dbcc502d | 16 | URL: http://netdata.firehol.org/ |
085a70e6 ER |
17 | BuildRequires: autoconf |
18 | BuildRequires: automake | |
65ecfdca | 19 | %{?with_nfacct:BuildRequires: libmnl-devel} |
dbcc502d | 20 | %{?with_nfacct:BuildRequires: libnetfilter_acct-devel} |
c5372cd5 | 21 | BuildRequires: libuuid-devel |
085a70e6 | 22 | BuildRequires: pkgconfig |
1aa35efd | 23 | BuildRequires: rpmbuild(macros) >= 1.647 |
dbcc502d | 24 | BuildRequires: zlib-devel |
1229dd1c ER |
25 | Provides: group(netdata) |
26 | Provides: user(netdata) | |
1aa35efd ER |
27 | Requires(post,preun): /sbin/chkconfig |
28 | Requires(post,preun,postun): systemd-units >= 38 | |
1229dd1c ER |
29 | Requires(postun): /usr/sbin/groupdel |
30 | Requires(postun): /usr/sbin/userdel | |
31 | Requires(pre): /bin/id | |
32 | Requires(pre): /usr/bin/getgid | |
33 | Requires(pre): /usr/sbin/groupadd | |
34 | Requires(pre): /usr/sbin/useradd | |
1aa35efd | 35 | Requires: rc-scripts |
1aa35efd ER |
36 | Suggests: %{name}-charts |
37 | Suggests: %{name}-nodejs | |
dbcc502d ER |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
f241237d ER |
40 | %define _libexecdir %{_prefix}/lib |
41 | ||
dbcc502d ER |
42 | %description |
43 | netdata is the fastest way to visualize metrics. It is a resource | |
44 | efficient, highly optimized system for collecting and visualizing any | |
45 | type of realtime timeseries data, from CPU usage, disk activity, SQL | |
46 | queries, API calls, web site visitors, etc. | |
47 | ||
48 | netdata tries to visualize the truth of now, in its greatest detail, | |
49 | so that you can get insights of what is happening now and what just | |
50 | happened, on your systems and applications. | |
51 | ||
bd51d1ce ER |
52 | %package charts |
53 | Summary: netdata charts plugin | |
54 | Group: Applications/System | |
55 | URL: https://github.com/firehol/netdata/wiki/General-Info---charts.d | |
56 | Requires: %{name} = %{version}-%{release} | |
57 | Requires: bash >= 4 | |
58 | %if "%{_rpmversion}" >= "5" | |
59 | BuildArch: noarch | |
60 | %endif | |
61 | ||
62 | %description charts | |
63 | Charts.d is BaSH script that allows you to write simple scripts for | |
64 | collecting data. | |
65 | ||
66 | It has been designed so that the actual script that will do data | |
67 | collection will be permanently in memory, collecting data with as | |
68 | little overheads as possible (i.e. initialize once, repeatedly collect | |
69 | values with minimal overhead). | |
70 | ||
71 | Charts.d looks for scripts in charts.d. The scripts should have the | |
72 | filename suffix: .chart.sh. | |
73 | ||
f241237d ER |
74 | %package nodejs |
75 | Summary: netdata node.js plugins | |
76 | Group: Applications/System | |
77 | URL: https://github.com/firehol/netdata/wiki/General-Info---node.d | |
78 | Requires: %{name} = %{version}-%{release} | |
f241237d ER |
79 | %if "%{_rpmversion}" >= "5" |
80 | BuildArch: noarch | |
81 | %endif | |
82 | ||
83 | %description nodejs | |
84 | node.d.plugin is a netdata plugin that provides an abstraction layer | |
85 | to allow easy and quick development of data collectors in node.js. It | |
86 | also manages all its data collectors (placed in node.d) using a single | |
87 | instance of node, thus lowering the memory footprint of data | |
88 | collection. | |
89 | ||
dbcc502d ER |
90 | %prep |
91 | %setup -q | |
ea1ae9aa | 92 | %patch0 -p1 |
dbcc502d ER |
93 | |
94 | %build | |
95 | %{__aclocal} -I m4 | |
96 | %{__autoconf} | |
97 | %{__autoheader} | |
98 | %{__automake} | |
99 | %configure \ | |
f241237d | 100 | --libdir=%{_libexecdir} \ |
dbcc502d ER |
101 | --with-zlib \ |
102 | --with-math \ | |
103 | %{__enable_disable nfacct plugin-nfacct} \ | |
104 | --with-user=netdata | |
105 | %{__make} | |
106 | ||
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | %{__make} install \ | |
110 | DESTDIR=$RPM_BUILD_ROOT | |
111 | ||
cf647efe | 112 | %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep |
1aa35efd | 113 | |
2f40a1c0 | 114 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},%{_localstatedir}/lib/%{name}/registry} |
f241237d | 115 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf |
1aa35efd | 116 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
f5dc427f | 117 | cp -p system/netdata.service $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service |
01f0b59e | 118 | |
1aa35efd ER |
119 | %clean |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
dbcc502d | 122 | %pre |
1229dd1c ER |
123 | %groupadd -g 329 netdata |
124 | %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata | |
125 | ||
dbcc502d | 126 | %post |
1aa35efd ER |
127 | /sbin/chkconfig --add netdata |
128 | %service netdata restart | |
dbcc502d ER |
129 | %systemd_post netdata.service |
130 | ||
131 | %preun | |
1aa35efd ER |
132 | if [ "$1" = "0" ]; then |
133 | %service -q netdata stop | |
134 | /sbin/chkconfig --del netdata | |
135 | fi | |
dbcc502d ER |
136 | %systemd_preun netdata.service |
137 | ||
138 | %postun | |
1aa35efd ER |
139 | if [ "$1" = "0" ]; then |
140 | %userremove netdata | |
141 | %groupremove netdata | |
142 | fi | |
143 | %systemd_reload | |
dbcc502d ER |
144 | |
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %dir %{_sysconfdir}/%{name} | |
c8a7f904 ER |
148 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/apps_groups.conf |
149 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/netdata.conf | |
1aa35efd | 150 | %attr(754,root,root) /etc/rc.d/init.d/netdata |
dbcc502d | 151 | %attr(755,root,root) %{_sbindir}/%{name} |
cf647efe | 152 | %dir %{_datadir}/%{name} |
5c048d80 | 153 | %dir %{_libexecdir}/%{name} |
dbcc502d ER |
154 | %{systemdunitdir}/netdata.service |
155 | %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name} | |
156 | %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name} | |
2f40a1c0 ER |
157 | %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name} |
158 | %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry | |
5c048d80 ER |
159 | |
160 | %defattr(-,root,root,-) | |
5c048d80 | 161 | %{_libexecdir}/%{name}/plugins.d |
bd51d1ce | 162 | # subpackages |
9c1cee53 | 163 | %exclude %{_libexecdir}/%{name}/plugins.d/node.d.plugin |
bd51d1ce ER |
164 | %exclude %{_libexecdir}/%{name}/plugins.d/charts.d* |
165 | ||
cf647efe ER |
166 | %defattr(-,root,netdata,-) |
167 | %{_datadir}/%{name}/web | |
168 | ||
bd51d1ce ER |
169 | %files charts |
170 | %defattr(644,root,root,755) | |
c8a7f904 | 171 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/charts.d.conf |
bd51d1ce ER |
172 | %attr(755,root,root) %{_libexecdir}/%{name}/plugins.d/charts.d* |
173 | %dir %{_libexecdir}/%{name}/charts.d | |
174 | %{_libexecdir}/%{name}/charts.d/README.md | |
175 | %attr(755,root,root) %{_libexecdir}/%{name}/charts.d/*.chart.sh | |
f241237d ER |
176 | |
177 | %files nodejs | |
178 | %defattr(644,root,root,755) | |
9c1cee53 | 179 | %attr(755,root,root) %{_libexecdir}/%{name}/plugins.d/node.d.plugin |
f241237d ER |
180 | %dir %{_libexecdir}/%{name}/node.d |
181 | %{_libexecdir}/%{name}/node.d/README.md | |
182 | %{_libexecdir}/%{name}/node.d/node_modules | |
183 | %attr(755,root,root) %{_libexecdir}/%{name}/node.d/*.node.js |