Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
projects
:
statistics
>
graphite-web
> graphite-web.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File graphite-web.spec of Package graphite-web
%if %rhel < 6 %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib())") %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))") %define python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])") %endif Summary: Enterprise scalable realtime graphing Name: graphite-web Version: 0.9.9 Release: 5%{org_tag}%{dist} Source0: %{name}-%{version}.tar.gz Source1: graphite-httpd.conf Patch0: %{name}-0.9.9-fhs-compliance.patch License: Apache Software License 2.0 Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Vendor: Chris Davis <chrismd@gmail.com> URL: https://launchpad.net/graphite Requires: carbon = %{version} Requires: httpd Requires: mod_wsgi Requires: Django Requires: django-tagging Requires: pycairo Requires: python-memcached Requires: python-sqlite2 %if %rhel < 6 Requires: bitmap-fonts %else Requires: bitmap-fonts-compat %endif %description Graphite is an enterprise-scale monitoring tool that stores numeric time-series data, and renders graphs of this data on demand. %prep %setup %patch0 -p1 sed -i -e 's|%PYTHON_SITELIB%|%{python_sitelib}|g' webapp/graphite/settings.py %build %{__python} setup.py build %install %{__python} setup.py install --root=%{buildroot} mkdir -p %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_datadir}/graphite mkdir -p %{buildroot}%{_localstatedir}/log/graphite/webapp # FIXME: this should probably be in a separate wsgi-run package or something mkdir -p %{buildroot}%{_localstatedir}/run/wsgi mv %{buildroot}%{_bindir}/build-index.sh %{buildroot}%{_bindir}/graphite-build-index.sh mv %{buildroot}%{_bindir}/run-graphite-devel-server.py %{buildroot}%{_bindir}/graphite-run-devel-server.py mv %{buildroot}/usr/conf %{buildroot}%{_sysconfdir}/graphite perl -i -pe 's!^(sys.path.append)!#$1!' %{buildroot}%{_sysconfdir}/graphite/graphite.wsgi* for i in %{buildroot}%{_sysconfdir}/graphite/*.example; do cp $i ${i%.example} done install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/graphite.conf mv %{buildroot}/usr/webapp %{buildroot}%{_datadir}/graphite # Create a /etc/graphite/local_settings.py file, and a symlink to it in python_sitelib cp -p %{buildroot}%{python_sitelib}/graphite/local_settings.py.example \ %{buildroot}%{_sysconfdir}/graphite/local_settings.py ln -s %{_sysconfdir}/graphite/local_settings.py %{buildroot}%{python_sitelib}/graphite/local_settings.py %post # Add apache user to graphite group, to allow writing to /var/lib/graphite/storage usermod -aG graphite apache # Warn installer that they need to initialise the django database if [ $1 -eq 1 ]; then echo echo "This appears to be a fresh install of graphite-web, in which case you need to" echo "initialise the graphite django database tables. If you want to use a different" echo "database than the default sqlite one, you should update" echo "/etc/graphite.local_settings.py to point to your database." echo echo "To initialise the database tables, run the following command:" echo echo " python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb" echo else echo echo "This appears to be an update of graphite-web, in which case your graphite" echo "django database tables should already be configured. If not, run:" echo echo " python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb" echo fi %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc README INSTALL LICENSE examples %config(noreplace) %{_sysconfdir}/graphite/* %config(noreplace) %{_sysconfdir}/httpd/conf.d/*conf %{_bindir}/* %{python_sitelib}/graphite/* %if %rhel >= 6 %{python_sitelib}/graphite_web-*.egg-info %endif %{_datadir}/graphite %dir %attr(0755,apache,graphite) %{_localstatedir}/log/graphite/webapp %dir %attr(0755,apache,graphite) %{_localstatedir}/run/wsgi %changelog * Wed Mar 14 2012 Gavin Carr <gavin@openfusion.com.au> 0.9.9-2 - Update to FHS-style based on Jeff Goldschrafe's <jeff@holyhandgrenade.org> RPMs. * Wed Feb 01 2012 Gavin Carr <gavin@openfusion.com.au> 0.9.9-1 - Initial package (based on 0.9.7 package by Chris Davis).