]> git.pld-linux.org Git - packages/netdata.git/blob - netdata.spec
- up to 1.6.0
[packages/netdata.git] / netdata.spec
1 #
2 # Conditional build:
3 %bcond_without  nfacct          # build with nfacct plugin
4
5 Summary:        Linux real time performance monitoring
6 Name:           netdata
7 Version:        1.6.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:  7a33f146702ebb29cc9518b33ec911a0
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 Suggests:       %{name}-python
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         _libexecdir     %{_prefix}/lib
42
43 %description
44 netdata is the fastest way to visualize metrics. It is a resource
45 efficient, highly optimized system for collecting and visualizing any
46 type of realtime timeseries data, from CPU usage, disk activity, SQL
47 queries, API calls, web site visitors, etc.
48
49 netdata tries to visualize the truth of now, in its greatest detail,
50 so that you can get insights of what is happening now and what just
51 happened, on your systems and applications.
52
53 %package charts
54 Summary:        netdata charts plugin
55 Group:          Applications/System
56 URL:            https://github.com/firehol/netdata/wiki/General-Info---charts.d
57 Requires:       %{name} = %{version}-%{release}
58 Requires:       bash >= 4
59 %if "%{_rpmversion}" >= "5"
60 BuildArch:      noarch
61 %endif
62
63 %description charts
64 Charts.d is BaSH script that allows you to write simple scripts for
65 collecting data.
66
67 It has been designed so that the actual script that will do data
68 collection will be permanently in memory, collecting data with as
69 little overheads as possible (i.e. initialize once, repeatedly collect
70 values with minimal overhead).
71
72 Charts.d looks for scripts in charts.d. The scripts should have the
73 filename suffix: .chart.sh.
74
75 %package nodejs
76 Summary:        netdata node.js plugins
77 Group:          Applications/System
78 URL:            https://github.com/firehol/netdata/wiki/General-Info---node.d
79 Requires:       %{name} = %{version}-%{release}
80 %if "%{_rpmversion}" >= "5"
81 BuildArch:      noarch
82 %endif
83
84 %description nodejs
85 node.d.plugin is a netdata plugin that provides an abstraction layer
86 to allow easy and quick development of data collectors in node.js. It
87 also manages all its data collectors (placed in node.d) using a single
88 instance of node, thus lowering the memory footprint of data
89 collection.
90
91 %package python
92 Summary:        netdata Python plugins
93 Group:          Applications/System
94 URL:            https://github.com/firehol/netdata/wiki/How-to-write-new-module
95 Requires:       %{name} = %{version}-%{release}
96 %if "%{_rpmversion}" >= "5"
97 BuildArch:      noarch
98 %endif
99
100 %description python
101 Netdata Python plugins.
102
103 %prep
104 %setup -q
105 %patch0 -p1
106
107 %build
108 %{__aclocal} -I m4
109 %{__autoconf}
110 %{__autoheader}
111 %{__automake}
112 %configure \
113         --libdir=%{_libexecdir} \
114         --with-zlib \
115         --with-math \
116         %{__enable_disable nfacct plugin-nfacct} \
117         --with-user=netdata
118 %{__make}
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 %{__make} install \
123         DESTDIR=$RPM_BUILD_ROOT
124
125 %{__rm} $RPM_BUILD_ROOT/var/{cache,lib,log}/netdata/.keep
126 %{__rm} $RPM_BUILD_ROOT/var/lib/netdata/registry/.keep
127
128 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},%{_localstatedir}/lib/%{name}/registry}
129 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
130 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
131 cp -p system/netdata.service $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
132
133 %clean
134 rm -rf $RPM_BUILD_ROOT
135
136 %pre
137 %groupadd -g 329 netdata
138 %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata
139
140 %post
141 /sbin/chkconfig --add netdata
142 %service netdata restart
143 %systemd_post netdata.service
144
145 %preun
146 if [ "$1" = "0" ]; then
147         %service -q netdata stop
148         /sbin/chkconfig --del netdata
149 fi
150 %systemd_preun netdata.service
151
152 %postun
153 if [ "$1" = "0" ]; then
154         %userremove netdata
155         %groupremove netdata
156 fi
157 %systemd_reload
158
159 %files
160 %defattr(644,root,root,755)
161 %dir %{_sysconfdir}/%{name}
162 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/apps_groups.conf
163 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/netdata.conf
164 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/fping.conf
165 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/health_alarm_notify.conf
166 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/health_email_recipients.conf
167 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/stream.conf
168 %dir %{_sysconfdir}/%{name}/health.d
169 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/health.d/*.conf
170 %attr(754,root,root) /etc/rc.d/init.d/netdata
171 %attr(755,root,root) %{_sbindir}/%{name}
172 %dir %{_datadir}/%{name}
173 %dir %{_libexecdir}/%{name}
174 %{systemdunitdir}/netdata.service
175 %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
176 %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name}
177 %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
178 %attr(755,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry
179
180 %defattr(-,root,root,-)
181 %{_libexecdir}/%{name}/plugins.d
182 # subpackages
183 %exclude %{_libexecdir}/%{name}/plugins.d/node.d.plugin
184 %exclude %{_libexecdir}/%{name}/plugins.d/charts.d*
185
186 %defattr(-,root,netdata,-)
187 %{_datadir}/%{name}/web
188
189 %files charts
190 %defattr(644,root,root,755)
191 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/charts.d.conf
192 %dir %{_sysconfdir}/%{name}/charts.d
193 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/charts.d/*.conf
194 %attr(755,root,root) %{_libexecdir}/%{name}/plugins.d/charts.d*
195 %dir %{_libexecdir}/%{name}/charts.d
196 %{_libexecdir}/%{name}/charts.d/README.md
197 %attr(755,root,root) %{_libexecdir}/%{name}/charts.d/*.chart.sh
198
199 %files nodejs
200 %defattr(644,root,root,755)
201 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/node.d.conf
202 %dir %{_sysconfdir}/%{name}/node.d
203 %attr(755,root,root) %{_libexecdir}/%{name}/plugins.d/node.d.plugin
204 %dir %{_libexecdir}/%{name}/node.d
205 %{_libexecdir}/%{name}/node.d/README.md
206 %{_libexecdir}/%{name}/node.d/node_modules
207 %attr(755,root,root) %{_libexecdir}/%{name}/node.d/*.node.js
208
209 %files python
210 %defattr(644,root,root,755)
211 %dir %{_sysconfdir}/%{name}/python.d
212 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/python.d.conf
213 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/python.d/*.conf
214 %dir %{_libexecdir}/%{name}/python.d
215 %{_libexecdir}/%{name}/python.d/README.md
216 %attr(755,root,root) %{_libexecdir}/%{name}/python.d/*.chart.py
217
218 # XXX system packages
219 %{_libexecdir}/%{name}/python.d/python-modules-installer.sh
220 %dir %{_libexecdir}/%{name}/python.d/python_modules
221 %{_libexecdir}/%{name}/python.d/python_modules/*.py
222 %{_libexecdir}/%{name}/python.d/python_modules/pyyaml2
223 %{_libexecdir}/%{name}/python.d/python_modules/pyyaml3
This page took 0.045865 seconds and 4 git commands to generate.