]> arthur.barton.de Git - netdata.git/commitdiff
Spec: Cleanup
authorBen Reedy <breed808@breed808.com>
Wed, 14 Dec 2016 08:22:31 +0000 (18:22 +1000)
committerBen Reedy <breed808@breed808.com>
Wed, 14 Dec 2016 09:34:48 +0000 (19:34 +1000)
%setup defaults to %{name}-%{version}
No node.d directory in package
Remove unneeded mkdir and xargs commands
Shorten find command for .keep files

netdata.spec.in

index 0bb0f3c65e40d9adad511f1aad86fb1690c0ae02..f829f8737ac9fad79fc0de713bae5a6989c6a754 100644 (file)
@@ -65,8 +65,6 @@ Requires(post):   systemd-units
 Requires(post):   chkconfig
 %endif
 
-BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
 %description
 netdata is the fastest way to visualize metrics. It is a resource
 efficient, highly optimized system for collecting and visualizing any
@@ -78,7 +76,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
 
 %build
 %configure \
@@ -92,17 +90,18 @@ happened, on your systems and applications.
 rm -rf $RPM_BUILD_ROOT
 %{__make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install
 
-find $RPM_BUILD_ROOT -name .keep -print0 | xargs --null --no-run-if-empty rm
+find $RPM_BUILD_ROOT -name .keep -delete
 
 install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
-install -Dm 644 -p system/netdata.logrotate $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}
+install -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
 %else
 # install SYSV init stuff
-mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 install -m755 system/netdata-init-d \
         $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata
 %endif
@@ -115,7 +114,7 @@ install -m755 system/netdata-init-d \
         -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
 
 %post
-o%distro_post
+%distro_post
 
 %preun
 %distro_preun
@@ -164,8 +163,6 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 
 %dir %{_sysconfdir}/%{name}
-%dir %{_sysconfdir}/%{name}/health.d
-%dir %{_sysconfdir}/%{name}/python.d
 
 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
 #%config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
@@ -174,10 +171,6 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 
-# node.js config files are JSON (which do not support comments)
-# so, we only supply markdown files
-%{_sysconfdir}/%{name}/node.d/*.md
-
 %{_libexecdir}/%{name}
 %{_sbindir}/%{name}
 
@@ -186,6 +179,8 @@ rm -rf $RPM_BUILD_ROOT
 %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