File python-django_openstack_auth.spec of Package python-django_openstack_auth

#
# spec file for package python-django_openstack_auth
#
# Copyright (c) 2018 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/
#


%global pypi_name django_openstack_auth
Name:           python-django_openstack_auth
Version:        3.6.1
Release:        0
Summary:        Django authentication backend for OpenStack Keystone
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            http://docs.openstack.org/developer/django_openstack_auth/
Source0:        https://pypi.io/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# backport of https://bugs.launchpad.net/horizon/+bug/1544703
Patch0:         0001-Use-WEBSSO_KEYSTONE_URL-for-websso-authentication.patch
BuildRequires:  openstack-macros
BuildRequires:  python-Django >= 1.8
BuildRequires:  python-devel
BuildRequires:  python-keystoneauth1 >= 3.1.0
BuildRequires:  python-keystoneclient >= 3.8.0
BuildRequires:  python-mock >= 2.0
BuildRequires:  python-mox3 >= 0.7.0
BuildRequires:  python-oslo.policy >= 1.23.0
BuildRequires:  python-oslotest >= 1.10.0
BuildRequires:  python-pbr >= 2.0.0
BuildRequires:  python-setuptools >= 16.0
BuildRequires:  python-testscenarios >= 0.4
Requires:       python-Django >= 1.8
Requires:       python-keystoneauth1 >= 3.1.0
Requires:       python-keystoneclient >= 3.8.0
Requires:       python-oslo.config >= 4.0.0
Requires:       python-oslo.policy >= 1.23.0
Requires:       python-pbr >= 2.0.0
Requires:       python-six >= 1.9.0
BuildArch:      noarch
%if 0%{?rhel} || 0%{?fedora}
BuildRequires:  gettext
%endif

%description
Django OpenStack Auth is a pluggable Django authentication backend
that works with Django's ``contrib.auth`` framework to authenticate a
user against OpenStack's Keystone Identity API.

%package doc
Summary:        Documentation for %{name}
Group:          Documentation
BuildRequires:  python-Sphinx
BuildRequires:  python-openstackdocstheme >= 1.16.0

%description doc
Django OpenStack Auth is a pluggable Django authentication backend
that works with Django's ``contrib.auth`` framework to authenticate a
user against OpenStack's Keystone Identity API.

This package contains documentation in HTML format.

%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%py_req_cleanup
sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg

%build
%py2_build

# generate html docs
%{__python2} setup.py build_sphinx
# remove the Sphinx-build leftovers
rm doc/build/html/.buildinfo

%check
PYTHONPATH=. %{__python2} openstack_auth/tests/run_tests.py

%install
%py2_install

# compile mo files from po files
(cd %{buildroot}%{python2_sitelib}/openstack_auth && %{_bindir}/django-admin compilemessages)

# Remove po files
find %{buildroot}%{python2_sitelib} -name "*.po" -delete -print

%find_lang django --all-name

%files -f django.lang
%license LICENSE
%doc README.rst
%dir %{python2_sitelib}/openstack_auth
%{python2_sitelib}/openstack_auth/locale
%{python2_sitelib}/openstack_auth/*.py*
%{python2_sitelib}/openstack_auth/plugin
%{python2_sitelib}/openstack_auth/tests
%{python2_sitelib}/%{pypi_name}-*.egg-info

%files doc
%license LICENSE
%doc doc/build/html

%changelog
openSUSE Build Service is sponsored by