From 6a6a2c06f0cc832fd34adb3f64c4efa64bf60db9 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 25 Mar 2016 21:34:03 +0100 Subject: [PATCH] add debian packaging --- debian/changelog | 6 ++ debian/compat | 1 + debian/control | 24 +++++++ debian/copyright | 23 +++++++ debian/docs | 1 + .../01-reinstate-global-namespace.patch | 10 +++ debian/patches/02-make-thread-safe.patch | 21 ++++++ debian/patches/series | 2 + debian/rules | 15 +++++ debian/source/format | 1 + debian/watch | 2 + setup.py | 67 ++++++++++++------- 12 files changed, 150 insertions(+), 23 deletions(-) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/patches/01-reinstate-global-namespace.patch create mode 100644 debian/patches/02-make-thread-safe.patch create mode 100644 debian/patches/series create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b5d4753 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +python-suds-jurko (0.7.dev0-0) unstable; urgency=low + + * Add patch to fix thread safety issue + + -- Benjamin Dauvergn Fri, 25 Mar 2016 21:29:04 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3b9e8e1 --- /dev/null +++ b/debian/control @@ -0,0 +1,24 @@ +Source: python-suds-jurko +Section: python +Priority: optional +Maintainer: Benjamin Dauvergne +Build-Depends: debhelper (>= 8.0.0), python-all (>= 2.6.6-3~), python-setuptools +Standards-Version: 3.9.2 +Homepage: https://bitbucket.org/jurko/suds + +Package: python-suds-jurko +Architecture: all +Depends: ${python:Depends}, ${misc:Depends} +Conflicts: python-suds +Replaces: python-suds +Description: Lightweight SOAP client (Jurko's fork) + Based on the original 'suds' project by Jeff Ortel (jortel at redhat + dot com) hosted at 'https://fedorahosted.org/suds'. + . + 'Suds' is a lightweight SOAP-based web service client for Python licensed + under LGPL (see the LICENSE.txt file included in the distribution). + . + This is hopefully just a temporary fork of the original suds Python library + project created because the original project development seems to have stalled. + Should be reintegrated back into the original project if it ever gets revived + again. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ea22f25 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,23 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: suds-jurko +Source: https://bitbucket.org/jurko/suds + +Files: * +Copyright: 2008-2010 Jeff Ortel + 2011-2012 Jurko Gospodnetić +License: LGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . + . + The complete text of the GNU Lesser General Public License + can be found in /usr/share/common-licenses/LGPL-3 file. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..a1320b1 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.rst diff --git a/debian/patches/01-reinstate-global-namespace.patch b/debian/patches/01-reinstate-global-namespace.patch new file mode 100644 index 0000000..eaff141 --- /dev/null +++ b/debian/patches/01-reinstate-global-namespace.patch @@ -0,0 +1,10 @@ +diff --git a/suds/__init__.py b/suds/__init__.py +index ceb8e11..f4e1f20 100644 +--- a/suds/__init__.py ++++ b/suds/__init__.py +@@ -190,3 +190,5 @@ if sys.version_info >= (3, 0): + byte_str_class = bytes + else: + byte_str_class = str ++ ++import client diff --git a/debian/patches/02-make-thread-safe.patch b/debian/patches/02-make-thread-safe.patch new file mode 100644 index 0000000..0dc6268 --- /dev/null +++ b/debian/patches/02-make-thread-safe.patch @@ -0,0 +1,21 @@ +diff --git a/suds/bindings/binding.py b/suds/bindings/binding.py +index 661e433..d7b425a 100644 +--- a/suds/bindings/binding.py ++++ b/suds/bindings/binding.py +@@ -59,7 +59,6 @@ class Binding(object): + + """ + self.wsdl = wsdl +- self.multiref = MultiRef() + + def schema(self): + return self.wsdl.schema +@@ -148,7 +147,7 @@ class Binding(object): + soapenv = replyroot.getChild("Envelope", envns) + soapenv.promotePrefixes() + soapbody = soapenv.getChild("Body", envns) +- soapbody = self.multiref.process(soapbody) ++ soapbody = MultiRef().process(soapbody) + nodes = self.replycontent(method, soapbody) + rtypes = self.returned_types(method) + if len(rtypes) > 1: diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..84bda79 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,2 @@ +01-reinstate-global-namespace.patch +02-make-thread-safe.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..fc7b879 --- /dev/null +++ b/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ --with python2 + +override_dh_auto_clean: + python -B setup.py clean + +override_dh_auto_install: + dh_auto_install $@ + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..559ba1e --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://pypi.python.org/packages/source/s/suds-jurko/suds-jurko-(.*)\.tar\.bz2 diff --git a/setup.py b/setup.py index 8abea0d..16d0af9 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,7 @@ if (3,) <= sys.version_info < (3, 1): import os import os.path import re +import subprocess # Workaround for a Python issue detected with Python 3.1.3 when running our # pytest based 'setup.py test' command. At the end of the test run, Python @@ -601,28 +602,28 @@ if sys.version_info >= (3,): # Part of this workaround implemented and part in the project's MANIFEST.in # template. See a related comment in MANIFEST.in for more detailed information. -dummy_tools_folder = os.path.join(tools_folder, "__dummy__") -dummy_tools_file = os.path.join(dummy_tools_folder, "readme.txt") -try: - if not os.path.isdir(dummy_tools_folder): - os.mkdir(dummy_tools_folder) - if not os.path.isfile(dummy_tools_file): - f = open(dummy_tools_file, "w") - try: - f.write("""\ -Dummy empty folder added as a part of a patch to silence setup.py warnings when -determining which files belong to the project. See a related comment in the -project's MANIFEST.in template for more detailed information. - -Both the folder and this file have been generated by the project's setup.py -script and should not be placed under version control. -""") - finally: - f.close() -except EnvironmentError: - # Something went wrong attempting to construct the dummy file. Ah well, we - # gave it our best. Continue on with possible spurious warnings. - pass +#dummy_tools_folder = os.path.join(tools_folder, "__dummy__") +#dummy_tools_file = os.path.join(dummy_tools_folder, "readme.txt") +#try: +# if not os.path.isdir(dummy_tools_folder): +# os.mkdir(dummy_tools_folder) +# if not os.path.isfile(dummy_tools_file): +# f = open(dummy_tools_file, "w") +# try: +# f.write("""\ +#Dummy empty folder added as a part of a patch to silence setup.py warnings when +#determining which files belong to the project. See a related comment in the +#project's MANIFEST.in template for more detailed information. +# +#Both the folder and this file have been generated by the project's setup.py +#script and should not be placed under version control. +#""") +# finally: +# f.close() +#except EnvironmentError: +# # Something went wrong attempting to construct the dummy file. Ah well, we +# # gave it our best. Continue on with possible spurious warnings. +# pass # ----------------------------------------------------------------------------- @@ -684,9 +685,29 @@ maintainer="Jurko Gospodnetić" if can_not_use_non_ASCII_meta_data: maintainer = unicode2ascii(maintainer) +def get_version(): + '''Use the VERSION, if absent generates a version with git describe, if not + tag exists, take 0.0.0- and add the length of the commit log. + ''' + if os.path.exists('VERSION'): + with open('VERSION', 'r') as v: + return v.read() + if os.path.exists('.git'): + p = subprocess.Popen(['git', 'describe', '--dirty', '--tags', '--match=release-*'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + result = p.communicate()[0] + if p.returncode == 0: + result = result.split()[0][len('release-'):] + else: + result = '0.0.0-%s' % len(subprocess.check_output( + ['git', 'rev-list', 'HEAD']).splitlines()) + return result.replace('-', '.') + return '0.0.0' + setup( name=package_name, - version=__version__, + version=get_version(), description="Lightweight SOAP client (Jurko's fork)", long_description=long_description, keywords=["SOAP", "web", "service", "client"],