[packages/diamond] - restore bcond header - cleanup leftover comments from template spec - add missing description - do
glen
glen at pld-linux.org
Thu Dec 3 09:56:17 CET 2015
commit 3f15af4500b7edf6a5f60e9c7f407cd8152fae81
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Dec 3 10:54:04 2015 +0200
- restore bcond header
- cleanup leftover comments from template spec
- add missing description
- don't package file with %dir attribute
- add todo about missing post restart
diamond.spec | 45 +++++++++++++++++++--------------------------
1 file changed, 19 insertions(+), 26 deletions(-)
---
diff --git a/diamond.spec b/diamond.spec
index 6a13c1d..a33dd89 100644
--- a/diamond.spec
+++ b/diamond.spec
@@ -1,47 +1,46 @@
+# TODO
+# - missing %post %service restart
+#
+# Conditional build:
%bcond_with tests # do not perform "make test"
%define module diamond
-Summary: Python daemon that collects system metrics and publishes them to Graphite (and others).
+Summary: Python daemon that collects system metrics and publishes them to Graphite (and others)
Summary(pl.UTF-8): Demon napisany w Pythonie, zbierający statystyki i publikujący je do Graphite (i innych)
-# Name must match the python module/package name (as in 'import' statement)
Name: diamond
Version: 4.0.195
Release: 1
License: MIT
Group: Libraries/Python
-# https://github.com/python-diamond/Diamond/archive/v4.0.tar.gz
-# https://pypi.python.org/packages/source/d/diamond/diamond-4.0.195.tar.gz#md5=b49da676079eafab3e784cccedc6bfa1
Source0: https://pypi.python.org/packages/source/d/diamond/%{name}-%{version}.tar.gz
# Source0-md5: b49da676079eafab3e784cccedc6bfa1
-#URL: https://pypi.python.org/pypi/MODULE
Source1: %{name}.conf
Source3: %{name}.init
Source10: PostgresqlCollector.conf
-
URL: https://github.com/python-diamond/Diamond
+BuildRequires: python-modules
BuildRequires: rpm-pythonprov
-# for the py_build, py_install macros
BuildRequires: rpmbuild(macros) >= 1.710
-BuildRequires: python-modules
Requires: python-configobj >= 5.0.6
Requires: python-modules
Suggests: python-setproctitle
Provides: group(diamond)
Provides: user(diamond)
-
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-
-%description -l pl.UTF-8
-
+Diamond is a python daemon that collects system metrics and publishes
+them to Graphite (and others). It is capable of collecting cpu,
+memory, network, i/o, load and disk metrics. Additionally, it features
+an API for implementing custom collectors for gathering metrics from
+almost any source.
%package -n %{module}-collector-postgresql
Summary: Data collector for PostgreSQL database
Summary(pl.UTF-8): Zbieracz statystyk dla bazdy danych Postgresql
Group: Libraries/Python
-Requires: %{name}
+Requires: %{name} = %{version}-%{release}
Requires: python-psycopg2
%description -n %{module}-collector-postgresql
@@ -58,18 +57,15 @@ Zbieracz statystyk dla bazdy danych Postgresql
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/{collectors,handlers} \
+ $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_localstatedir}/log/%{module}}
%py_install
%py_postclean
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{module}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/collectors
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/handlers
-## install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/configs
-install -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/%{module}/diamond.conf
-install -d $RPM_BUILD_ROOT%{_localstatedir}/log/%{module}
-install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/%{module}/diamond.conf
install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/diamond
-install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/collectors
+cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/%{module}/collectors
%clean
rm -rf $RPM_BUILD_ROOT
@@ -97,19 +93,16 @@ fi
%defattr(644,root,root,755)
%doc README.md LICENSE
%dir %attr(750,root,diamond) %{_sysconfdir}/%{module}
-%dir %attr(640,root,diamond) %{_sysconfdir}/%{module}/diamond.conf
%dir %attr(750,root,diamond) %{_sysconfdir}/%{module}/collectors
%dir %attr(750,root,diamond) %{_sysconfdir}/%{module}/handlers
+%attr(640,root,diamond) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{module}/diamond.conf
%attr(755,root,root) %{_bindir}/diamond
%attr(755,root,root) %{_bindir}/diamond-setup
%{py_sitescriptdir}/%{module}
-%{_datadir}/diamond/
+%{_datadir}/diamond
%attr(750,diamond,diamond) /var/log/diamond
%attr(754,root,root) /etc/rc.d/init.d/diamond
-
-%if "%{py_ver}" > "2.4"
%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
-%endif
%files -n %{module}-collector-postgresql
%defattr(644,root,root,755)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/diamond.git/commitdiff/ac40a9dfbcb33f4e7297ec54a9180d71cc1fb78d
More information about the pld-cvs-commit
mailing list