]> git.pld-linux.org Git - SPECS.git/blob - diamond.spec
SPECS updated Sat 31 Jul 20:27:02 CEST 2021
[SPECS.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:        2
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(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)
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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
42 almost any source.
43
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
50
51 %description -n %{name}-collector-postgresql
52 Data collector for PostgreSQL database
53
54 %description -n %{name}-collector-postgresql -l pl.UTF-8
55 Zbieracz statystyk dla bazdy danych Postgresql
56
57 %prep
58 %setup -q
59
60 %build
61 %py_build %{?with_tests:test}
62
63 %install
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}}
67
68 %py_install
69 %py_postclean
70
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
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %pre
79 %groupadd -g 327 diamond
80 %useradd -u 327 -d /var/log/diamond -g diamond -c "Diamond daemon user" diamond
81
82 %post
83 /sbin/chkconfig --add diamond
84
85 %preun
86 if [ "$1" = "0" ]; then
87         %service diamond stop
88         /sbin/chkconfig --del diamond
89 fi
90
91 %postun
92 if [ "$1" = "0" ]; then
93         %userremove diamond
94         %groupremove diamond
95 fi
96
97 %files
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}
107 %{_datadir}/diamond
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
111
112 %files -n %{name}-collector-postgresql
113 %defattr(644,root,root,755)
114 %{_sysconfdir}/%{name}/collectors/PostgresqlCollector.conf
This page took 0.14522 seconds and 3 git commands to generate.