summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--debian/.git-dpm8
-rw-r--r--debian/changelog45
-rw-r--r--debian/clean2
-rw-r--r--debian/compat1
-rw-r--r--debian/control42
-rw-r--r--debian/copyright30
-rw-r--r--debian/gbp.conf7
-rw-r--r--debian/patches/0001-set-message_id-properly-in-expat-parser.patch24
-rw-r--r--debian/patches/0002-enable-use_2to3-in-setup.py.patch21
-rw-r--r--debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch40
-rw-r--r--debian/patches/series3
-rwxr-xr-xdebian/rules10
-rw-r--r--debian/source/format1
-rw-r--r--debian/source/options1
-rw-r--r--debian/watch2
16 files changed, 245 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..67e95ff
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+build/
+debian/files
+debian/python-pynzb.debhelper.log
+debian/python-pynzb.postinst.debhelper
+debian/python-pynzb.prerm.debhelper
+debian/python-pynzb.substvars
+debian/python-pynzb/
+pynzb.egg-info/
diff --git a/debian/.git-dpm b/debian/.git-dpm
new file mode 100644
index 0000000..f93cbbb
--- /dev/null
+++ b/debian/.git-dpm
@@ -0,0 +1,8 @@
+# see git-dpm(1) from git-dpm package
+591e67b26a2d694d5aae2d77985eab4d8daf2d9e
+591e67b26a2d694d5aae2d77985eab4d8daf2d9e
+124074ce42e5d83c71e028a8757afb392cc96548
+124074ce42e5d83c71e028a8757afb392cc96548
+python-pynzb_0.1.0.orig.tar.gz
+cf39d7f32c15f281ab81b0043b4068d101a2cd1f
+5598
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f3b3f5a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,45 @@
+python-pynzb (0.1.0-3) unstable; urgency=medium
+
+ * Add myself to uploaders.
+ * Switch to pybuild and dh-python.
+ * Bump d/compat to 10 and update version of B-D on debhelper.
+ * Bump standards-version to 3.9.8 (no changes).
+ * d/copyright: add myself and fix license short names:
+ - "public domain" -> public-domain,
+ - BSD -> BSD-3-clause.
+ * Change Vcs to DPMT git repository and use https.
+ * Change Homepage to Github.
+ * Build the Python 3 module.
+ - replace B-D: python{,3}-setuptools and python{,3}-all
+ * Drop the Python 2 module (no rdeps):
+ * Run the test suite with pytest:
+ - cleanup the produced .cache/ in d/clean,
+ - add B-D on python3-pytest.
+ * 0001-set-message_id-properly-in-expat-parser.patch: fix an upstream code
+ typo. This change allows the tests to pass for Python 2.
+ * 0002-enable-use_2to3-in-setup.py.patch: enable 2to3 invocation in setup.py.
+ * Move lxml to Suggests rather than Depends since there are fallbacks using
+ standard library XML parsers.
+ * Build-Depend on lxml in order to run the test for the implementation of the
+ NZB parser using lxml (LXMLNZBParser).
+ * 0003-give-lxml-etree-BytesIO-in-Python-3.patch: make the code Python 3
+ compatible by decoding strings -> bytes as UTF-8 and substituting BytesIO
+ for StringIO. This only affects the LXMLNZPParser.
+ * Fix watch file and declare version 4 format.
+ * Cleanup .egg-info files in d/clean and d/source/options.
+
+ -- Carl Suster <carl@contraflo.ws> Wed, 11 Jan 2017 22:51:40 +1100
+
+python-pynzb (0.1.0-2) unstable; urgency=low
+
+ * use https:// URL for pypi in debian/watch
+ * clarify description (Closes: #749218)
+
+ -- Hans-Christoph Steiner <hans@eds.org> Thu, 23 Oct 2014 12:31:55 -0400
+
+python-pynzb (0.1.0-1) unstable; urgency=low
+
+ * source package automatically created by stdeb 0.6.0+git
+ * Initial release (Closes: #723170)
+
+ -- Hans-Christoph Steiner <hans@eds.org> Mon, 16 Sep 2013 22:20:44 -0400
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 0000000..739fbc2
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@
+*.egg-info/*
+.cache/
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..f5307e0
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,42 @@
+Source: python-pynzb
+Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
+Uploaders:
+ Hans-Christoph Steiner <hans@eds.org>,
+ Carl Suster <carl@contraflo.ws>
+Section: python
+Priority: optional
+Build-Depends:
+ debhelper (>= 10),
+ dh-python,
+ python3-all,
+ python3-lxml,
+ python3-pytest,
+ python3-setuptools,
+Standards-Version: 3.9.8
+Homepage: https://github.com/ericflo/pynzb
+Vcs-Git: https://anonscm.debian.org/git/python-modules/packages/python-pynzb.git
+Vcs-Browser: https://anonscm.debian.org/git/python-modules/packages/python-pynzb.git
+
+Package: python3-pynzb
+Architecture: all
+Depends: ${misc:Depends}, ${python3:Depends}
+Suggests: python3-lxml
+Description: unified API for parsing NZB files from NNTP (Usenet) servers
+ pynzb is a unified API for parsing NZB files, with several concrete
+ implementations included.
+ .
+ NZB is an XML-based file format for retrieving posts from NNTP (Usenet)
+ servers. Since NZB is XML-based, it's relatively easy to build one-off
+ parsers to parse NZB files. This project is an attempt to consolidate those
+ many one-off NZB parsers into one simple interface.
+ .
+ This package includes three implementations (listed in order of
+ compatibility): one based on expat, another based on ElementTree, and a final
+ implementation based on lxml. The expat version should work on all versions
+ of Python > 2.0. The ElementTree implementation will work on Python > 2.5.
+ The lxml version will work as long as lxml is installed.
+ .
+ Simply import nzb_parser from the pynzb package. It's an instantiated
+ version of the fastest available parser that your system can support.
+ .
+ This package provides the Python 3 module.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..563a0bf
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,30 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: pynzb
+Upstream-Contact: Eric Florenzano <floguy@gmail.com>
+Source: https://github.com/ericflo/pynzb
+
+Files: *
+Copyright: 2009, Eric Florenzano <floguy@gmail.com>
+License: BSD-3-clause
+
+Files: ./debian/*
+Copyright: 2012 Hans-Christoph Steiner <hans@eds.org>
+ 2017 Carl Suster <carl@contraflo.ws>
+License: public-domain
+
+License: BSD-3-clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the author nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+License: public-domain
+ I hereby release these files into the public domain.
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..ae1dc36
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,7 @@
+[DEFAULT]
+upstream-branch = upstream
+debian-branch = master
+upstream-tag = upstream/%(version)s
+debian-tag = debian/%(version)s
+pristine-tar = True
+sign-tags = True
diff --git a/debian/patches/0001-set-message_id-properly-in-expat-parser.patch b/debian/patches/0001-set-message_id-properly-in-expat-parser.patch
new file mode 100644
index 0000000..2ed07ab
--- /dev/null
+++ b/debian/patches/0001-set-message_id-properly-in-expat-parser.patch
@@ -0,0 +1,24 @@
+From 0a5a3e9b44be1ec1a150c027a07754a53f039189 Mon Sep 17 00:00:00 2001
+From: Carl Suster <carl@contraflo.ws>
+Date: Mon, 9 Jan 2017 11:57:13 +1100
+Subject: set message_id properly in expat parser
+
+Upstream had a typo in the expat parser wrapper which called the
+non-existent message_id() when set_message_id() was intended.
+---
+ pynzb/expat_nzb.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pynzb/expat_nzb.py b/pynzb/expat_nzb.py
+index 5c1b096..313dee6 100644
+--- a/pynzb/expat_nzb.py
++++ b/pynzb/expat_nzb.py
+@@ -22,7 +22,7 @@ class ExpatNZBParser(BaseNZBParser):
+ elif name == 'group':
+ self.current_file.add_group(self.current_data)
+ elif name == 'segment':
+- self.current_segment.message_id(self.current_data)
++ self.current_segment.set_message_id(self.current_data)
+ self.current_file.add_segment(self.current_segment)
+
+ def char_data(self, data):
diff --git a/debian/patches/0002-enable-use_2to3-in-setup.py.patch b/debian/patches/0002-enable-use_2to3-in-setup.py.patch
new file mode 100644
index 0000000..16f2a85
--- /dev/null
+++ b/debian/patches/0002-enable-use_2to3-in-setup.py.patch
@@ -0,0 +1,21 @@
+From 01027917584eafdf4228bf0590123dfd47fe14a8 Mon Sep 17 00:00:00 2001
+From: Carl Suster <carl@contraflo.ws>
+Date: Wed, 11 Jan 2017 22:23:32 +1100
+Subject: enable use_2to3 in setup.py
+
+---
+ setup.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 0fd9d51..62f1ff3 100644
+--- a/setup.py
++++ b/setup.py
+@@ -168,4 +168,5 @@ setup(
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=['setuptools'],
+-)
+\ No newline at end of file
++ use_2to3=True,
++)
diff --git a/debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch b/debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch
new file mode 100644
index 0000000..aac136f
--- /dev/null
+++ b/debian/patches/0003-give-lxml-etree-BytesIO-in-Python-3.patch
@@ -0,0 +1,40 @@
+From 591e67b26a2d694d5aae2d77985eab4d8daf2d9e Mon Sep 17 00:00:00 2001
+From: Carl Suster <carl@contraflo.ws>
+Date: Wed, 11 Jan 2017 22:34:34 +1100
+Subject: give lxml etree BytesIO in Python 3
+
+The lxml etree API changed in Python 3 to take BytesIO instead of
+StringIO. This patch maintains the original behaviour in Python 2 but
+switches to BytesIO in Python 3, decoding the XML data as UTF-8.
+---
+ pynzb/lxml_nzb.py | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/pynzb/lxml_nzb.py b/pynzb/lxml_nzb.py
+index 790671d..e74ba34 100644
+--- a/pynzb/lxml_nzb.py
++++ b/pynzb/lxml_nzb.py
+@@ -6,11 +6,17 @@ except ImportError:
+ raise ImportError("You must have lxml installed before you can use the " +
+ "lxml NZB parser.")
+
+-try:
+- from cStringIO import StringIO
+-except ImportError:
+- from StringIO import StringIO
++import sys
++if sys.version_info.major < 3:
++ try:
++ from cStringIO import StringIO
++ except ImportError:
++ from StringIO import StringIO
++ def as_io(xml): return StringIO(xml)
++else:
++ from io import BytesIO
++ def as_io(xml): return BytesIO(bytes(xml, 'utf-8'))
+
+ class LXMLNZBParser(BaseETreeNZBParser):
+ def get_etree_iter(self, xml, et=etree):
+- return iter(et.iterparse(StringIO(xml), events=("start", "end")))
+\ No newline at end of file
++ return iter(et.iterparse(as_io(xml), events=("start", "end")))
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..37dcf18
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+0001-set-message_id-properly-in-expat-parser.patch
+0002-enable-use_2to3-in-setup.py.patch
+0003-give-lxml-etree-BytesIO-in-Python-3.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..dee803d
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,10 @@
+#!/usr/bin/make -f
+# export DH_VERBOSE=1
+
+export PYBUILD_NAME=pynzb
+
+export PYBUILD_TEST_ARGS=pynzb/tests.py
+
+
+%:
+ dh $@ --with python3 --buildsystem=pybuild
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/source/options b/debian/source/options
new file mode 100644
index 0000000..b2b7b88
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+extend-diff-ignore="^[^/]+\.egg-info/"
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..62f8d47
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=4
+https://pypi.python.org/packages/source/p/pynzb/pynzb-(.+)\.tar\.gz debian uupdate