1 %define contentdir %{_datadir}/netdata
3 %define distro_post %service_add_post netdata.service
4 %define distro_preun %service_del_preun netdata.service
5 %define distro_postun %service_del_postun netdata.service
6 %define distro_buildrequires BuildRequires:\ systemd-rpm-macros
8 %define distro_post %systemd_post netdata.service
9 %define distro_preun %systemd_preun netdata.service
10 %define distro_postun %systemd_postun_with_restart netdata.service
11 %define 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 %define __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
29 Summary: Real-time performance monitoring, done right
31 Version: @PACKAGE_RPM_VERSION@
34 Group: Applications/System
35 Source0: http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
36 URL: http://my-netdata.io/
38 BuildRequires: pkgconfig
40 BuildRequires: zlib-devel
41 BuildRequires: libuuid-devel
45 # Packages can be found in the EPEL repo
47 BuildRequires: libmnl-devel
48 BuildRequires: libnetfilter_acct-devel
50 Requires: libnetfilter_acct
53 Requires(pre): /usr/sbin/groupadd
54 Requires(pre): /usr/sbin/useradd
60 Requires(preun): systemd-units
61 Requires(postun): systemd-units
62 Requires(post): systemd-units
65 Requires(post): chkconfig
69 netdata is the fastest way to visualize metrics. It is a resource
70 efficient, highly optimized system for collecting and visualizing any
71 type of realtime timeseries data, from CPU usage, disk activity, SQL
72 queries, API calls, web site visitors, etc.
74 netdata tries to visualize the truth of now, in its greatest detail,
75 so that you can get insights of what is happening now and what just
76 happened, on your systems and applications.
85 %{?with_nfacct:--enable-plugin-nfacct} \
87 %{__make} %{?_smp_mflags}
90 rm -rf $RPM_BUILD_ROOT
91 %{__make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
93 find $RPM_BUILD_ROOT -name .keep -delete
95 install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
96 install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
97 install -m 644 -p system/netdata.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
100 install -d $RPM_BUILD_ROOT%{_unitdir}
101 install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service
103 # install SYSV init stuff
104 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
105 install -m755 system/netdata-init-d \
106 $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata
111 # Add the "netdata" user
112 /usr/sbin/groupadd -r netdata 2> /dev/null || :
113 /usr/sbin/useradd -c "netdata" -g netdata \
114 -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
126 # Add the "netdata" user
127 getent group netdata >/dev/null || groupadd -r netdata
128 getent passwd netdata >/dev/null || \
129 useradd -r -g netdata -s /sbin/nologin \
130 -d %{contentdir} -c "netdata" netdata
134 # Register the netdata service
135 /sbin/chkconfig --add netdata
136 # Only gets run on initial install (not upgrades or uninstalls)
138 # Start the netdata service
139 /sbin/service netdata start
144 # Only gets run on uninstall (not upgrades)
146 /sbin/service netdata stop > /dev/null 2>&1
147 /sbin/chkconfig --del netdata
152 # Only gets run on upgrade (not uninstalls)
154 /sbin/service netdata condrestart 2>&1 > /dev/null
160 rm -rf $RPM_BUILD_ROOT
163 %defattr(-,root,root)
165 %dir %{_sysconfdir}/%{name}
167 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
168 #%config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
169 %config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf
170 #%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf
171 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
172 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
174 %{_libexecdir}/%{name}
177 %attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
178 %attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name}
179 %attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
181 %dir %{_datadir}/%{name}
182 %dir %{_sysconfdir}/%{name}/health.d
183 %dir %{_sysconfdir}/%{name}/python.d
186 %{_unitdir}/netdata.service
188 %{_sysconfdir}/rc.d/init.d/netdata
191 # Enforce 0644 for files and 0755 for directories
192 # for the netdata web directory
193 %defattr(0644,root,netdata,0755)
194 %{_datadir}/%{name}/web
197 * Tue Oct 4 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.4.0-1
198 - the fastest netdata ever (with a better look too)!
199 - improved IoT and containers support!
200 - alarms improved in almost every way!
201 - Several more improvements, new features and bugfixes.
202 * Sun Aug 28 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.3.0-1
203 - netdata now has health monitoring
204 - netdata now generates badges
205 - netdata now has python plugins
206 - Several more improvements, new features and bugfixes.
207 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
208 - Added support for EL6
209 - Corrected several Requires statements
210 - Changed default to build without nfacct
211 - Removed --docdir from configure
212 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
213 - netdata is now 30% faster.
214 - netdata now has a registry (my-netdata menu on the dashboard).
215 - netdata now monitors Linux containers.
216 - Several more improvements, new features and bugfixes.
217 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
218 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
219 - A lot of bug fixes and optimizations.
220 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
221 - First public release.
222 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1