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

#
# spec file for package openstack-horizon-plugin-magnum-ui
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


%define version_unconverted 5.0.2.dev9

Name:           openstack-horizon-plugin-magnum-ui
Version:        5.0.2~dev9
Release:        0
Summary:        Magnum management plugin for Horizon
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/magnum-ui
Source:         http://tarballs.openstack.org/magnum-ui/magnum-ui-stable-rocky.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-suse-macros
BuildRequires:  openstack-suse-sudo
BuildRequires:  python-base
BuildRequires:  python-magnumclient
BuildRequires:  python-pbr
Requires:       python-horizon-plugin-magnum-ui = %{version}
Requires(post): python-horizon-plugin-magnum-ui = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
OpenStack container orchestration engines (Magnum) management
plugin for Horizon.

%package -n python-horizon-plugin-magnum-ui
Summary:        Manila Management Plugin for Horizon - Python module
Group:          Development/Languages/Python
Requires:       python >= 2.7
Requires:       python-Babel >= 2.3.4
Requires:       python-Django >= 1.11
Requires:       python-django-babel >= 0.6.2
Requires:       python-django-pyscss >= 2.0.2
Requires:       python-django_compressor >= 1.4
Requires:       python-magnumclient >= 2.6.0

%description -n python-horizon-plugin-magnum-ui
OpenStack container orchestration engines (Magnum) management
plugin for Horizon.

This package contains the core Python module of the magnum-ui.

%package test
Summary:        Magnum Management Plugin for Horizon - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-django-nose >= 1.4.4
Requires:       python-horizon >= 14.0.0.0~xbeta3
Requires:       python-mock >= 2.0.0
Requires:       python-python-subunit >= 0.0.18
Requires:       python-testtools >= 1.4.0

%description test
OpenStack Magnum UI Plugin for Horizon testsuite. It is used to verify the
functionality of the Magnum UI Plugin.

%prep
%setup -q -n magnum-ui-%{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 magnum_ui/enabled/_1370_project_container_infra_panel_group.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
cp -a magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/

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

%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 LICENSE

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

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

%changelog
openSUSE Build Service is sponsored by