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

#
# spec file for package openstack-horizon-plugin-ironic-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/
#


%define version_unconverted 3.0.4.dev3

Name:           openstack-horizon-plugin-ironic-ui
Version:        3.0.4~dev3
Release:        0
Summary:        Ironic management plugin for Horizon
License:        Apache-2.0
Group:          System/Management
URL:            https://launchpad.net/ironic-ui
Source:         http://tarballs.openstack.org/ironic-ui/ironic-ui-stable-pike.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-suse-macros
BuildRequires:  openstack-suse-sudo
BuildRequires:  python-base
BuildRequires:  python-ironicclient
Requires:       openstack-dashboard
Requires:       openstack-suse-sudo
Requires:       python >= 2.6.8
Requires:       python-horizon-plugin-ironic-ui = %{version}
Requires(post): python-horizon-plugin-ironic-ui = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Ironic plugin UI for Horizon to allow users to view and manage bare metal nodes, ports and drivers.

%package -n python-horizon-plugin-ironic-ui
Summary:        Ironic Management Plugin for Horizon - Python module
Group:          Development/Languages/Python
Requires:       python-ironicclient >= 1.14.0
Requires:       python-pbr >= 2.0.0

%description -n python-horizon-plugin-ironic-ui
Ironic plugin UI for Horizon to allow users to view and manage bare metal nodes, ports and drivers.

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

%package test
Summary:        Ironic Management Plugin for Horizon - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-django-nose >= 1.4.4
Requires:       python-horizon
Requires:       python-python-subunit >= 0.0.18
Requires:       python-testrepository >= 0.0.18
Requires:       python-testscenarios >= 0.4
Requires:       python-testtools >= 1.4.0

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

%prep
%setup -q -n ironic-ui-%{version_unconverted}
%openstack_cleanup_prep

%build
python setup.py build

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

mkdir -p %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/dashboards/
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/dashboards/enabled
cp -a ironic_ui/enabled/_2200_ironic.py %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled/

### misc
%fdupes %{buildroot}%{python_sitelib}/ironic_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

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

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

%changelog
openSUSE Build Service is sponsored by