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

#
# spec file for package openstack-horizon-plugin-gbp-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 component gbpui

%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif

%define version_unconverted 8.0.1.dev1

Name:           openstack-horizon-plugin-gbp-ui
Version:        8.0.1~dev1
Release:        0
Summary:        Horizon modules for Group Based Policy
License:        Apache-2.0
Group:          System/Management
Url:            https://launchpad.net/group-based-policy-ui
Source:         http://tarballs.openstack.org/group-based-policy-ui/group-based-policy-ui-master.tar.gz
BuildRequires:  fdupes
BuildRequires:  openstack-dashboard
BuildRequires:  openstack-suse-macros
BuildRequires:  python-Sphinx
BuildRequires:  python-devel
BuildRequires:  python-oslosphinx
Requires:       python-horizon-plugin-gbp-ui = %{version}
Requires(post): python-horizon-plugin-gbp-ui = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%py_requires
%else
BuildArch:      noarch
%endif
PreReq:         %fillup_prereq

%description
Horizon modules for Group Based Policy

%package -n     python-horizon-plugin-gbp-ui
Summary:        Horizon modules for Group Based Policy
Group:          Development/Languages/Python
Requires:       python-group-based-policy-client

%description -n python-horizon-plugin-gbp-ui
Horizon modules for Group Based Policy

%package test
Summary:        OpenStack Group Based Policy - Testsuite
Group:          Development/Languages/Python
Requires:       %{name} = %{version}
Requires:       python-django-nose >= 1.4.4
Requires:       python-mock >= 2.0
Requires:       python-mox3 >= 0.20.0
Requires:       python-nose >= 1.3.7
Requires:       python-nosehtmloutput >= 0.0.3
Requires:       python-nosexcover >= 1.0.10
Requires:       python-reno >= 2.5.0
Requires:       python-testtools >= 2.2.0

%description test
OpenStack Group Based Policy - Testsuite

%prep
%setup -q -n group-based-policy-ui-%{version_unconverted}
%openstack_cleanup_prep

%build
python setup.py build
python setup.py build_sphinx -b man
#tools/config/generate_sample.sh -p gbpservice

%install
python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot} --install-data=/
install -m 0755 -d %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled
cp -a %{buildroot}%{python_sitelib}/gbpui/_15*.p* %{buildroot}/srv/www/openstack-dashboard/openstack_dashboard/enabled

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

### misc
%fdupes %{buildroot}%{python_sitelib}/%{component}
%fdupes %{buildroot}%{_bindir}

%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,-)
%doc README.rst
%license LICENSE
/srv/www/openstack-dashboard/openstack_dashboard/enabled/*.p*

%files -n python-horizon-plugin-gbp-ui
%defattr(-,root,root,-)
%license LICENSE
%{python_sitelib}/%{component}/
%{python_sitelib}/group_based_policy_ui*.egg-info
# Part of test subpackage
%exclude %{python_sitelib}/%{component}/horizon/tests/

%files test
%defattr(-,root,root)
%{python_sitelib}/%{component}/horizon/tests

%changelog
openSUSE Build Service is sponsored by