File openstack-dashboard.spec of Package openstack-dashboard

#
# spec file for package openstack-dashboard
#
# Copyright (c) 2014 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 http://bugs.opensuse.org/
#


%define component horizon

Name:           openstack-dashboard
Version:        2013.2.5.dev2.g9ee7273
Release:        0
Summary:        OpenStack Dashboard (Horizon)
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            http://wiki.openstack.org/OpenStackDashboard
Source:         http://manyboxes.opensuse.org/openstack/dist/horizon-stable-havana.tar.gz
# Apache2 example configuration:
Source2:        openstack-dashboard.conf.sample
# PATCH-FIX-SUSE: Use a saner default for static/media files
Patch0:         suse-fix-webroot-paths.diff
Patch2:         0001-Give-no-background-color-to-the-pie-charts.patch
Patch3:         0001-Use-default_project_id-for-v3-users.patch
Patch4:         bnc869696-admin_password_injection.patch
BuildRequires:  apache2
BuildRequires:  fdupes
BuildRequires:  openstack-suse-macros
BuildRequires:  python-devel
BuildRequires:  python-pbr >= 0.5
BuildRequires:  python-setuptools
Requires:       %{name}-branding = 2013.2
Requires:       apache2
Requires:       apache2-mod_wsgi
Requires:       python >= 2.6.8
Requires:       python-horizon = %{version}
Recommends:     openstack-novncproxy
# Can't hurt to also provide openstack-horizon:
Provides:       openstack-%{component} = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# To generate a self-signed certificate to be used in demo setups:
Requires(post): apache2-utils
Requires(post): openssl
Requires(post): sysconfig
Provides:       openstack-dashboard-config = %{version}
Obsoletes:      openstack-dashboard-config < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
The OpenStack dashboard provides administrators and users a graphical
interface to access, provision and automate cloud-based resources. The
extensible design makes it easy to plug in and expose third party
products and services, such as billing, monitoring and additional
management tools.

The dashboard is just one way to interact with OpenStack resources.
Developers can automate access or build tools to manage their resources
using the native OpenStack API or the EC2 compatibility API.

%package branding-upstream
Summary:        OpenStack Dashboard (Horizon) - Upstream Branding
Group:          Development/Languages/Python
Provides:       %{name}-branding = %{version}
Provides:       %{name}-branding = 2013.2
Conflicts:      otherproviders(%{name}-branding)
Supplements:    packageand(%{name}:branding-upstream)
%if 0%{?suse_version} && 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description branding-upstream
This package provides the upstream look and feel for OpenStack Dashboard.

%package -n python-horizon
Summary:        OpenStack Dashboard (Horizon) - Python Module
Group:          Development/Languages/Python
Requires:       python-ceilometerclient >= 1.0.5
Requires:       python-cinderclient >= 1.0.6
Requires:       python-django >= 1.4
Requires:       python-django_compressor >= 1.3
Requires:       python-django_openstack_auth >= 1.1.3
Requires:       python-eventlet >= 0.13.0
Requires:       python-glanceclient >= 0.9.0
Requires:       python-heatclient >= 0.2.3
Requires:       python-heatclient >= 0.2.3
Requires:       python-horizon-branding = 2013.2
Requires:       python-iso8601 >= 0.1.8
Requires:       python-keystoneclient >= 0.3.2
Requires:       python-kombu >= 2.4.8
Requires:       python-lesscpy >= 0.9j
Requires:       python-lockfile >= 0.8
Requires:       python-netaddr
Requires:       python-neutronclient >= 2.3.0
Requires:       python-novaclient >= 2.15.0
Requires:       python-pbr >= 0.5.21
Requires:       python-pytz >= 2010h
Requires:       python-swiftclient >= 1.5

%description -n python-horizon
The Python module horizon is the core component of the OpenStack
dashboard.

%package -n python-horizon-branding-upstream
Summary:        OpenStack Dashboard (Horizon) - Python Module Upstream Branding
Group:          Development/Languages/Python
Provides:       python-horizon-branding = %{version}
Provides:       python-horizon-branding = 2013.2
Conflicts:      otherproviders(python-horizon-branding)
Supplements:    packageand(python-horizon:branding-upstream)
%if 0%{?suse_version} && 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description -n python-horizon-branding-upstream
This package provides the upstream look and feel for OpenStack Dashboard Python module.

%package test
Summary:        OpenStack Dashboard (Horizon) - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-coverage >= 3.6
Requires:       python-django-nose
Requires:       python-django-nose-selenium
Requires:       python-flake8 >= 2.0
Requires:       python-hacking >= 0.5.6
Requires:       python-mox >= 0.5.3
Requires:       python-netaddr
Requires:       python-nose
Requires:       python-nose-exclude
Requires:       python-nosehtmloutput >= 0.0.3
Requires:       python-nosexcover
Requires:       python-openstack.nose_plugin >= 0.7
Requires:       python-pep8 >= 1.4.5
Requires:       python-pyflakes >= 0.7.2
%if 0%{?with_selenium}
Requires:       python-selenium
%else
# python-selenium is not available by default, but we can try to drag it in
Recommends:     python-selenium
%endif

%description test
The OpenStack dashboard testsuite. It is used to verify the
functionality of the OpenStack dashboard and its components.

%prep
%setup -q -n %{component}-%{version}
%patch0
%patch2 -p1
%patch3 -p1
%patch4 -p1
%openstack_cleanup_prep

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

# Remove po files
find %{buildroot}%{python_sitelib}/horizon/locale %{buildroot}%{python_sitelib}/openstack_dashboard/locale -name "*.po" -delete -print

# Move openstack_dashboard files
install -d -m 755 %{buildroot}/srv/www/openstack-dashboard
mv %{buildroot}%{python_sitelib}/openstack_dashboard/ %{buildroot}/srv/www/openstack-dashboard/
cp -a manage.py %{buildroot}/srv/www/openstack-dashboard/

### Create a local_settings.py
mv %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.py{.example,}

# create root for static files
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/css
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/js
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/media

# Remove duplicate files
%if 0%{?suse_version}
%fdupes %{buildroot}%{python_sitelib}
%fdupes %{buildroot}/srv/www/openstack-dashboard
%endif

# Apache2 SSL certificate stubs (generated in %%post):
%openstack_apache_ssl_cert_install
# Apache2 sample configuration:
install -d %{buildroot}%{_sysconfdir}/apache2/conf.d
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/apache2/conf.d/openstack-dashboard.conf.sample

### test subpackage
%openstack_test_package_install

%post
%openstack_apache_ssl_cert_post

%files
%defattr(-,root,root)
%dir /srv/www/openstack-dashboard
/srv/www/openstack-dashboard/manage.py
%dir /srv/www/openstack-dashboard/openstack_dashboard
%dir %attr(0750, wwwrun, www) /srv/www/openstack-dashboard/openstack_dashboard/local
%attr(0640, wwwrun, www) /srv/www/openstack-dashboard/openstack_dashboard/local/__init__.py*
%config(noreplace) %attr(0640, wwwrun, www) /srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.py
/srv/www/openstack-dashboard/openstack_dashboard/api/
/srv/www/openstack-dashboard/openstack_dashboard/dashboards/
/srv/www/openstack-dashboard/openstack_dashboard/openstack/
/srv/www/openstack-dashboard/openstack_dashboard/utils/
%exclude /srv/www/openstack-dashboard/openstack_dashboard/settings.py*
%exclude /srv/www/openstack-dashboard/openstack_dashboard/templates
%exclude /srv/www/openstack-dashboard/openstack_dashboard/test/
/srv/www/openstack-dashboard/openstack_dashboard/usage/
/srv/www/openstack-dashboard/openstack_dashboard/wsgi/
/srv/www/openstack-dashboard/openstack_dashboard/conf/
/srv/www/openstack-dashboard/openstack_dashboard/*.py*
%dir %attr(0770, root, www) /srv/www/openstack-dashboard/openstack_dashboard/media
%dir %attr(0770, root, www) /srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/css
%dir /srv/www/openstack-dashboard/openstack_dashboard/static
/srv/www/openstack-dashboard/openstack_dashboard/static/bootstrap
%dir %attr(0770, root, www) /srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/js

%openstack_apache_ssl_cert_files
%{_sysconfdir}/apache2/conf.d/openstack-dashboard.conf.sample

# lang files
%dir /srv/www/openstack-dashboard/openstack_dashboard/locale
%dir /srv/www/openstack-dashboard/openstack_dashboard/locale/*
%dir /srv/www/openstack-dashboard/openstack_dashboard/locale/*/LC_MESSAGES
#%lang(bg-bg) /srv/www/openstack-dashboard/openstack_dashboard/locale/bg_BG/LC_MESSAGES/django.mo
#%lang(ca) /srv/www/openstack-dashboard/openstack_dashboard/locale/ca/LC_MESSAGES/django.mo
#%lang(cs) /srv/www/openstack-dashboard/openstack_dashboard/locale/cs/LC_MESSAGES/django.mo
#%lang(en) /srv/www/openstack-dashboard/openstack_dashboard/locale/en/LC_MESSAGES/django.mo
%lang(en-au) /srv/www/openstack-dashboard/openstack_dashboard/locale/en_AU/LC_MESSAGES/django.mo
%lang(en-gb) /srv/www/openstack-dashboard/openstack_dashboard/locale/en_GB/LC_MESSAGES/django.mo
%lang(es) /srv/www/openstack-dashboard/openstack_dashboard/locale/es/LC_MESSAGES/django.mo
#%lang(fi-fi) /srv/www/openstack-dashboard/openstack_dashboard/locale/fi_FI/LC_MESSAGES/django.mo
%lang(fr) /srv/www/openstack-dashboard/openstack_dashboard/locale/fr/LC_MESSAGES/django.mo
#%lang(hu) /srv/www/openstack-dashboard/openstack_dashboard/locale/hu/LC_MESSAGES/django.mo
#%lang(it) /srv/www/openstack-dashboard/openstack_dashboard/locale/it/LC_MESSAGES/django.mo
%lang(ja) /srv/www/openstack-dashboard/openstack_dashboard/locale/ja/LC_MESSAGES/django.mo
#%lang(ka-ge) /srv/www/openstack-dashboard/openstack_dashboard/locale/ka_GE/LC_MESSAGES/django.mo
%lang(ko) /srv/www/openstack-dashboard/openstack_dashboard/locale/ko_KR/LC_MESSAGES/django.mo
%lang(nl-nl) /srv/www/openstack-dashboard/openstack_dashboard/locale/nl_NL/LC_MESSAGES/django.mo
#%lang(pl) /srv/www/openstack-dashboard/openstack_dashboard/locale/pl/LC_MESSAGES/django.mo
%lang(pl-pl) /srv/www/openstack-dashboard/openstack_dashboard/locale/pl_PL/LC_MESSAGES/django.mo
#%lang(pt) /srv/www/openstack-dashboard/openstack_dashboard/locale/pt/LC_MESSAGES/django.mo
%lang(ru) /srv/www/openstack-dashboard/openstack_dashboard/locale/ru/LC_MESSAGES/django.mo
%lang(pt-br) /srv/www/openstack-dashboard/openstack_dashboard/locale/pt_BR/LC_MESSAGES/django.mo
%lang(zh-cn) /srv/www/openstack-dashboard/openstack_dashboard/locale/zh_CN/LC_MESSAGES/django.mo
%lang(zh-tw) /srv/www/openstack-dashboard/openstack_dashboard/locale/zh_TW/LC_MESSAGES/django.mo

%files branding-upstream
%defattr(-,root,root)
/srv/www/openstack-dashboard/openstack_dashboard/settings.py*
/srv/www/openstack-dashboard/openstack_dashboard/static/dashboard
%exclude /srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/js
%exclude /srv/www/openstack-dashboard/openstack_dashboard/static/dashboard/css
/srv/www/openstack-dashboard/openstack_dashboard/templates

%files -n python-horizon
%defattr(-,root,root)
%{python_sitelib}/horizon/
%exclude %{python_sitelib}/horizon/conf/*/static
%exclude %{python_sitelib}/horizon/conf/*/templates
%exclude %{python_sitelib}/horizon/static
%exclude %{python_sitelib}/horizon/templates
%exclude %{python_sitelib}/horizon/test
%{python_sitelib}/horizon-*.egg-info

%files -n python-horizon-branding-upstream
%defattr(-,root,root)
%{python_sitelib}/horizon/conf/*/static
%{python_sitelib}/horizon/conf/*/templates
%{python_sitelib}/horizon/static
%{python_sitelib}/horizon/templates

%files test
%defattr(-,root,root)
%{_localstatedir}/lib/%{name}-test/
%{python_sitelib}/horizon/test

%changelog
openSUSE Build Service is sponsored by