]> git.pld-linux.org Git - packages/diamond.git/blame - diamond.spec
drop unneccessary module macro
[packages/diamond.git] / diamond.spec
CommitLineData
3f15af45
ER
1# TODO
2# - missing %post %service restart
3#
4# Conditional build:
405853f4 5%bcond_with tests # do not perform "make test"
30fc16b9 6
3f15af45 7Summary: Python daemon that collects system metrics and publishes them to Graphite (and others)
30fc16b9 8Summary(pl.UTF-8): Demon napisany w Pythonie, zbierający statystyki i publikujący je do Graphite (i innych)
30fc16b9
MK
9Name: diamond
10Version: 4.0.195
405853f4 11Release: 1
30fc16b9
MK
12License: MIT
13Group: Libraries/Python
30fc16b9
MK
14Source0: https://pypi.python.org/packages/source/d/diamond/%{name}-%{version}.tar.gz
15# Source0-md5: b49da676079eafab3e784cccedc6bfa1
30fc16b9
MK
16Source1: %{name}.conf
17Source3: %{name}.init
18Source10: PostgresqlCollector.conf
30fc16b9 19URL: https://github.com/python-diamond/Diamond
3f15af45 20BuildRequires: python-modules
30fc16b9 21BuildRequires: rpm-pythonprov
30fc16b9 22BuildRequires: rpmbuild(macros) >= 1.710
30fc16b9
MK
23Requires: python-configobj >= 5.0.6
24Requires: python-modules
25Suggests: python-setproctitle
26Provides: group(diamond)
27Provides: user(diamond)
30fc16b9
MK
28BuildArch: noarch
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
3f15af45
ER
32Diamond is a python daemon that collects system metrics and publishes
33them to Graphite (and others). It is capable of collecting cpu,
34memory, network, i/o, load and disk metrics. Additionally, it features
35an API for implementing custom collectors for gathering metrics from
36almost any source.
30fc16b9 37
3c5ad78a 38%package -n %{name}-collector-postgresql
30fc16b9
MK
39Summary: Data collector for PostgreSQL database
40Summary(pl.UTF-8): Zbieracz statystyk dla bazdy danych Postgresql
41Group: Libraries/Python
3f15af45 42Requires: %{name} = %{version}-%{release}
30fc16b9
MK
43Requires: python-psycopg2
44
3c5ad78a 45%description -n %{name}-collector-postgresql
30fc16b9
MK
46Data collector for PostgreSQL database
47
3c5ad78a 48%description -n %{name}-collector-postgresql -l pl.UTF-8
30fc16b9
MK
49Zbieracz statystyk dla bazdy danych Postgresql
50
51%prep
3c5ad78a 52%setup -q
30fc16b9 53
30fc16b9 54%build
30fc16b9 55%py_build %{?with_tests:test}
30fc16b9
MK
56
57%install
58rm -rf $RPM_BUILD_ROOT
3c5ad78a
ER
59install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{collectors,handlers} \
60 $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_localstatedir}/log/%{name}}
30fc16b9 61
30fc16b9
MK
62%py_install
63%py_postclean
3f15af45 64
3c5ad78a 65cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/diamond.conf
30fc16b9 66install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/diamond
3c5ad78a 67cp -p %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/collectors
30fc16b9 68
30fc16b9
MK
69%clean
70rm -rf $RPM_BUILD_ROOT
71
72%pre
73%groupadd -g 327 diamond
74%useradd -u 327 -d /var/log/diamond -g diamond -c "Diamond daemon user" diamond
75
8fceffdd
MK
76%post
77/sbin/chkconfig --add diamond
8fceffdd
MK
78
79%preun
80if [ "$1" = "0" ]; then
81 %service diamond stop
82 /sbin/chkconfig --del diamond
83fi
8fceffdd 84
30fc16b9
MK
85%postun
86if [ "$1" = "0" ]; then
87 %userremove diamond
88 %groupremove diamond
89fi
8fceffdd 90
30fc16b9
MK
91%files
92%defattr(644,root,root,755)
93%doc README.md LICENSE
3c5ad78a
ER
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
30fc16b9
MK
98%attr(755,root,root) %{_bindir}/diamond
99%attr(755,root,root) %{_bindir}/diamond-setup
3c5ad78a 100%{py_sitescriptdir}/%{name}
3f15af45 101%{_datadir}/diamond
30fc16b9
MK
102%attr(750,diamond,diamond) /var/log/diamond
103%attr(754,root,root) /etc/rc.d/init.d/diamond
3c5ad78a 104%{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
30fc16b9 105
3c5ad78a 106%files -n %{name}-collector-postgresql
30fc16b9 107%defattr(644,root,root,755)
3c5ad78a 108%{_sysconfdir}/%{name}/collectors/PostgresqlCollector.conf
This page took 0.077303 seconds and 4 git commands to generate.