]> git.pld-linux.org Git - packages/netdata.git/blame - netdata.spec
package registry directory; sample config (off)
[packages/netdata.git] / netdata.spec
CommitLineData
dbcc502d
ER
1#
2# Conditional build:
dbcc502d
ER
3%bcond_with nfacct # build with nfacct plugin
4
94cfc344 5Summary: Linux real time performance monitoring
dbcc502d 6Name: netdata
94cfc344 7Version: 1.2.0
cf647efe 8Release: 1
4f48df40 9License: GPL v3+
dbcc502d 10Group: Applications/System
94cfc344
ER
11Source0: https://github.com/firehol/netdata/releases/download/v%{version}/%{name}-%{version}.tar.xz
12# Source0-md5: c23fd94e899e8934c47b14151043be27
01f0b59e 13Source1: %{name}.conf
1aa35efd 14Source2: %{name}.init
ea1ae9aa 15Patch0: nodejs.patch
dbcc502d 16URL: http://netdata.firehol.org/
085a70e6
ER
17BuildRequires: autoconf
18BuildRequires: automake
65ecfdca 19%{?with_nfacct:BuildRequires: libmnl-devel}
dbcc502d 20%{?with_nfacct:BuildRequires: libnetfilter_acct-devel}
085a70e6 21BuildRequires: pkgconfig
1aa35efd 22BuildRequires: rpmbuild(macros) >= 1.647
dbcc502d 23BuildRequires: zlib-devel
1229dd1c
ER
24Provides: group(netdata)
25Provides: user(netdata)
1aa35efd
ER
26Requires(post,preun): /sbin/chkconfig
27Requires(post,preun,postun): systemd-units >= 38
1229dd1c
ER
28Requires(postun): /usr/sbin/groupdel
29Requires(postun): /usr/sbin/userdel
30Requires(pre): /bin/id
31Requires(pre): /usr/bin/getgid
32Requires(pre): /usr/sbin/groupadd
33Requires(pre): /usr/sbin/useradd
1aa35efd 34Requires: rc-scripts
1aa35efd
ER
35Suggests: %{name}-charts
36Suggests: %{name}-nodejs
dbcc502d
ER
37BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
f241237d
ER
39%define _libexecdir %{_prefix}/lib
40
dbcc502d
ER
41%description
42netdata is the fastest way to visualize metrics. It is a resource
43efficient, highly optimized system for collecting and visualizing any
44type of realtime timeseries data, from CPU usage, disk activity, SQL
45queries, API calls, web site visitors, etc.
46
47netdata tries to visualize the truth of now, in its greatest detail,
48so that you can get insights of what is happening now and what just
49happened, on your systems and applications.
50
bd51d1ce
ER
51%package charts
52Summary: netdata charts plugin
53Group: Applications/System
54URL: https://github.com/firehol/netdata/wiki/General-Info---charts.d
55Requires: %{name} = %{version}-%{release}
56Requires: bash >= 4
57%if "%{_rpmversion}" >= "5"
58BuildArch: noarch
59%endif
60
61%description charts
62Charts.d is BaSH script that allows you to write simple scripts for
63collecting data.
64
65It has been designed so that the actual script that will do data
66collection will be permanently in memory, collecting data with as
67little overheads as possible (i.e. initialize once, repeatedly collect
68values with minimal overhead).
69
70Charts.d looks for scripts in charts.d. The scripts should have the
71filename suffix: .chart.sh.
72
f241237d
ER
73%package nodejs
74Summary: netdata node.js plugins
75Group: Applications/System
76URL: https://github.com/firehol/netdata/wiki/General-Info---node.d
77Requires: %{name} = %{version}-%{release}
f241237d
ER
78%if "%{_rpmversion}" >= "5"
79BuildArch: noarch
80%endif
81
82%description nodejs
83node.d.plugin is a netdata plugin that provides an abstraction layer
84to allow easy and quick development of data collectors in node.js. It
85also manages all its data collectors (placed in node.d) using a single
86instance of node, thus lowering the memory footprint of data
87collection.
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
107rm -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 113install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{systemdunitdir},%{_localstatedir}/lib/%{name}/registry}
f241237d 114cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
1aa35efd 115install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
f5dc427f 116cp -p system/netdata.service $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
01f0b59e 117
1aa35efd
ER
118%clean
119rm -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
131if [ "$1" = "0" ]; then
132 %service -q netdata stop
133 /sbin/chkconfig --del netdata
134fi
dbcc502d
ER
135%systemd_preun netdata.service
136
137%postun
1aa35efd
ER
138if [ "$1" = "0" ]; then
139 %userremove netdata
140 %groupremove netdata
141fi
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
This page took 0.089872 seconds and 4 git commands to generate.