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 || :
136 setcap cap_dac_read_search,cap_sys_ptrace+ep /usr/libexec/netdata/plugins.d/apps.plugin || chmod 1755 /usr/libexec/netdata/plugins.d/apps.plugin
145 # Add the "netdata" user
146 getent group netdata >/dev/null || groupadd -r netdata
147 getent group docker >/dev/null || groupadd -r docker
148 getent passwd netdata >/dev/null || \
149 useradd -r -g netdata -G docker -s /sbin/nologin \
150 -d %{contentdir} -c "netdata" netdata
154 setcap cap_dac_read,cap_sys_ptrace+ep /usr/libexec/netdata/plugins.d/apps.plugin || chmod 1755 /usr/libexec/netdata/plugins.d/apps.plugin
155 # Register the netdata service
156 /sbin/chkconfig --add netdata
157 # Only gets run on initial install (not upgrades or uninstalls)
159 # Start the netdata service
160 /sbin/service netdata start
165 # Only gets run on uninstall (not upgrades)
167 /sbin/service netdata stop > /dev/null 2>&1
168 /sbin/chkconfig --del netdata
173 # Only gets run on upgrade (not uninstalls)
175 /sbin/service netdata condrestart 2>&1 > /dev/null
181 rm -rf "${RPM_BUILD_ROOT}"
185 %defattr(-,root,root)
187 %dir %{_sysconfdir}/%{name}
189 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
190 %config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
191 %config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf
192 #%%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf
193 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
194 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
196 # To be eventually moved to %%_defaultdocdir
197 %{_sysconfdir}/%{name}/node.d/*.md
199 %caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin
201 %{_libexecdir}/%{name}
204 %attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
205 %attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name}
206 %attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
208 %dir %{_datadir}/%{name}
209 %dir %{_sysconfdir}/%{name}/health.d
210 %dir %{_sysconfdir}/%{name}/python.d
213 %{_unitdir}/netdata.service
215 %{_sysconfdir}/rc.d/init.d/netdata
218 # Enforce 0644 for files and 0755 for directories
219 # for the netdata web directory
220 %defattr(0644,root,netdata,0755)
221 %{_datadir}/%{name}/web
224 * Sun Jan 22 2017 Costa Tsaousis <costa@tsaousis.gr> - 1.5.0-1
225 - FreeBSD, MacOS, FreeNAS
227 - dozens of new and improved plugins
228 - dozens of new and improved alarms and notification methods
229 * Tue Oct 4 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.4.0-1
230 - the fastest netdata ever (with a better look too)!
231 - improved IoT and containers support!
232 - alarms improved in almost every way!
233 - Several more improvements, new features and bugfixes.
234 * Sun Aug 28 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.3.0-1
235 - netdata now has health monitoring
236 - netdata now generates badges
237 - netdata now has python plugins
238 - Several more improvements, new features and bugfixes.
239 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
240 - Added support for EL6
241 - Corrected several Requires statements
242 - Changed default to build without nfacct
243 - Removed --docdir from configure
244 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
245 - netdata is now 30% faster.
246 - netdata now has a registry (my-netdata menu on the dashboard).
247 - netdata now monitors Linux containers.
248 - Several more improvements, new features and bugfixes.
249 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
250 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
251 - A lot of bug fixes and optimizations.
252 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
253 - First public release.
254 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1