From: Thomas Goirand Date: Fri, 24 Apr 2015 07:17:49 +0000 (+0200) Subject: Added Python3 support. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=aa540a9283de7c825da2fdaff739eb4fb71f3245;p=packages%2Ftrusty%2Fpython-pysaml2.git Added Python3 support. Rewritten-From: 3309e3a1dfea5433351dde378ed1a12e164f4113 --- diff --git a/debian/changelog b/debian/changelog index 25b1649..9ef9bd9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pysaml2 (2.0.0-2) experimental; urgency=medium + + * Added Python 3 support. + + -- Thomas Goirand Fri, 24 Apr 2015 09:03:41 +0200 + python-pysaml2 (2.0.0-1) unstable; urgency=medium * Initial release. (Closes: #760824) diff --git a/debian/control b/debian/control index 5ba88a9..c9297d7 100644 --- a/debian/control +++ b/debian/control @@ -2,11 +2,14 @@ Source: python-pysaml2 Section: python Priority: optional Maintainer: PKG OpenStack -Uploaders: Thomas Goirand +Uploaders: Thomas Goirand , Build-Depends: debhelper (>= 9), + dh-python, python-all (>= 2.6.6-3~), python-setuptools, - python-sphinx + python-sphinx, + python3-all (>= 3.4), + python3-setuptools, Build-Depends-Indep: python-crypto, python-dateutil, python-decorator, @@ -20,23 +23,33 @@ Build-Depends-Indep: python-crypto, python-requests, python-tz, python-zope.interface, - xmlsec1 -Standards-Version: 3.9.5 -X-Python-Version: >= 2.7 + python3-crypto, + python3-dateutil, + python3-decorator, + python3-mako, + python3-memcache, + python3-openssl, + python3-paste, + python3-pyasn1, + python3-pytest, + python3-repoze.who, + python3-requests, + python3-tz, + xmlsec1, +Standards-Version: 3.9.6 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=openstack/python-pysaml2.git Vcs-Git: git://anonscm.debian.org/openstack/python-pysaml2.git Homepage: https://github.com/rohe/pysaml2 Package: python-pysaml2 Architecture: all -Pre-Depends: dpkg (>= 1.15.6~) Depends: python-mako, python-memcache, python-pyasn1, python-repoze.who, xmlsec1, ${misc:Depends}, - ${python:Depends} + ${python:Depends}, Description: SAML Version 2 to be used in a WSGI environment - Python 2.x This package provides a Python implementation of SAML Version 2 to be used in a WSGI environment. @@ -53,11 +66,37 @@ Description: SAML Version 2 to be used in a WSGI environment - Python 2.x . This package contains the Python 2.x module. +Package: python3-pysaml2 +Architecture: all +Depends: python3-mako, + python3-memcache, + python3-pyasn1, + python3-repoze.who, + xmlsec1, + ${misc:Depends}, + ${python3:Depends}, +Description: SAML Version 2 to be used in a WSGI environment - Python 3.x + This package provides a Python implementation of SAML Version 2 to be used in + a WSGI environment. + . + From wikipedia: Security Assertion Markup Language 2.0 (SAML 2.0) is a version + of the SAML standard for exchanging authentication and authorization data + between security domains. SAML 2.0 is an XML-based protocol that uses security + tokens containing assertions to pass information about a principal (usually an + end user) between a SAML authority, that is, an identity provider, and a SAML + consumer, that is, a service provider. SAML 2.0 enables web-based + authentication and authorization scenarios including cross-domain single + sign-on (SSO), which helps reduce the administrative overhead of distributing + multiple authentication tokens to the user. + . + This package contains the Python 3.x module. + Package: python-pysaml2-doc Section: doc Architecture: all -Pre-Depends: dpkg (>= 1.15.6~) -Depends: ${misc:Depends}, ${sphinxdoc:Depends} +Pre-Depends: dpkg (>= 1.15.6~), +Depends: ${misc:Depends}, + ${sphinxdoc:Depends}, Description: SAML Version 2 to be used in a WSGI environment - doc This package provides a Python implementation of SAML Version 2 to be used in a WSGI environment. diff --git a/debian/python-pysaml2.postinst b/debian/python-pysaml2.postinst new file mode 100644 index 0000000..639876d --- /dev/null +++ b/debian/python-pysaml2.postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/pysaml2-make-metadata pysaml2-make-metadata /usr/bin/python2-pysaml2-make-metadata 300 + update-alternatives --install /usr/bin/pysaml2-mdexport pysaml2-mdexport /usr/bin/python2-pysaml2-mdexport 300 + update-alternatives --install /usr/bin/pysaml2-parse-xsd2 pysaml2-parse-xsd2 /usr/bin/python2-pysaml2-parse-xsd2 300 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/python-pysaml2.postrm b/debian/python-pysaml2.postrm new file mode 100644 index 0000000..79f7a1b --- /dev/null +++ b/debian/python-pysaml2.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ]; then + update-alternatives --remove pysaml2-make-metadata /usr/bin/python2-pysaml2-make-metadata + update-alternatives --remove pysaml2-mdexport /usr/bin/python2-pysaml2-mdexport + update-alternatives --remove pysaml2-parse-xsd2 /usr/bin/python2-pysaml2-parse-xsd2 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/python-pysaml2.prerm b/debian/python-pysaml2.prerm new file mode 100644 index 0000000..26fca4d --- /dev/null +++ b/debian/python-pysaml2.prerm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove pysaml2-make-metadata /usr/bin/python2-pysaml2-make-metadata + update-alternatives --remove pysaml2-mdexport /usr/bin/python2-pysaml2-mdexport + update-alternatives --remove pysaml2-parse-xsd2 /usr/bin/python2-pysaml2-parse-xsd2 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/python3-pysaml2.postinst b/debian/python3-pysaml2.postinst new file mode 100644 index 0000000..fbd89ab --- /dev/null +++ b/debian/python3-pysaml2.postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] ; then + update-alternatives --install /usr/bin/pysaml2-make-metadata pysaml2-make-metadata /usr/bin/python3-pysaml2-make-metadata 200 + update-alternatives --install /usr/bin/pysaml2-mdexport pysaml2-mdexport /usr/bin/python3-pysaml2-mdexport 200 + update-alternatives --install /usr/bin/pysaml2-parse-xsd2 pysaml2-parse-xsd2 /usr/bin/python3-pysaml2-parse-xsd2 200 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/python3-pysaml2.postrm b/debian/python3-pysaml2.postrm new file mode 100644 index 0000000..228c70c --- /dev/null +++ b/debian/python3-pysaml2.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] || [ "$1" = "disappear" ]; then + update-alternatives --remove pysaml2-make-metadata /usr/bin/python3-pysaml2-make-metadata + update-alternatives --remove pysaml2-mdexport /usr/bin/python3-pysaml2-mdexport + update-alternatives --remove pysaml2-parse-xsd2 /usr/bin/python3-pysaml2-parse-xsd2 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/python3-pysaml2.prerm b/debian/python3-pysaml2.prerm new file mode 100644 index 0000000..9e1676f --- /dev/null +++ b/debian/python3-pysaml2.prerm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" ] ; then + update-alternatives --remove pysaml2-make-metadata /usr/bin/python3-pysaml2-make-metadata + update-alternatives --remove pysaml2-mdexport /usr/bin/python3-pysaml2-mdexport + update-alternatives --remove pysaml2-parse-xsd2 /usr/bin/python3-pysaml2-parse-xsd2 +fi + +#DEBHELPER# + +exit 0 + diff --git a/debian/rules b/debian/rules index 0f61cff..fc08a5c 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f PYTHONS:=$(shell pyversions -vr) -#PYTHON3S:=$(shell py3versions -vr) +PYTHON3S:=$(shell py3versions -vr) UPSTREAM_GIT = git://github.com/rohe/pysaml2.git -include /usr/share/openstack-pkg-tools/pkgos.make @@ -15,21 +15,28 @@ override_dh_install: --root $(CURDIR)/debian/python-pysaml2; \ done mv $(CURDIR)/debian/python-pysaml2/usr/bin/make_metadata.py \ - $(CURDIR)/debian/python-pysaml2/usr/bin/pysaml2-make-metadata + $(CURDIR)/debian/python-pysaml2/usr/bin/python2-pysaml2-make-metadata mv $(CURDIR)/debian/python-pysaml2/usr/bin/mdexport.py \ - $(CURDIR)/debian/python-pysaml2/usr/bin/pysaml2-mdexport + $(CURDIR)/debian/python-pysaml2/usr/bin/python2-pysaml2-mdexport mv $(CURDIR)/debian/python-pysaml2/usr/bin/parse_xsd2.py \ - $(CURDIR)/debian/python-pysaml2/usr/bin/pysaml2-parse-xsd2 -# Python3 is not yet supported upstream -# set -e && for pyvers in $(PYTHON3S); do \ -# python$$pyvers setup.py install --install-layout=deb \ -# --root $(CURDIR)/debian/python3-pysaml2; \ -# done + $(CURDIR)/debian/python-pysaml2/usr/bin/python2-pysaml2-parse-xsd2 + + set -e && for pyvers in $(PYTHON3S); do \ + python$$pyvers setup.py install --install-layout=deb \ + --root $(CURDIR)/debian/python3-pysaml2; \ + done + mv $(CURDIR)/debian/python3-pysaml2/usr/bin/make_metadata.py \ + $(CURDIR)/debian/python3-pysaml2/usr/bin/python3-pysaml2-make-metadata + mv $(CURDIR)/debian/python3-pysaml2/usr/bin/mdexport.py \ + $(CURDIR)/debian/python3-pysaml2/usr/bin/python3-pysaml2-mdexport + mv $(CURDIR)/debian/python3-pysaml2/usr/bin/parse_xsd2.py \ + $(CURDIR)/debian/python3-pysaml2/usr/bin/python3-pysaml2-parse-xsd2 + rm -rf $(CURDIR)/debian/python*-pysaml2/usr/lib/python*/dist-packages/*.pth override_dh_auto_test: ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) - set -e && for pyvers in 2.7; do \ + set -e && for pyvers in 2.7 $(PYTHON3S) ; do \ PYTHONPATH=$(CURDIR)/src:. py.test-$$pyvers || true ; \ done endif