# needed for epel6 %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %global commit 612e690cafbf5086f7881beef151f519c9518756 Name: carbonate Version: 0.2.2 Release: 1%{?dist} Summary: Utilities for managing graphite clusters License: MIT URL: https://github.com/jssjr/carbonate Source0: https://github.com/jssjr/carbonate/archive/%{commit}.tar.gz Patch0: %{name}-%{version}-amend-fhs.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-carbon BuildRequires: python-mock BuildRequires: python-nose BuildRequires: python-setuptools Requires: python-carbon Requires: python-setuptools # argparse is default in python 2.7 and higher %if 0%{?rhel} == 6 BuildRequires: python-argparse Requires: python-argparse %endif %description Graphite clusters are pretty cool. Here are some primitive tools to help you manage your graphite clusters. All of the tools support two common arguments; the path to a config file, and the name of the cluster. Using these tools alongside a config file that describes your graphite clusters you can build up scripts to manage your metrics. Some of the tools could easily be replaced with one-liners in shell, but exist here for convenience and readability. The goal is to provide fast, predictable utilities that can easily be composed into more advanced tooling. %prep %setup -qn %{name}-%{commit} rm -rf *.egg-info # Amend default filesystem locations. %patch0 -p1 # remove shebang, file should not be called from commandline # https://github.com/jssjr/carbonate/pull/55 sed -i '/#!\/usr\/bin\/env python/d' carbonate/aggregation.py %build %{__python2} setup.py build %install %{__python2} setup.py install -O1 --skip-build --root %{buildroot} # install the example config %{__mkdir_p} %{buildroot}%{_sysconfdir} cp -p conf/carbonate.conf %{buildroot}%{_sysconfdir} # whisper-fill is provided by python-whisper rm %{buildroot}/%{_bindir}/whisper-fill %check %{_bindir}/nosetests -v %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG.md CONTRIBUTING.md MANIFEST.in README.md %config(noreplace) %{_sysconfdir}/carbonate.conf %{python2_sitelib}/%{name} %{python2_sitelib}/%{name}-%{version}-py2.?.egg-info %{_bindir}/carbon-hosts %{_bindir}/carbon-list %{_bindir}/carbon-lookup %{_bindir}/carbon-path %{_bindir}/carbon-sieve %{_bindir}/carbon-sync %{_bindir}/whisper-aggregate %changelog * Sun Apr 05 2015 Piotr Popieluch - 0.2.2-1 - Initial package