2 # - missing %%post %%service restart
5 %bcond_with tests # do not perform "make test"
7 Summary: Python daemon that collects system metrics and publishes them to Graphite (and others)
8 Summary(pl.UTF-8): Demon napisany w Pythonie, zbierający statystyki i publikujący je do Graphite (i innych)
13 Group: Libraries/Python
14 Source0: https://pypi.python.org/packages/source/d/diamond/%{name}-%{version}.tar.gz
15 # Source0-md5: b49da676079eafab3e784cccedc6bfa1
18 Source10: PostgresqlCollector.conf
19 URL: https://github.com/python-diamond/Diamond
20 BuildRequires: python-modules
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.710
23 Requires(postun): /usr/sbin/groupdel
24 Requires(postun): /usr/sbin/userdel
25 Requires(pre): /bin/id
26 Requires(pre): /usr/bin/getgid
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
29 Requires: python-configobj >= 5.0.6
30 Requires: python-modules
31 Suggests: python-setproctitle
32 Provides: group(diamond)
33 Provides: user(diamond)
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Diamond is a python daemon that collects system metrics and publishes
39 them to Graphite (and others). It is capable of collecting cpu,
40 memory, network, i/o, load and disk metrics. Additionally, it features
41 an API for implementing custom collectors for gathering metrics from
44 %package -n %{name}-collector-postgresql
45 Summary: Data collector for PostgreSQL database
46 Summary(pl.UTF-8): Zbieracz statystyk dla bazdy danych Postgresql
47 Group: Libraries/Python
48 Requires: %{name} = %{version}-%{release}
49 Requires: python-psycopg2
51 %description -n %{name}-collector-postgresql
52 Data collector for PostgreSQL database
54 %description -n %{name}-collector-postgresql -l pl.UTF-8
55 Zbieracz statystyk dla bazdy danych Postgresql
61 %py_build %{?with_tests:test}
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{collectors,handlers} \
66 $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_localstatedir}/log/%{name}}
71 cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/diamond.conf
72 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/diamond
73 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/collectors
76 rm -rf $RPM_BUILD_ROOT
79 %groupadd -g 327 diamond
80 %useradd -u 327 -d /var/log/diamond -g diamond -c "Diamond daemon user" diamond
83 /sbin/chkconfig --add diamond
86 if [ "$1" = "0" ]; then
88 /sbin/chkconfig --del diamond
92 if [ "$1" = "0" ]; then
98 %defattr(644,root,root,755)
99 %doc README.md LICENSE
100 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}
101 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}/collectors
102 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}/handlers
103 %attr(640,root,diamond) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/diamond.conf
104 %attr(755,root,root) %{_bindir}/diamond
105 %attr(755,root,root) %{_bindir}/diamond-setup
106 %{py_sitescriptdir}/%{name}
108 %attr(750,diamond,diamond) /var/log/diamond
109 %attr(754,root,root) /etc/rc.d/init.d/diamond
110 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
112 %files -n %{name}-collector-postgresql
113 %defattr(644,root,root,755)
114 %{_sysconfdir}/%{name}/collectors/PostgresqlCollector.conf