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@
21 Release: @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
23 Group: Applications/System
24 Source0: http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
25 URL: http://netdata.firehol.org/
26 BuildRequires: pkgconfig
28 BuildRequires: zlib-devel
30 # Packages can be found in the EPEL repo
32 BuildRequires: libmnl-devel
33 BuildRequires: libnetfilter_acct-devel
36 Requires(pre): /usr/sbin/groupadd
37 Requires(pre): /usr/sbin/useradd
40 Requires(preun): systemd-units
41 Requires(postun): systemd-units
42 Requires(post): systemd-units
44 Requires(post): chkconfig
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 netdata is the fastest way to visualize metrics. It is a resource
51 efficient, highly optimized system for collecting and visualizing any
52 type of realtime timeseries data, from CPU usage, disk activity, SQL
53 queries, API calls, web site visitors, etc.
55 netdata tries to visualize the truth of now, in its greatest detail,
56 so that you can get insights of what is happening now and what just
57 happened, on your systems and applications.
60 %setup -q -n %{name}-@PACKAGE_VERSION@
66 %{?with_nfacct:--enable-plugin-nfacct} \
68 %{__make} %{?_smp_mflags}
71 rm -rf $RPM_BUILD_ROOT
72 %{__make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
74 find $RPM_BUILD_ROOT -name .keep -print0 | xargs --null --no-run-if-empty rm
76 install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
79 install -d $RPM_BUILD_ROOT%{_unitdir}
80 install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service
82 # install SYSV init stuff
83 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
84 install -m755 system/netdata-init-d \
85 $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata
90 # Add the "netdata" user
91 /usr/sbin/groupadd -r netdata 2> /dev/null || :
92 /usr/sbin/useradd -c "netdata" -g netdata \
93 -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
96 %systemd_post netdata.service
99 %systemd_preun netdata.service
102 %systemd_postun_with_restart netdata.service
105 # Add the "netdata" user
106 getent group netdata >/dev/null || groupadd -r netdata
107 getent passwd netdata >/dev/null || \
108 useradd -r -g netdata -s /sbin/nologin \
109 -d %{contentdir} -c "netdata" netdata
113 # Register the netdata service
114 /sbin/chkconfig --add netdata
115 # Start the netdata service
116 /sbin/service netdata start
120 /sbin/service netdata stop > /dev/null 2>&1
121 /sbin/chkconfig --del netdata
126 rm -rf $RPM_BUILD_ROOT
129 %attr(-,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
130 %attr(-,netdata,netdata) %dir %{_localstatedir}/log/%{name}
131 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
132 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
133 %dir %{_sysconfdir}/%{name}
134 %{?with_systemd:%{_unitdir}/netdata.service}
135 %{_libexecdir}/%{name}
137 %dir %{_datadir}/%{name}
141 %{_sysconfdir}/rc.d/init.d/netdata
144 # override defattr for web files
145 %defattr(644,root,netdata,755)
146 %{_datadir}/%{name}/web
149 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
150 - Added support for EL6
151 - Corrected several Requires statements
152 - Changed default to build without nfacct
153 - Removed --docdir from configure
154 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
155 - netdata is now 30% faster.
156 - netdata now has a registry (my-netdata menu on the dashboard).
157 - netdata now monitors Linux containers.
158 - Several more improvements, new features and bugfixes.
159 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
160 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
161 - A lot of bug fixes and optimizations.
162 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
163 - First public release.
164 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1