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) 2020 SUSE LLC
#
# 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/
#


%if 0%{?rhel} || 0%{?fedora}
%global rdo 1
%global http_dashboard_dir %{_datarootdir}/openstack-dashboard
%else
%global http_dashboard_dir /srv/www/openstack-dashboard
%endif
Name:           openstack-horizon-plugin-magnum-ui
Version:        7.1.0~dev5
Release:        0
Summary:        Magnum management plugin for Horizon
License:        Apache-2.0
Group:          System/Management
URL:            https://launchpad.net/magnum-ui
Source0:        magnum-ui-master.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-macros
BuildRequires:  python3-magnumclient
BuildRequires:  python3-pbr
Requires:       python3-magnum-ui = %{version}-%{release}
BuildArch:      noarch

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

%package -n python3-magnum-ui
Summary:        Magnum management plugin for Horizon - Python module
Group:          System/Management
Requires:       openstack-dashboard
Requires:       python3-magnumclient
Requires:       python3-pbr

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

%prep
%autosetup -p1 -n magnum-ui-7.1.0.dev5
%py_req_cleanup

%build
%py3_build

%install
%py3_install

# directories
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/conf/

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}%{http_dashboard_dir}/openstack_dashboard/enabled/
cp -a magnum_ui/enabled/_1371_project_container_infra_clusters_panel.py %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
cp -a magnum_ui/enabled/_1372_project_container_infra_cluster_templates_panel.py %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/

%post
su %{apache_user} -s /bin/sh -c "python3 %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"

%postun
su %{apache_user} -s /bin/sh -c "python3 %{http_dashboard_dir}/manage.py collectstatic --noinput --clear > /dev/null"

%files
%defattr(-,root,root)
%{http_dashboard_dir}/openstack_dashboard/enabled
%doc ChangeLog README.rst
%license LICENSE

%files -n python3-magnum-ui
%license LICENSE
%doc README.rst
%{python3_sitelib}/magnum_ui/
%{python3_sitelib}/magnum_ui-*.egg-info

%changelog