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: python-configobj >= 5.0.6
24 Requires: python-modules
25 Suggests: python-setproctitle
26 Provides: group(diamond)
27 Provides: user(diamond)
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Diamond is a python daemon that collects system metrics and publishes
33 them to Graphite (and others). It is capable of collecting cpu,
34 memory, network, i/o, load and disk metrics. Additionally, it features
35 an API for implementing custom collectors for gathering metrics from
38 %package -n %{name}-collector-postgresql
39 Summary: Data collector for PostgreSQL database
40 Summary(pl.UTF-8): Zbieracz statystyk dla bazdy danych Postgresql
41 Group: Libraries/Python
42 Requires: %{name} = %{version}-%{release}
43 Requires: python-psycopg2
45 %description -n %{name}-collector-postgresql
46 Data collector for PostgreSQL database
48 %description -n %{name}-collector-postgresql -l pl.UTF-8
49 Zbieracz statystyk dla bazdy danych Postgresql
55 %py_build %{?with_tests:test}
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{collectors,handlers} \
60 $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_localstatedir}/log/%{name}}
65 cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/diamond.conf
66 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/diamond
67 cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/collectors
70 rm -rf $RPM_BUILD_ROOT
73 %groupadd -g 327 diamond
74 %useradd -u 327 -d /var/log/diamond -g diamond -c "Diamond daemon user" diamond
77 /sbin/chkconfig --add diamond
80 if [ "$1" = "0" ]; then
82 /sbin/chkconfig --del diamond
86 if [ "$1" = "0" ]; then
92 %defattr(644,root,root,755)
93 %doc README.md LICENSE
94 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}
95 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}/collectors
96 %dir %attr(750,root,diamond) %{_sysconfdir}/%{name}/handlers
97 %attr(640,root,diamond) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/diamond.conf
98 %attr(755,root,root) %{_bindir}/diamond
99 %attr(755,root,root) %{_bindir}/diamond-setup
100 %{py_sitescriptdir}/%{name}
102 %attr(750,diamond,diamond) /var/log/diamond
103 %attr(754,root,root) /etc/rc.d/init.d/diamond
104 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
106 %files -n %{name}-collector-postgresql
107 %defattr(644,root,root,755)
108 %{_sysconfdir}/%{name}/collectors/PostgresqlCollector.conf