File carbon.spec of Package carbon

# norootforbuild
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:           carbon
Version:        0.9.10
Release:        0
#
License:        Apache-2.0
Group:          Productivity/Networking/Security
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
#
Url:            http://graphite.wikidot.com/
Source:         http://launchpad.net/graphite/0.9/%{version}/+download/carbon-%{version}.tar.gz
Patch:          carbon-0.9.9_no_opt.patch
%py_requires
#
Summary:        Backend data caching and persistence daemon for Graphite
%description
Backend data caching and persistence daemon for Graphite.

%prep
%setup
%patch

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -d -m 0755 %{buildroot}%{_sysconfdir}/graphite/
mv %{buildroot}%{_prefix}/conf/ %{buildroot}%{_sysconfdir}/graphite/carbon/

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc LICENSE
%dir %{_sysconfdir}/graphite/
%config %{_sysconfdir}/graphite/carbon/
%{_bindir}/carbon-aggregator.py
%{_bindir}/carbon-cache.py
%{_bindir}/carbon-client.py
%{_bindir}/carbon-relay.py
%{_bindir}/validate-storage-schemas.py
%{python_sitelib}/carbon-%{version}-py%{py_ver}.egg-info
%{python_sitelib}/carbon/
%dir %{python_sitelib}/twisted/
%dir %{python_sitelib}/twisted/plugins/
%{python_sitelib}/twisted/plugins/carbon*

%changelog