]> git.pld-linux.org Git - packages/diamond.git/blob - diamond.spec
drop unneccessary module macro
[packages/diamond.git] / diamond.spec
1 # TODO
2 # - missing %post %service restart
3 #
4 # Conditional build:
5 %bcond_with     tests   # do not perform "make test"
6
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)
9 Name:           diamond
10 Version:        4.0.195
11 Release:        1
12 License:        MIT
13 Group:          Libraries/Python
14 Source0:        https://pypi.python.org/packages/source/d/diamond/%{name}-%{version}.tar.gz
15 # Source0-md5:  b49da676079eafab3e784cccedc6bfa1
16 Source1:        %{name}.conf
17 Source3:        %{name}.init
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)
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
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
36 almost any source.
37
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
44
45 %description -n %{name}-collector-postgresql
46 Data collector for PostgreSQL database
47
48 %description -n %{name}-collector-postgresql -l pl.UTF-8
49 Zbieracz statystyk dla bazdy danych Postgresql
50
51 %prep
52 %setup -q
53
54 %build
55 %py_build %{?with_tests:test}
56
57 %install
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}}
61
62 %py_install
63 %py_postclean
64
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
68
69 %clean
70 rm -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
76 %post
77 /sbin/chkconfig --add diamond
78
79 %preun
80 if [ "$1" = "0" ]; then
81         %service diamond stop
82         /sbin/chkconfig --del diamond
83 fi
84
85 %postun
86 if [ "$1" = "0" ]; then
87         %userremove diamond
88         %groupremove diamond
89 fi
90
91 %files
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}
101 %{_datadir}/diamond
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
105
106 %files -n %{name}-collector-postgresql
107 %defattr(644,root,root,755)
108 %{_sysconfdir}/%{name}/collectors/PostgresqlCollector.conf
This page took 0.075308 seconds and 4 git commands to generate.