1 %define contentdir %{_datadir}/netdata
3 # This is temporary and should eventually be resolved. This bypasses
4 # the default rhel __os_install_post which throws a python compile
6 %define __os_install_post %{nil}
10 %bcond_without systemd # systemd
11 %bcond_with nfacct # build with nfacct plugin
13 %if 0%{?fedora} || 0%{?rhel} >= 7
15 %undefine with_systemd
18 Summary: Real-time performance monitoring, done right
20 Version: @PACKAGE_RPM_VERSION@
23 Group: Applications/System
24 Source0: http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
25 URL: http://my-netdata.io/
26 BuildRequires: pkgconfig
28 BuildRequires: zlib-devel
29 BuildRequires: libuuid-devel
33 # Packages can be found in the EPEL repo
35 BuildRequires: libmnl-devel
36 BuildRequires: libnetfilter_acct-devel
38 Requires: libnetfilter_acct
41 Requires(pre): /usr/sbin/groupadd
42 Requires(pre): /usr/sbin/useradd
45 Requires(preun): systemd-units
46 Requires(postun): systemd-units
47 Requires(post): systemd-units
49 Requires(post): chkconfig
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 netdata is the fastest way to visualize metrics. It is a resource
56 efficient, highly optimized system for collecting and visualizing any
57 type of realtime timeseries data, from CPU usage, disk activity, SQL
58 queries, API calls, web site visitors, etc.
60 netdata tries to visualize the truth of now, in its greatest detail,
61 so that you can get insights of what is happening now and what just
62 happened, on your systems and applications.
65 %setup -q -n %{name}-@PACKAGE_VERSION@
71 %{?with_nfacct:--enable-plugin-nfacct} \
73 %{__make} %{?_smp_mflags}
76 rm -rf $RPM_BUILD_ROOT
77 %{__make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
79 find $RPM_BUILD_ROOT -name .keep -print0 | xargs --null --no-run-if-empty rm
81 install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
83 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
84 install -m 644 -p system/netdata.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
87 install -d $RPM_BUILD_ROOT%{_unitdir}
88 install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service
90 # install SYSV init stuff
91 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
92 install -m755 system/netdata-init-d \
93 $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata
98 # Add the "netdata" user
99 /usr/sbin/groupadd -r netdata 2> /dev/null || :
100 /usr/sbin/useradd -c "netdata" -g netdata \
101 -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
104 %systemd_post netdata.service
107 %systemd_preun netdata.service
110 %systemd_postun_with_restart netdata.service
113 # Add the "netdata" user
114 getent group netdata >/dev/null || groupadd -r netdata
115 getent passwd netdata >/dev/null || \
116 useradd -r -g netdata -s /sbin/nologin \
117 -d %{contentdir} -c "netdata" netdata
121 # Register the netdata service
122 /sbin/chkconfig --add netdata
123 # Only gets run on initial install (not upgrades or uninstalls)
125 # Start the netdata service
126 /sbin/service netdata start
131 # Only gets run on uninstall (not upgrades)
133 /sbin/service netdata stop > /dev/null 2>&1
134 /sbin/chkconfig --del netdata
139 # Only gets run on upgrade (not uninstalls)
141 /sbin/service netdata condrestart 2>&1 > /dev/null
147 rm -rf $RPM_BUILD_ROOT
150 %defattr(-,root,root)
152 %dir %{_sysconfdir}/%{name}
153 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
154 #%config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
155 %config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf
156 #%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf
157 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
158 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
160 # node.js config files are JSON (which do not support comments)
161 # so, we only supply markdown files
162 %{_sysconfdir}/%{name}/node.d/*.md
164 %{_libexecdir}/%{name}
167 %attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
168 %attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name}
169 %attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
171 %dir %{_datadir}/%{name}
174 %{_unitdir}/netdata.service
176 %{_sysconfdir}/rc.d/init.d/netdata
179 # Enforce 0644 for files and 0755 for directories
180 # for the netdata web directory
181 %defattr(0644,root,netdata,0755)
182 %{_datadir}/%{name}/web
185 * Tue Oct 4 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.4.0-1
186 - the fastest netdata ever (with a better look too)!
187 - improved IoT and containers support!
188 - alarms improved in almost every way!
189 - Several more improvements, new features and bugfixes.
190 * Sun Aug 28 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.3.0-1
191 - netdata now has health monitoring
192 - netdata now generates badges
193 - netdata now has python plugins
194 - Several more improvements, new features and bugfixes.
195 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
196 - Added support for EL6
197 - Corrected several Requires statements
198 - Changed default to build without nfacct
199 - Removed --docdir from configure
200 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
201 - netdata is now 30% faster.
202 - netdata now has a registry (my-netdata menu on the dashboard).
203 - netdata now monitors Linux containers.
204 - Several more improvements, new features and bugfixes.
205 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
206 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
207 - A lot of bug fixes and optimizations.
208 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
209 - First public release.
210 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1