[python-django-federated-login] add python3 compatibility

Luis Enrique Bazán De León lbazan at fedoraproject.org
Wed Mar 26 17:27:01 UTC 2014


commit 221ec35e5a9d974f1ba96cce6e378454fd2a64ac
Author: lbazan <lbazan at fedoraproject.org>
Date:   Wed Mar 26 12:26:52 2014 -0500

    add python3 compatibility

 python-django-federated-login.spec |   75 +++++++++++++++++++++++++++++++++---
 1 files changed, 69 insertions(+), 6 deletions(-)
---
diff --git a/python-django-federated-login.spec b/python-django-federated-login.spec
index 2c1e065..fcd3e96 100644
--- a/python-django-federated-login.spec
+++ b/python-django-federated-login.spec
@@ -1,8 +1,10 @@
+%bcond_without  python3
+
 %global pkgname django-federated-login
 
 Name:           python-django-federated-login
 Version:        1.0.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Provides federated logins to django projects
 
 Group:          Development/Languages
@@ -18,6 +20,11 @@ Requires:       python-openid
 Requires:       python-django
 BuildRequires:  python-django
 
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+%endif
+
 %description
 
 Django Federated Login provides an authentication bridge between 
@@ -31,24 +38,80 @@ The provided backend matches users based on the e-mail address returned
 from the identity provider. If no matching user could be found, a user 
 account can optionally be created.
 
+%if 0%{?with_python3}
+%package -n python3-django-federated-login
+Summary:        Provides federated logins to django projects
+Group:          Development/Languages
+
+BuildRequires:  python3-openid
+Requires:       python3-openid
+BuildRequires:  python3-django
+Requires:       python3-django
+
+%description -n python3-django-federated-login
+Django Federated Login provides an authentication bridge between
+Django projects and OpenID-enabled identity providers. The bridge is
+pre-wired to be used with a single Google Apps domain, but could be
+extended to be linked with other OpenID providers also. It is different
+from other OpenID consumers as this consumer only allows connecting to
+a pre-defined identity provider.
+
+The provided backend matches users based on the e-mail address returned
+from the identity provider. If no matching user could be found, a user
+account can optionally be created.
+
+%endif
+
 %prep
 %setup -q -n  %{pkgname}-%{version}
 
+%if 0%{?with_python3}
+cp -a . %{py3dir}
+%endif
+
 %build
-python setup.py build
+{__python2} setup.py build
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
 
 %install
-python setup.py install --skip-build --root %{buildroot}
+{__python2} setup.py install --skip-build --root %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
 
 %check
-python setup.py test
+{__python2} setup.py test
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
  
 %files
 %doc README.rst LICENSE.txt
-%{python_sitelib}/federated_login
-%{python_sitelib}/django_federated_login-*.egg-info
+%{python2_sitelib}/federated_login
+%{python2_sitelib}/django_federated_login-*.egg-info
+
+%if 0%{?with_python3}
+%files -n python3-django-federated-login
+%doc README.rst LICENSE.txt
+%{python3_sitelib}/federated_login
+%{python3_sitelib}/django_federated_login-*.egg-info
+%endif
 
 %changelog
+* Wed Mar 26 2014 Luis Bazan <lbazan at fedoraproject.org> - 1.0.0-2
+- add python3 compatibility
+
 * Wed Mar 26 2014 Luis Bazan <lbazan at fedoraproject.org> - 1.0.0-1
 - New upstream version
 


More information about the scm-commits mailing list