+# TODO:
+# - Test it.
# NOTE:
# - consider split sqlite and apache to separate packages? Or only suggest them?
Summary: A Django webapp for enterprise scalable realtime graphing
Name: graphite-web
-Version: 0.9.14
-Release: 0.3
+Version: 0.9.15
+Release: 1
License: Apache v2.0
Group: Applications/WWW
-Source0: https://codeload.github.com/graphite-project/%{name}/tar.gz/%{version}
+Source0: https://github.com/graphite-project/graphite-web/archive/0.9.15/%{name}-%{version}.tar.gz
+# Source0-md5: f81c50b8b57672fc15a1cfe7bbae1c52
Source1: apache.conf
Source2: %{name}.logrotate
-Source3: local_settings.py
+Source3: local_settings.py
Patch0: %{name}-kill-thirdparty-modules.patch
-
URL: https://launchpad.net/graphite/
BuildRequires: rpm-pythonprov
-# for the py_build, py_install macros
-BuildRequires: rpmbuild(macros) >= 1.710
BuildRequires: python-devel
-Requires: apache-mod_wsgi
-Requires: apache-mod_log_config
+BuildRequires: rpmbuild(macros) >= 1.710
Requires: apache-mod_alias
Requires: apache-mod_authz_host
-
+Requires: apache-mod_log_config
+Requires: apache-mod_wsgi
Requires: fonts-TTF-DejaVu
Requires: python-django
Requires: python-django_tagging >= 0.3
+Requires: python-modules-sqlite
Requires: python-pycairo
Requires: python-pyparsing
Requires: python-pytz
Requires: python-simplejson
Requires: python-whisper >= %{version}
-Requires: python-modules-sqlite
-
Requires: webapps
Conflicts: logrotate < 3.8.0
BuildArch: noarch
%patch0 -p1
%build
-%py_build %{?with_tests:test}
-
+%py_build %{?with_tests:test}
%install
rm -rf $RPM_BUILD_ROOT
# http://graphite.readthedocs.org/en/latest/install-source.html#installing-in-the-default-location
%py_install \
- --prefix /usr \
+--prefix %{_prefix} \
--install-lib %{py_sitescriptdir} \
--install-data %{_datadir}/graphite
%py_postclean -x manage.py
# Create directories
-install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
-install -d $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
-install -d $RPM_BUILD_ROOT%{_sysconfdir}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/logrotate.d,%{_localstatedir}/{lib,log}/%{name}}
# Install some default configurations and wsgi
install -Dp conf/dashboard.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dashboard.conf
# mv $RPM_BUILD_ROOT{%{py_sitescriptdir}/graphite/local_settings.py.example,%{_sysconfdir}/local_settings.py}
-install -Dp %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/local_settings.py
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/local_settings.py
touch $RPM_BUILD_ROOT%{py_sitescriptdir}/graphite/local_settings.py{c,o}
-install -Dp conf/graphite.wsgi.example $RPM_BUILD_ROOT%{_datadir}/graphite/%{name}.wsgi
-install -Dp %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
-install -Dp %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+cp -p conf/graphite.wsgi.example $RPM_BUILD_ROOT%{_datadir}/graphite/%{name}.wsgi
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
# Configure django /media/ location
sed -i 's|##PYTHON_SITELIB##|%{py_sitescriptdir}|' $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
# Don't ship thirdparty
rm -r $RPM_BUILD_ROOT%{py_sitescriptdir}/graphite/thirdparty
+# Install django/httpd accessible DB
+touch $RPM_BUILD_ROOT/var/lib/graphite-web/graphite.db
+
%clean
rm -rf $RPM_BUILD_ROOT
%attr(775,root,http) %dir %{_localstatedir}/log/%{name}
%attr(775,root,http) %dir %{_sharedstatedir}/%{name}
+%attr(640,http,http) %config(noreplace) %verify(not md5 mtime size) /var/lib/graphite-web/graphite.db