File openstack-dashboard.spec of Package openstack-dashboard
#
# spec file for package openstack-dashboard
#
# Copyright (c) 2018 SUSE LINUX 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
%define version_unconverted 10.0.6.dev4
Name: openstack-dashboard
Version: 10.0.6~dev4
Release: 0
Summary: OpenStack Dashboard (Horizon)
License: Apache-2.0
Group: Development/Languages/Python
Url: http://wiki.openstack.org/OpenStackDashboard
Source: http://tarballs.openstack.org/horizon/horizon-stable-newton.tar.gz
# Already dropped in newton, and avoids expensive roundtrip on every horizon access
Patch0: 0001-Drop-LBaaS-v1-dashboard.patch
# PATCH-FIX-UPSTREAM lp-1654963.patch -- Upstream master has that code removed
Patch1: lp-1654963.patch
# PATCH-FEATURE-UPSTREAM 0001-Add-config-settings-for-login-domain-dropdown.patch bsc#1046986
Patch2: 0001-Add-config-settings-for-login-domain-dropdown.patch
# PATCH-FEATURE-UPSTREAM 0002-DEFAULT_SERVICE_REGIONS.patch bsc#1046906
Patch3: 0002-DEFAULT_SERVICE_REGIONS.patch
# PATCH-FEATURE-UPSTREAM 0001-Add-config-for-default-create-volume-option.patch bsc#1079070
Patch4: 0001-Add-config-for-default-create-volume-option.patch
# PATCH-FIX-UPSTREAM 0003-Restores_sorting_in_the_launch_dialog_source_page.patch bsc#1080615
Patch5: 0001-Restores_sorting_in_the_launch_dialog_source_page.patch
Patch6: 0001-Image-upload-visibility-changed-to-Private.patch
# PATCH-FIX-UPSTREAM Fetch_Cinder_availability_zones_list_for_volume_creation.patch bsc#1100751
Patch7: Fetch_Cinder_availability_zones_list_for_volume_creation.patch
# Apache2 example configuration:
Source2: openstack-dashboard.conf.sample
Source99: rpmlintrc
BuildRequires: apache2
BuildRequires: fdupes
BuildRequires: openstack-suse-macros
BuildRequires: python-Django
BuildRequires: python-devel
BuildRequires: python-pbr >= 0.6
# Now BuildRequires to be able to import the local_settings.py for collectstatic
BuildRequires: python-XStatic
BuildRequires: python-XStatic-Angular
BuildRequires: python-XStatic-Angular-Bootstrap
BuildRequires: python-XStatic-Angular-FileUpload
BuildRequires: python-XStatic-Angular-Gettext
BuildRequires: python-XStatic-Angular-Schema-Form
BuildRequires: python-XStatic-Angular-lrdragndrop
BuildRequires: python-XStatic-Bootstrap-Datepicker
BuildRequires: python-XStatic-Bootstrap-SCSS
BuildRequires: python-XStatic-D3
BuildRequires: python-XStatic-Font-Awesome
BuildRequires: python-XStatic-Hogan
BuildRequires: python-XStatic-JQuery-Migrate
BuildRequires: python-XStatic-JQuery.TableSorter
BuildRequires: python-XStatic-JQuery.quicksearch
BuildRequires: python-XStatic-JSEncrypt
BuildRequires: python-XStatic-Jasmine
BuildRequires: python-XStatic-Rickshaw
BuildRequires: python-XStatic-Spin
BuildRequires: python-XStatic-bootswatch
BuildRequires: python-XStatic-jQuery
BuildRequires: python-XStatic-jquery-ui
BuildRequires: python-XStatic-mdi
BuildRequires: python-XStatic-objectpath
BuildRequires: python-XStatic-roboto-fontface
BuildRequires: python-XStatic-smart-table
BuildRequires: python-XStatic-term.js
BuildRequires: python-XStatic-tv4
BuildRequires: python-cinderclient
BuildRequires: python-django-pyscss
BuildRequires: python-django_compressor
BuildRequires: python-django_openstack_auth
BuildRequires: python-glanceclient
BuildRequires: python-heatclient
BuildRequires: python-keystoneclient
BuildRequires: python-neutronclient
BuildRequires: python-novaclient
BuildRequires: python-oslo.concurrency
BuildRequires: python-oslo.policy
BuildRequires: python-swiftclient
BuildRequires: python-troveclient
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}
# Provide removed packages
Provides: openstack-dashboard-branding-upstream = %{version}
Provides: python-horizon-branding-upstream = %{version}
Obsoletes: openstack-dashboard-branding-upstream <= %{version}
Obsoletes: python-horizon-branding-upstream <= %{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 -n python-horizon
Summary: OpenStack Dashboard (Horizon) - Python Module
Group: Development/Languages/Python
Requires: python-Babel >= 2.3.4
Requires: python-Django >= 1.8
Requires: python-Pint >= 0.5
Requires: python-PyYAML >= 3.1.0
Requires: python-XStatic >= 1.0.0
Requires: python-XStatic-Angular >= 1.3.7
Requires: python-XStatic-Angular-Bootstrap >= 0.11.0.2
Requires: python-XStatic-Angular-FileUpload >= 12.0.4.0
Requires: python-XStatic-Angular-Gettext >= 2.1.0.2
Requires: python-XStatic-Angular-Schema-Form >= 0.8.13.0
Requires: python-XStatic-Angular-lrdragndrop >= 1.0.2.2
Requires: python-XStatic-Bootstrap-Datepicker >= 1.3.1.0
Requires: python-XStatic-Bootstrap-SCSS >= 3
Requires: python-XStatic-D3 >= 3.1.6.2
Requires: python-XStatic-Font-Awesome >= 4.3.0
Requires: python-XStatic-Hogan >= 2.0.0.2
Requires: python-XStatic-JQuery-Migrate >= 1.2.1.1
Requires: python-XStatic-JQuery.TableSorter >= 2.14.5.1
Requires: python-XStatic-JQuery.quicksearch >= 2.0.3.1
Requires: python-XStatic-JSEncrypt >= 2.0.0.2
Requires: python-XStatic-Jasmine >= 2.1.2.0
Requires: python-XStatic-Rickshaw >= 1.5.0
Requires: python-XStatic-Spin >= 1.2.5.2
Requires: python-XStatic-bootswatch >= 3.3.5.3
Requires: python-XStatic-jQuery >= 1.7.2
Requires: python-XStatic-jquery-ui >= 1.10.1
Requires: python-XStatic-mdi >= 1.4.57.0
Requires: python-XStatic-objectpath >= 1.2.1.0
Requires: python-XStatic-roboto-fontface >= 0.4.3.2
Requires: python-XStatic-smart-table >= 1.4.5.3
Requires: python-XStatic-term.js >= 0.0.4
Requires: python-XStatic-tv4 >= 1.2.7.0
Requires: python-ceilometerclient >= 2.5.0
Requires: python-cinderclient >= 1.6.0
Requires: python-django-babel >= 0.5.1
Requires: python-django-pyscss >= 2.0.2
Requires: python-django_compressor >= 1.4
Requires: python-django_openstack_auth >= 1.1.7
Requires: python-glanceclient >= 2.3.0
Requires: python-heatclient >= 1.4.0
Requires: python-httplib2 >= 0.7.5
Requires: python-iso8601 >= 0.1.11
Requires: python-keystoneclient >= 2.0.0
Requires: python-netaddr >= 0.7.13
Requires: python-neutronclient >= 5.1.0
Requires: python-novaclient >= 2.29.0
Requires: python-oslo.concurrency >= 3.8.0
Requires: python-oslo.config >= 3.14.0
Requires: python-oslo.i18n >= 2.1.0
Requires: python-oslo.policy >= 1.9.0
Requires: python-oslo.serialization >= 1.10.0
Requires: python-oslo.utils >= 3.16.0
Requires: python-pbr >= 1.6
Requires: python-pyScss >= 1.3.4
Requires: python-pytz >= 2013.6
Requires: python-six >= 1.9.0
Requires: python-swiftclient >= 2.2.0
%description -n python-horizon
The Python module horizon is the core component of the OpenStack
dashboard.
%package test
Summary: OpenStack Dashboard (Horizon) - Testsuite
Group: Development/Languages/Python
Requires: %{name} = %{version}
Requires: python-django-nose >= 1.4.4
Requires: python-mock >= 2.0
Requires: python-mox3 >= 0.7.0
Requires: python-netaddr >= 0.7.13
Requires: python-nose
Requires: python-nose-exclude
Requires: python-nosehtmloutput >= 0.0.3
Requires: python-nosexcover
Requires: python-openstack.nose_plugin >= 0.7
# python-selenium is not available by default, but we can try to drag it in
Recommends: python-selenium
Requires: python-testtools >= 1.4.0
%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_unconverted}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%openstack_cleanup_prep
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# compile mo files from po files
if [ -e /usr/bin/django-admin ]; then
ADMINCMD=/usr/bin/django-admin
else
ADMINCMD=/usr/bin/django-admin.py
fi
(cd %{buildroot}%{python_sitelib}/horizon && $ADMINCMD compilemessages)
(cd %{buildroot}%{python_sitelib}/openstack_dashboard && $ADMINCMD compilemessages)
# 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 and static files
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/static
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/media
(cd %{buildroot}/srv/www/openstack-dashboard/ && PYTHONPATH=%{buildroot}%{python_sitelib} python manage.py collectstatic --noinput )
# cleanup after manage.py run
rm %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.pyc
rm %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/local/.secret_key_store
rm %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/local/*secret_key_store*
# Remove duplicate files
%if 0%{?suse_version}
%fdupes %{buildroot}%{python_sitelib}
%fdupes %{buildroot}/srv/www/openstack-dashboard
%endif
rm -f %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/.eslintrc
# generate language file and split
%find_lang django
%find_lang djangojs
grep -h "\/openstack_dashboard\/locale\/" djangojs.lang django.lang > dashboard.lang
grep "\/horizon\/locale\/" django.lang > horizon.lang
# 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
%files -f dashboard.lang
%defattr(-,root,root)
%doc README.rst LICENSE
%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
%attr(0770, root, www) /srv/www/openstack-dashboard/static/
%attr(0770, root, www) /srv/www/openstack-dashboard/media/
/srv/www/openstack-dashboard/openstack_dashboard/api/
/srv/www/openstack-dashboard/openstack_dashboard/local/enabled
/srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.d
/srv/www/openstack-dashboard/openstack_dashboard/static/
/srv/www/openstack-dashboard/openstack_dashboard/dashboards/
/srv/www/openstack-dashboard/openstack_dashboard/management/
/srv/www/openstack-dashboard/openstack_dashboard/templates/
/srv/www/openstack-dashboard/openstack_dashboard/templatetags/
/srv/www/openstack-dashboard/openstack_dashboard/utils/
/srv/www/openstack-dashboard/openstack_dashboard/django_pyscss_fix/
/srv/www/openstack-dashboard/openstack_dashboard/test/
%exclude /srv/www/openstack-dashboard/openstack_dashboard/test/tests
/srv/www/openstack-dashboard/openstack_dashboard/usage/
/srv/www/openstack-dashboard/openstack_dashboard/enabled/
/srv/www/openstack-dashboard/openstack_dashboard/wsgi/
/srv/www/openstack-dashboard/openstack_dashboard/conf/
/srv/www/openstack-dashboard/openstack_dashboard/*.py*
/srv/www/openstack-dashboard/openstack_dashboard/contrib/
/srv/www/openstack-dashboard/openstack_dashboard/themes/
%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
%openstack_apache_ssl_cert_files
%{_sysconfdir}/apache2/conf.d/openstack-dashboard.conf.sample
%files -n python-horizon -f horizon.lang
%defattr(-,root,root)
%{python_sitelib}/horizon/
%exclude %{python_sitelib}/horizon/conf/*/static
%exclude %{python_sitelib}/horizon/conf/*/templates
%exclude %{python_sitelib}/horizon/test/tests
%exclude %{python_sitelib}/horizon/locale
%{python_sitelib}/horizon-*.egg-info
%files test
%defattr(-,root,root)
%{_localstatedir}/lib/%{name}-test/
%{python_sitelib}/horizon/test/tests
/srv/www/openstack-dashboard/openstack_dashboard/karma.conf.js
%changelog