File openstack-horizon-plugin-trove-ui.spec of Package openstack-horizon-plugin-trove-ui

#
# spec file for package openstack-horizon-plugin-trove-ui
#
# 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 version_unconverted 11.0.0.0rc2.dev2

Name:           openstack-horizon-plugin-trove-ui
Version:        11.0.0.0~xrc2~dev2
Release:        0
Summary:        Trove UI Plugin for OpenStack Horizon
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            https://launchpad.net/trove-dashboard
Source:         http://tarballs.openstack.org/trove-dashboard/trove-dashboard-stable-rocky.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-suse-macros
BuildRequires:  openstack-suse-sudo
BuildRequires:  python-base
BuildRequires:  python-pbr
BuildRequires:  python-troveclient
Requires:       python-horizon-plugin-trove-ui = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
OpenStack Trove management plugin for Horizon.

%package -n python-horizon-plugin-trove-ui
Summary:        Trove Management Plugin for Horizon - Python module
Group:          Development/Languages/Python
Requires:       python >= 2.7
Requires:       python-Babel >= 1.3
Requires:       python-Django >= 1.8
Requires:       python-django_compressor >= 1.4
Requires:       python-iso8601 >= 0.1.9
Requires:       python-keystoneclient >= 1.6.0
Requires:       python-swiftclient >= 2.2.0
Requires:       python-troveclient >= 1.2.0

%description -n python-horizon-plugin-trove-ui
OpenStack Trove management plugin for Horizon.

%package test
Summary:        Trove Management Plugin for Horizon - Testsuite
Group:          Development/Languages/Python
Requires:       python-Sphinx >= 1.1.1
Requires:       python-ddt >= 0.7.0
Requires:       python-django-nose >= 1.2
Requires:       python-mock >= 1.2
Requires:       python-mox3 >= 0.7.0
Requires:       python-oslosphinx >= 2.5.0
Requires:       python-python-subunit >= 0.0.18
Requires:       python-reno >= 1.6.2
Requires:       python-testrepository >= 0.0.18
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 1.4.0
Requires:       python-xvfbwrapper >= 0.1.3

%description test
The OpenStack Trove dashboard project testsuite

%prep
%setup -q -n trove-dashboard-%{version_unconverted}

%openstack_cleanup_prep

%build
python setup.py build

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

install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1710_database_panel_group.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1720_project_databases_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1730_project_database_backups_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1731_project_database_backups_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1740_project_database_clusters_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a trove_dashboard/enabled/_1760_project_database_configurations_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/

### misc
%fdupes %{buildroot}%{python_sitelib}/trove_dashboard

%post
su wwwrun -s /bin/sh -c "python /srv/www/openstack-dashboard/manage.py collectstatic --noinput --clear > /dev/null"

%postun
su wwwrun -s /bin/sh -c "python /srv/www/openstack-dashboard/manage.py collectstatic --noinput --clear > /dev/null"

%files
%defattr(-,root,root)
/srv/www/openstack-dashboard/openstack_dashboard/enabled
%doc ChangeLog README.rst LICENSE

%files -n python-horizon-plugin-trove-ui
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/trove_dashboard/
%{python_sitelib}/trove_dashboard-*.egg-info
%exclude %{python_sitelib}/trove_dashboard/test*

%files test
%defattr(-,root,root)
%{python_sitelib}/trove_dashboard/test*

%changelog
openSUSE Build Service is sponsored by