]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_with nfacct # build with nfacct plugin | |
4 | ||
5 | Summary: Linux real time performance monitoring | |
6 | Name: netdata | |
7 | Version: 1.2.0 | |
8 | Release: 1 | |
9 | License: GPL v3+ | |
10 | Group: Applications/System | |
11 | Source0: https://github.com/firehol/netdata/releases/download/v%{version}/%{name}-%{version}.tar.xz | |
12 | # Source0-md5: c23fd94e899e8934c47b14151043be27 | |
13 | Source1: %{name}.conf | |
14 | Source2: %{name}.init | |
15 | Patch0: nodejs.patch | |
16 | URL: http://netdata.firehol.org/ | |
17 | BuildRequires: autoconf | |
18 | BuildRequires: automake | |
19 | %{?with_nfacct:BuildRequires: libmnl-devel} | |
20 | %{?with_nfacct:BuildRequires: libnetfilter_acct-devel} | |
21 | BuildRequires: libuuid-devel | |
22 | BuildRequires: pkgconfig | |
23 | BuildRequires: rpmbuild(macros) >= 1.647 | |
24 | BuildRequires: zlib-devel | |
25 | Provides: group(netdata) | |
26 | Provides: user(netdata) | |
27 | Requires(post,preun): /sbin/chkconfig | |
28 | Requires(post,preun,postun): systemd-units >= 38 | |
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 | |
35 | Requires: rc-scripts | |
36 | Suggests: %{name}-charts | |
37 | Suggests: %{name}-nodejs | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %define _libexecdir %{_prefix}/lib | |
41 | ||
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 | ||
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 | ||
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} | |
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 | ||
90 | %prep | |
91 | %setup -q | |
92 | %patch0 -p1 | |
93 | ||
94 | %build | |
95 | %{__aclocal} -I m4 | |
96 | %{__autoconf} | |
97 | %{__autoheader} | |
98 | %{__automake} | |
99 | %configure \ | |
100 | --libdir=%{_libexecdir} \ | |
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 | ||
112 | %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep | |
113 | ||
114 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},%{_localstatedir}/lib/%{name}/registry} | |
115 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf | |
116 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
117 | cp -p system/netdata.service $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service | |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %pre | |
123 | %groupadd -g 329 netdata | |
124 | %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata | |
125 | ||
126 | %post | |
127 | /sbin/chkconfig --add netdata | |
128 | %service netdata restart | |
129 | %systemd_post netdata.service | |
130 | ||
131 | %preun | |
132 | if [ "$1" = "0" ]; then | |
133 | %service -q netdata stop | |
134 | /sbin/chkconfig --del netdata | |
135 | fi | |
136 | %systemd_preun netdata.service | |
137 | ||
138 | %postun | |
139 | if [ "$1" = "0" ]; then | |
140 | %userremove netdata | |
141 | %groupremove netdata | |
142 | fi | |
143 | %systemd_reload | |
144 | ||
145 | %files | |
146 | %defattr(644,root,root,755) | |
147 | %dir %{_sysconfdir}/%{name} | |
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 | |
150 | %attr(754,root,root) /etc/rc.d/init.d/netdata | |
151 | %attr(755,root,root) %{_sbindir}/%{name} | |
152 | %dir %{_datadir}/%{name} | |
153 | %dir %{_libexecdir}/%{name} | |
154 | %{systemdunitdir}/netdata.service | |
155 | %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name} | |
156 | %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name} | |
157 | %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name} | |
158 | %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry | |
159 | ||
160 | %defattr(-,root,root,-) | |
161 | %{_libexecdir}/%{name}/plugins.d | |
162 | # subpackages | |
163 | %exclude %{_libexecdir}/%{name}/plugins.d/node.d.plugin | |
164 | %exclude %{_libexecdir}/%{name}/plugins.d/charts.d* | |
165 | ||
166 | %defattr(-,root,netdata,-) | |
167 | %{_datadir}/%{name}/web | |
168 | ||
169 | %files charts | |
170 | %defattr(644,root,root,755) | |
171 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/charts.d.conf | |
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 | |
176 | ||
177 | %files nodejs | |
178 | %defattr(644,root,root,755) | |
179 | %attr(755,root,root) %{_libexecdir}/%{name}/plugins.d/node.d.plugin | |
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 |