%global commit0 4cb65cd07bd8b558656308918371c5a5be8f9b47 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %global checkout 20150926git%{shortcommit0} %global gh_owner brutasse %global gh_project graphite-api Name: graphite-api Version: 1.0.1 Release: 5.%{checkout}%{?dist} Summary: Graphite-web, without the interface. Just the rendering HTTP API License: ASL 2.0 URL: https://github.com/brutasse/graphite-api Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{commit0}/%{gh_project}-%{commit0}.tar.gz Source1: graphite-api.yaml Source2: graphite-api.sysconfig Source3: graphite-api.service BuildArch: noarch BuildRequires: systemd Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: python3-cairo BuildRequires: python3-cairocffi BuildRequires: python3-cffi BuildRequires: python3-devel BuildRequires: python3-flask BuildRequires: python3-flask-cache BuildRequires: python3-itsdangerous BuildRequires: python3-mock BuildRequires: python3-pyparsing BuildRequires: python3-pytest BuildRequires: python3-pytz BuildRequires: python3-PyYAML BuildRequires: python3-setuptools BuildRequires: python3-sphinx BuildRequires: python3-structlog BuildRequires: python3-six BuildRequires: python3-tzlocal BuildRequires: python3-werkzeug Requires: python3-pyparsing Requires: python3-cairo Requires: python3-cairocffi Requires: python3-cffi Requires: python3-flask Requires: python3-flask-cache Requires: python3-gunicorn Requires: python3-itsdangerous Requires: python3-structlog Requires: python3-six Requires: python3-tzlocal Requires: python3-werkzeug Requires: python3-pytz Requires: python3-PyYAML %description Graphite-API is an alternative to Graphite-web, without any built-in dashboard. Its role is solely to fetch metrics from a time-series database (whisper, cyanite, etc.) and rendering graphs or JSON data out of these time series. It is meant to be consumed by any of the numerous Graphite dashboard applications. %package doc Summary: Documentation for graphite-api License: ASL 2.0 BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme %description doc Documentation for graphite-api %prep %setup -q -n %{gh_project}-%{commit0} %build %{__python3} setup.py build pushd docs sphinx-build-3 -b html -d build/doctrees . build/html rm -f build/html/.buildinfo sed -i 's/\r$//' build/html/_static/jquery.js popd %install %{__python3} setup.py install --skip-build --root %{buildroot} install -Dp -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/graphite-api.yaml install -Dp -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} install -Dp -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service # Create directories mkdir -p %{buildroot}%{_sharedstatedir}/graphite-api %check py.test-3.4 tests %pre getent group graphite-api >/dev/null || groupadd -r graphite-api getent passwd graphite-api >/dev/null || \ useradd -r -g graphite-api -d / -s /sbin/nologin \ -c "graphite-api daemon user" graphite-api exit 0 %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %doc README.rst CONTRIBUTING.md %license LICENSE %config(noreplace) %{_sysconfdir}/graphite-api.yaml %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %dir %{_sharedstatedir}/graphite-api %{_unitdir}/%{name}.service %{python3_sitelib}/graphite_api* %files doc %doc docs/*.rst docs/build/html %license LICENSE %changelog * Sat Sep 26 2015 Piotr Popieluch - 1.0.1-5.20150926git4cb65cd - remove system executalbe macros - update to newer version - add license to doc package * Wed Jul 22 2015 Piotr Popieluch - 1.0.1-4.20150702gitbe7907c - remove epel and python2 support - fix lint warnings * Thu Jul 02 2015 Piotr Popieluch - 1.0.1-3.20150702gitbe7907c - update to github master head - moved license to %%license - fix buildrequires * Wed Oct 22 2014 Piotr Popieluch - 1.0.1-2 - added %%check - patch for timezone issue and to pass the %%check - made python version explicit * Sat Oct 11 2014 Piotr Popieluch - 1.0.1-1 - Initial package