]>
Commit | Line | Data |
---|---|---|
94b9e5fa ER |
1 | Summary: Back-end data caching and persistence daemon for Graphite |
2 | Name: carbon | |
3 | Version: 0.9.10 | |
5cb931a6 | 4 | Release: 0.6 |
94b9e5fa ER |
5 | License: Apache v2.0 |
6 | Group: Daemons | |
7 | Source0: https://github.com/downloads/graphite-project/carbon/%{name}-%{version}.tar.gz | |
8 | # Source0-md5: 053b2df1c928250f59518e9bb9f35ad5 | |
9 | Source1: %{name}-cache.init | |
10 | Source2: %{name}-relay.init | |
11 | Source3: %{name}-aggregator.init | |
12 | Source4: %{name}.sysconfig | |
13 | Patch0: FHS.patch | |
14 | URL: https://launchpad.net/graphite/ | |
15 | BuildRequires: python-devel | |
16 | BuildRequires: python-setuptools | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.658 | |
19 | Provides: group(carbon) | |
20 | Provides: user(carbon) | |
21 | Requires(postun): /usr/sbin/groupdel | |
22 | Requires(postun): /usr/sbin/userdel | |
23 | Requires(pre): /bin/id | |
24 | Requires(pre): /usr/bin/getgid | |
25 | Requires(pre): /usr/sbin/groupadd | |
26 | Requires(pre): /usr/sbin/useradd | |
27 | Requires: python-TwistedCore >= 8.0 | |
28 | Requires: python-whisper | |
d243472b | 29 | Requires: rc-scripts >= 0.4.6 |
94b9e5fa ER |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %define no_install_post_check_tmpfiles 1 | |
34 | ||
35 | %description | |
36 | Twisted daemon that listens for time-series data and writes this data | |
37 | out to whisper databases, relays the data or aggregates the data. | |
38 | Carbon is a data collection and storage agent. | |
39 | ||
40 | %prep | |
41 | %setup -q | |
42 | %patch0 -p1 | |
43 | ||
44 | %build | |
45 | %{__python} setup.py build | |
46 | ||
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
49 | %{__python} setup.py install \ | |
50 | --skip-build \ | |
51 | --optimize=2 \ | |
52 | --root=$RPM_BUILD_ROOT | |
53 | ||
54 | %py_postclean -x amqp_publisher.py,amqp_listener.py | |
55 | ||
56 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
57 | install -d $RPM_BUILD_ROOT%{_localstatedir}/log/carbon | |
58 | install -d $RPM_BUILD_ROOT%{_localstatedir}/run/carbon | |
59 | install -d $RPM_BUILD_ROOT%{_sharedstatedir}/carbon | |
60 | ||
61 | # Install system configuration and init scripts | |
62 | install -Dp %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/carbon-cache | |
63 | install -Dp %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/carbon-relay | |
64 | install -Dp %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/carbon-aggregator | |
65 | install -Dp %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/carbon | |
66 | ||
67 | # Install default configuration files | |
68 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name} | |
69 | install -Dp conf/carbon.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/carbon.conf | |
70 | install -Dp conf/storage-schemas.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/storage-schemas.conf | |
71 | ||
72 | # Temp mv to non .py locations | |
73 | cd $RPM_BUILD_ROOT%{_bindir} | |
74 | %{__mv} carbon-aggregator.py carbon-aggregator | |
75 | %{__mv} carbon-cache.py carbon-cache | |
76 | %{__mv} carbon-client.py carbon-client | |
77 | %{__mv} carbon-relay.py carbon-relay | |
78 | %{__mv} validate-storage-schemas.py validate-storage-schemas | |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %pre | |
84 | %groupadd -g 290 -r carbon | |
85 | %useradd -u 290 -r -g carbon -d %{_sharedstatedir}/carbon -s /sbin/nologin -c "Carbon cache daemon" carbon | |
86 | ||
87 | %post | |
88 | /sbin/chkconfig --add carbon-aggregator | |
89 | /sbin/chkconfig --add carbon-cache | |
90 | /sbin/chkconfig --add carbon-relay | |
91 | %service carbon-aggregator restart | |
92 | %service carbon-cache restart | |
93 | %service carbon-relay restart | |
94 | ||
95 | %preun | |
96 | if [ $1 -eq 0 ]; then | |
97 | /sbin/chkconfig --del carbon-aggregator | |
98 | /sbin/chkconfig --del carbon-cache | |
99 | /sbin/chkconfig --del carbon-relay | |
100 | %service carbon-aggregator stop | |
101 | %service carbon-cache stop | |
102 | %service carbon-relay stop | |
103 | fi | |
104 | ||
105 | %postun | |
106 | if [ $1 = 0 ]; then | |
107 | %userremove carbon | |
108 | %groupremove carbon | |
109 | fi | |
110 | ||
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc conf/* | |
114 | %dir %{_sysconfdir}/%{name} | |
115 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/carbon.conf | |
116 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/storage-schemas.conf | |
117 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/carbon | |
118 | %attr(754,root,root) /etc/rc.d/init.d/carbon-aggregator | |
119 | %attr(754,root,root) /etc/rc.d/init.d/carbon-cache | |
120 | %attr(754,root,root) /etc/rc.d/init.d/carbon-relay | |
121 | %attr(755,root,root) %{_bindir}/carbon-aggregator | |
122 | %attr(755,root,root) %{_bindir}/carbon-cache | |
123 | %attr(755,root,root) %{_bindir}/carbon-client | |
124 | %attr(755,root,root) %{_bindir}/carbon-relay | |
125 | %attr(755,root,root) %{_bindir}/validate-storage-schemas | |
126 | ||
127 | %dir %{py_sitescriptdir}/%{name} | |
128 | %attr(755,root,root) %{py_sitescriptdir}/%{name}/amqp_publisher.py | |
129 | %attr(755,root,root) %{py_sitescriptdir}/%{name}/amqp_listener.py | |
130 | %{py_sitescriptdir}/%{name}/*.py[co] | |
131 | %{py_sitescriptdir}/%{name}/amqp0-8.xml | |
132 | %dir %{py_sitescriptdir}/%{name}/aggregator | |
133 | %{py_sitescriptdir}/%{name}/aggregator/*.py[co] | |
134 | %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info | |
135 | ||
d243472b | 136 | # FIXME/CHECKME: twisted itself packages %{py_sitedir}/twisted/plugins dir |
94b9e5fa ER |
137 | %dir %{py_sitescriptdir}/twisted |
138 | %dir %{py_sitescriptdir}/twisted/plugins | |
139 | %{py_sitescriptdir}/twisted/plugins/carbon_*.py[co] | |
140 | ||
141 | %dir %{_localstatedir}/run/%{name} | |
142 | %dir %attr(775,root,carbon) %{_localstatedir}/log/%{name} | |
143 | %dir %attr(775,root,carbon) %{_sharedstatedir}/%{name} | |
5cb931a6 ER |
144 | %dir %attr(775,root,carbon) %{_sharedstatedir}/%{name}/rrd |
145 | %dir %attr(775,root,carbon) %{_sharedstatedir}/%{name}/whisper | |
146 | %dir %attr(775,root,carbon) %{_sharedstatedir}/%{name}/lists |