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