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