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

#
# spec file for package openstack-horizon-plugin-murano-ui
#
# Copyright (c) 2023 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/
#


%global sname murano-dashboard
%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-murano-ui
Version:        10.0.0.0~xrc1
Release:        0
Summary:        The Murano Dashboard
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://wiki.openstack.org/wiki/Murano
Source0:        https://files.pythonhosted.org/packages/source/m/%{sname}/%{sname}-10.0.0.0rc1.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-macros
BuildRequires:  python3-muranoclient
BuildRequires:  python3-pbr
Requires:       python3-horizon-plugin-murano-ui = %{version}
BuildArch:      noarch

%description
The Murano UI Horizon plugin adds Murano panel to the OpenStack dashboard.

%package -n    python3-horizon-plugin-murano-ui
Summary:        The Murano Dashboard - Python module
Requires:       python3-Babel
Requires:       python3-Django
Requires:       python3-PyYAML
Requires:       python3-beautifulsoup4
Requires:       python3-django-babel
Requires:       python3-django-formtools
Requires:       python3-muranoclient
Requires:       python3-oslo.log
Requires:       python3-pbr
Requires:       python3-semantic_version
Requires:       python3-yaql

%description -n python3-horizon-plugin-murano-ui
The Murano UI Horizon plugin adds Murano panel to the OpenStack dashboard.

%prep
%autosetup -n %{sname}-10.0.0.0rc1
%py_req_cleanup

%build
%py3_build

%install
%py3_install

install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
cp -a muranodashboard/local/enabled/*.py* %{buildroot}%{http_dashboard_dir}/openstack_dashboard/enabled/
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/
cp -a muranodashboard/local/local_settings.d/_50_murano.py %{buildroot}%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/_50_murano.py.example
install -m 0755 -d %{buildroot}%{http_dashboard_dir}/openstack_dashboard/conf/
cp -a muranodashboard/conf/murano_policy.json %{buildroot}%{http_dashboard_dir}/openstack_dashboard/conf/

%fdupes %{buildroot}%{http_dashboard_dir}

%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
%doc ChangeLog README.rst
%license LICENSE
%{http_dashboard_dir}/openstack_dashboard/enabled/_5*.py*
%{http_dashboard_dir}/openstack_dashboard/enabled/_6*.py*
%{http_dashboard_dir}/openstack_dashboard/enabled/_7*.py*
%{http_dashboard_dir}/openstack_dashboard/enabled/_8*.py*
%{http_dashboard_dir}/openstack_dashboard/local/local_settings.d/_50_murano.py.example
%{http_dashboard_dir}/openstack_dashboard/conf/murano_policy.json

%files -n python3-horizon-plugin-murano-ui
%doc README.rst
%license LICENSE
%{python3_sitelib}/muranodashboard
%{python3_sitelib}/murano_dashboard-*.egg-info

%changelog
openSUSE Build Service is sponsored by