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