1 %global contentdir %{_datadir}/netdata
3 %global distro_post %service_add_post netdata.service
4 %global distro_preun %service_del_preun netdata.service
5 %global distro_postun %service_del_postun netdata.service
6 %global distro_buildrequires BuildRequires:\ systemd-rpm-macros
8 %global distro_post %systemd_post netdata.service
9 %global distro_preun %systemd_preun netdata.service
10 %global distro_postun %systemd_postun_with_restart netdata.service
11 %global distro_buildrequires %{nil}
14 # This is temporary and should eventually be resolved. This bypasses
15 # the default rhel __os_install_post which throws a python compile
17 %global __os_install_post %{nil}
21 %bcond_without systemd # systemd
22 %bcond_with nfacct # build with nfacct plugin
24 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
26 %undefine with_systemd
30 %global netdata_recommends \
32 Recommends: iproute-tc \
33 Recommends: lm_sensors \
34 Recommends: nmap-ncat \
38 Recommends: python2-PyMySQL \
39 Recommends: python2-psycopg2 \
42 %global netdata_recommends %{nil}
45 Summary: Real-time performance monitoring, done right
47 Version: @PACKAGE_RPM_VERSION@
50 Group: Applications/System
51 Source0: http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
52 URL: http://my-netdata.io/
54 BuildRequires: pkgconfig
56 BuildRequires: zlib-devel
57 BuildRequires: libuuid-devel
60 Requires(post): libcap
63 # Packages can be found in the EPEL repo
65 BuildRequires: libmnl-devel
66 BuildRequires: libnetfilter_acct-devel
68 Requires: libnetfilter_acct
71 Requires(pre): /usr/sbin/groupadd
72 Requires(pre): /usr/sbin/useradd
78 Requires(preun): systemd-units
79 Requires(postun): systemd-units
80 Requires(post): systemd-units
83 Requires(post): chkconfig
87 netdata is the fastest way to visualize metrics. It is a resource
88 efficient, highly optimized system for collecting and visualizing any
89 type of realtime timeseries data, from CPU usage, disk activity, SQL
90 queries, API calls, web site visitors, etc.
92 netdata tries to visualize the truth of now, in its greatest detail,
93 so that you can get insights of what is happening now and what just
94 happened, on your systems and applications.
97 %setup -q -n @PACKAGE_NAME@-@PACKAGE_VERSION@
103 %{?with_nfacct:--enable-plugin-nfacct} \
105 %{__make} %{?_smp_mflags}
108 rm -rf "${RPM_BUILD_ROOT}"
109 %{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install
111 find "${RPM_BUILD_ROOT}" -name .keep -delete
113 install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
114 install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
115 install -m 644 -p system/netdata.logrotate "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
118 install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
119 install -m 644 -p system/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
121 # install SYSV init stuff
122 install -d "${RPM_BUILD_ROOT}/etc/rc.d/init.d"
123 install -m 755 system/netdata-init-d \
124 "${RPM_BUILD_ROOT}/etc/rc.d/init.d/netdata"
129 # Add the "netdata" user
130 /usr/sbin/groupadd -r netdata 2> /dev/null || :
131 /usr/sbin/useradd -c "netdata" -g netdata \
132 -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
144 # Add the "netdata" user
145 getent group netdata >/dev/null || groupadd -r netdata
146 getent group docker >/dev/null || groupadd -r docker
147 getent passwd netdata >/dev/null || \
148 useradd -r -g netdata -G docker -s /sbin/nologin \
149 -d %{contentdir} -c "netdata" netdata
153 # Register the netdata service
154 /sbin/chkconfig --add netdata
155 # Only gets run on initial install (not upgrades or uninstalls)
157 # Start the netdata service
158 /sbin/service netdata start
163 # Only gets run on uninstall (not upgrades)
165 /sbin/service netdata stop > /dev/null 2>&1
166 /sbin/chkconfig --del netdata
171 # Only gets run on upgrade (not uninstalls)
173 /sbin/service netdata condrestart 2>&1 > /dev/null
179 rm -rf "${RPM_BUILD_ROOT}"
183 %defattr(-,root,root)
185 %dir %{_sysconfdir}/%{name}
187 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
188 %config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
189 %config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf
190 #%%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf
191 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
192 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
194 # To be eventually moved to %%_defaultdocdir
195 %{_sysconfdir}/%{name}/node.d/*.md
196 %{_libexecdir}/%{name}
199 %caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0555,root,root) %{_libexecdir}/%{name}/plugins.d/apps.plugin
201 %attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
202 %attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name}
203 %attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
205 %dir %{_datadir}/%{name}
206 %dir %{_sysconfdir}/%{name}/health.d
207 %dir %{_sysconfdir}/%{name}/python.d
210 %{_unitdir}/netdata.service
212 %{_sysconfdir}/rc.d/init.d/netdata
215 # Enforce 0644 for files and 0755 for directories
216 # for the netdata web directory
217 %defattr(0644,root,netdata,0755)
218 %{_datadir}/%{name}/web
221 * Sun Jan 22 2017 Costa Tsaousis <costa@tsaousis.gr> - 1.5.0-1
222 - FreeBSD, MacOS, FreeNAS
224 - dozens of new and improved plugins
225 - dozens of new and improved alarms and notification methods
226 * Tue Oct 4 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.4.0-1
227 - the fastest netdata ever (with a better look too)!
228 - improved IoT and containers support!
229 - alarms improved in almost every way!
230 - Several more improvements, new features and bugfixes.
231 * Sun Aug 28 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.3.0-1
232 - netdata now has health monitoring
233 - netdata now generates badges
234 - netdata now has python plugins
235 - Several more improvements, new features and bugfixes.
236 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
237 - Added support for EL6
238 - Corrected several Requires statements
239 - Changed default to build without nfacct
240 - Removed --docdir from configure
241 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
242 - netdata is now 30% faster.
243 - netdata now has a registry (my-netdata menu on the dashboard).
244 - netdata now monitors Linux containers.
245 - Several more improvements, new features and bugfixes.
246 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
247 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
248 - A lot of bug fixes and optimizations.
249 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
250 - First public release.
251 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1