Find file
Fetching contributors…
Cannot retrieve contributors at this time
92 lines (76 sloc) 3.36 KB
# spec file for package python-dashboard
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via
# norootforbuild
%define mod_name openstack_dashboard
%define script_name /dashboard
%define py_puresitedir /usr/lib/python2.6/site-packages
%define httpd_conf /etc/httpd/conf/httpd.conf
Name: openstack-dashboard
Version: 1.0
Release: 0.20111117.1546%{?dist}
License: Apache 2.0
Group: Development/Languages/Python
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel python-setuptools
BuildArch: noarch
Summary: A Django interface for OpenStack
Requires: httpd mod_wsgi
Requires: openstack-keystone openstack-compute openstackx
Requires: python-dateutil python-eventlet >= 0.9.12 python-greenlet python-sqlalchemy >= 0.6.3
Requires: python-sqlalchemy-migrate >= 0.6 python-webob >= 1 python-cloudfiles python-boto = 1.9b python-httplib2
Requires: Django = 1.3 django-mailer django-nose
Summary: Django based reference implementation of a web based management interface for OpenStack.
The OpenStack Dashboard is a reference implementation of a Django site that
uses the Django-Nova project to provide web based interactions with the
OpenStack Nova cloud controller.
%setup -q -n %{name}-%{version}
python build
%__rm -rf %{buildroot}
python install --prefix=%{_prefix} --root=%{buildroot} --record %{mod_name}.files
install -d -m 755 %{buildroot}%{_localstatedir}/lib/%{mod_name}
install -d -m 755 %{buildroot}%{_localstatedir}/log/%{mod_name}
%__rm -rf %{buildroot}
(cd /etc/%{mod_name}/local && cp
# Database init
if test $1 -le 1; then
echo "DB init code, new installation"
python -m %{mod_name}.manage syncdb
chown -R apache:apache %{_localstatedir}/lib/%{mod_name}
chown -R apache:apache %{_localstatedir}/log/%{mod_name}
echo 'SCRIPT_NAME = "%{script_name}"' >> /etc/%{mod_name}/local/
if ! grep -q '%{mod_name}/wsgi/django.wsgi' %{httpd_conf}; then
echo "Adding entry to %{httpd_conf}"
echo '' >> %{httpd_conf}
echo 'WSGIScriptAlias %{script_name} /usr/lib/python2.6/site-packages/%{mod_name}/wsgi/django.wsgi' >> %{httpd_conf}
echo 'Alias /static/%{mod_name} /usr/lib/python2.6/site-packages/%{mod_name}/static/%{mod_name}' >> %{httpd_conf}
%files -f %{mod_name}.files
%dir %attr(0755, apache, apache) %{_localstatedir}/lib/%{mod_name}
%dir %attr(0755, apache, apache) %{_localstatedir}/log/%{mod_name}