X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=blobdiff_plain;f=netdata.spec.in;h=b1f0189e03c147775b29a2530c8763b778380424;hp=cdda78977125e88f76d0662ce45256884bf40d43;hb=32e8eda4c4d6370e96233a69cab861b2ebb5cc9a;hpb=f31e18863ea4717a506c7024fabbc58249cf6a89 diff --git a/netdata.spec.in b/netdata.spec.in index cdda7897..b1f0189e 100644 --- a/netdata.spec.in +++ b/netdata.spec.in @@ -1,50 +1,109 @@ -%define contentdir %{_datadir}/netdata +%global contentdir %{_datadir}/netdata # This is temporary and should eventually be resolved. This bypasses # the default rhel __os_install_post which throws a python compile # error. -%define __os_install_post %{nil} +%global __os_install_post %{nil} # # Conditional build: %bcond_without systemd # systemd %bcond_with nfacct # build with nfacct plugin -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140 %else %undefine with_systemd %endif +%if %{with systemd} +%if 0%{?suse_version} +%global netdata_initd_buildrequires \ +BuildRequires: systemd-rpm-macros \ +%{nil} +%global netdata_initd_requires \ +%{?systemd_requires} \ +%{nil} +%global netdata_init_post %service_add_post netdata.service +%global netdata_init_preun %service_del_preun netdata.service +%global netdata_init_postun %service_del_postun netdata.service +%else +%global netdata_initd_buildrequires %{nil} +%global netdata_initd_requires \ +Requires(preun): systemd-units \ +Requires(postun): systemd-units \ +Requires(post): systemd-units \ +%{nil} +%global netdata_init_post %systemd_post netdata.service +%global netdata_init_preun %systemd_preun netdata.service +%global netdata_init_postun %systemd_postun_with_restart netdata.service +%endif +%else +%global netdata_initd_buildrequires %{nil} +%global netdata_initd_requires \ +Requires(post): chkconfig \ +%{nil} +%global netdata_init_post \ +/sbin/chkconfig --add netdata \ +%{nil} +%global netdata_init_preun %{nil} \ +if [ $1 = 0 ]; then \ + /sbin/service netdata stop > /dev/null 2>&1 \ + /sbin/chkconfig --del netdata \ +fi \ +%{nil} +%global netdata_init_postun %{nil} \ +if [ $1 != 0 ]; then \ + /sbin/service netdata condrestart 2>&1 > /dev/null \ +fi \ +%{nil} +%endif + +%if 0%{?_fedora} +%global netdata_recommends \ +Recommends: curl \ +Recommends: iproute-tc \ +Recommends: lm_sensors \ +Recommends: nmap-ncat \ +Recommends: nodejs \ +Recommends: python \ +Recommends: PyYAML \ +Recommends: python2-PyMySQL \ +Recommends: python2-psycopg2 \ +%{nil} +%else +%global netdata_recommends %{nil} +%endif + Summary: Real-time performance monitoring, done right Name: @PACKAGE_NAME@ Version: @PACKAGE_RPM_VERSION@ Release: 1%{?dist} -License: GPL v3+ +License: GPLv3+ Group: Applications/System -Source0: http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz -URL: http://netdata.firehol.org/ +Source0: https://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz +URL: http://my-netdata.io BuildRequires: pkgconfig BuildRequires: xz BuildRequires: zlib-devel +BuildRequires: libuuid-devel +Requires: zlib +Requires: libuuid # Packages can be found in the EPEL repo %if %{with nfacct} BuildRequires: libmnl-devel BuildRequires: libnetfilter_acct-devel +Requires: libmnl +Requires: libnetfilter_acct %endif Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd +Requires(post): libcap -%if %{with systemd} -Requires(preun): systemd-units -Requires(postun): systemd-units -Requires(post): systemd-units -%else -Requires(post): chkconfig -%endif - -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +%{netdata_initd_buildrequires} +%{netdata_recommends} +%{netdata_initd_requires} %description netdata is the fastest way to visualize metrics. It is a resource @@ -57,7 +116,7 @@ so that you can get insights of what is happening now and what just happened, on your systems and applications. %prep -%setup -q -n %{name}-@PACKAGE_VERSION@ +%setup -q -n @PACKAGE_NAME@-@PACKAGE_VERSION@ %build %configure \ @@ -68,85 +127,99 @@ happened, on your systems and applications. %{__make} %{?_smp_mflags} %install -rm -rf $RPM_BUILD_ROOT -%{__make} %{?_smp_mflags} install \ - DESTDIR=$RPM_BUILD_ROOT +rm -rf "${RPM_BUILD_ROOT}" +%{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install -install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name} +find "${RPM_BUILD_ROOT}" -name .keep -delete -find $RPM_BUILD_ROOT -name .keep | xargs -r rm +install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}" +install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d" +install -m 644 -p system/netdata.logrotate "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}" %if %{with systemd} -install -d $RPM_BUILD_ROOT%{_unitdir} -install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service +install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}" +install -m 644 -p system/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service" %else # install SYSV init stuff -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d -install -m755 system/netdata-init-d \ - $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata +install -d "${RPM_BUILD_ROOT}/etc/rc.d/init.d" +install -m 755 system/netdata-init-d \ + "${RPM_BUILD_ROOT}/etc/rc.d/init.d/netdata" %endif -%if %{with systemd} %pre -# Add the "netdata" user -/usr/sbin/groupadd -r netdata 2> /dev/null || : -/usr/sbin/useradd -c "netdata" -g netdata \ - -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || : - -%post -%systemd_post netdata.service - -%preun -%systemd_preun netdata.service - -%postun -%systemd_postun_with_restart netdata.service -%else -%pre -# Add the "netdata" user getent group netdata >/dev/null || groupadd -r netdata +getent group docker >/dev/null || groupadd -r docker getent passwd netdata >/dev/null || \ - useradd -r -g netdata -s /sbin/nologin \ + useradd -r -g netdata -G docker -s /sbin/nologin \ -d %{contentdir} -c "netdata" netdata -exit 0 %post -# Register the netdata service -/sbin/chkconfig --add netdata -# Start the netdata service -/sbin/service netdata start +%{netdata_init_post} %preun -if [ $1 = 0 ]; then - /sbin/service netdata stop > /dev/null 2>&1 - /sbin/chkconfig --del netdata -fi -%endif +%{netdata_init_preun} + +%postun +%{netdata_init_postun} %clean -rm -rf $RPM_BUILD_ROOT +rm -rf "${RPM_BUILD_ROOT}" %files -%attr(-,netdata,netdata) %dir %{_localstatedir}/cache/%{name} -%attr(-,netdata,netdata) %dir %{_localstatedir}/log/%{name} +%doc README.md +%defattr(-,root,root) + +%dir %{_sysconfdir}/%{name} + %config(noreplace) %{_sysconfdir}/%{name}/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf +%config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf +#%%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf -%dir %{_sysconfdir}/%{name} -%{?with_systemd:%{_unitdir}/netdata.service} +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} + +# To be eventually moved to %%_defaultdocdir +%{_sysconfdir}/%{name}/node.d/*.md %{_libexecdir}/%{name} %{_sbindir}/%{name} + +%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0555,root,root) %{_libexecdir}/%{name}/plugins.d/apps.plugin + +%attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name} +%attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name} +%attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name} + %dir %{_datadir}/%{name} +%dir %{_sysconfdir}/%{name}/health.d +%dir %{_sysconfdir}/%{name}/python.d %if %{with systemd} +%{_unitdir}/netdata.service %else %{_sysconfdir}/rc.d/init.d/netdata %endif -# override defattr for web files -%defattr(644,root,netdata,755) +# Enforce 0644 for files and 0755 for directories +# for the netdata web directory +%defattr(0644,root,netdata,0755) %{_datadir}/%{name}/web %changelog +* Sun Jan 22 2017 Costa Tsaousis - 1.5.0-1 +- FreeBSD, MacOS, FreeNAS +- Backends support +- dozens of new and improved plugins +- dozens of new and improved alarms and notification methods +* Tue Oct 4 2016 Costa Tsaousis - 1.4.0-1 +- the fastest netdata ever (with a better look too)! +- improved IoT and containers support! +- alarms improved in almost every way! +- Several more improvements, new features and bugfixes. +* Sun Aug 28 2016 Costa Tsaousis - 1.3.0-1 +- netdata now has health monitoring +- netdata now generates badges +- netdata now has python plugins +- Several more improvements, new features and bugfixes. * Tue Jul 26 2016 Jason Barnett - 1.2.0-2 - Added support for EL6 - Corrected several Requires statements