tag 836821 + patch
thank you
Hello,
thank you for maintaining protobuf in Debian.
As a token of appreciation, please find attached a patch to add support
for Python 3.
Best regards
Thomas
diff -Nru protobuf-3.0.0/debian/changelog protobuf-3.0.0/debian/changelog
--- protobuf-3.0.0/debian/changelog 2016-09-02 08:57:13.000000000 +0200
+++ protobuf-3.0.0/debian/changelog 2016-09-11 18:08:39.000000000 +0200
@@ -1,3 +1,9 @@
+protobuf (3.0.0-7.1) UNRELEASED; urgency=medium
+
+ * Patch to enable python 3. Closes: #836821
+
+ -- Thomas Viehmann <t...@beamnet.de> Sat, 10 Sep 2016 00:00:00 +0000
+
protobuf (3.0.0-7) unstable; urgency=medium
* Team upload.
diff -Nru protobuf-3.0.0/debian/control protobuf-3.0.0/debian/control
--- protobuf-3.0.0/debian/control 2016-08-26 00:28:51.000000000 +0200
+++ protobuf-3.0.0/debian/control 2016-09-11 15:38:55.000000000 +0200
@@ -20,7 +20,10 @@
, dh-python
, python-all (>= 2.7)
, libpython-all-dev (>= 2.7)
+ , python3-all (>= 3.3)
+ , libpython3-all-dev (>= 3.3)
, python-setuptools
+ , python3-setuptools
, python-google-apputils
# Manpage generator
, xmlto
@@ -180,6 +183,27 @@
need the protoc tool (in the protobuf-compiler package) to compile your
definition to Python classes, and then the modules in this package will allow
you to use those classes in your programs.
+
+Package: python3-protobuf
+Architecture: any
+Section: python
+Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends}
+Description: Python 3 bindings for protocol buffers
+ Protocol buffers are a flexible, efficient, automated mechanism for
+ serializing structured data - similar to XML, but smaller, faster, and
+ simpler. You define how you want your data to be structured once, then you can
+ use special generated source code to easily write and read your structured
+ data to and from a variety of data streams and using a variety of languages.
+ You can even update your data structure without breaking deployed programs
+ that are compiled against the "old" format.
+ .
+ Google uses Protocol Buffers for almost all of its internal RPC protocols and
+ file formats.
+ .
+ This package contains the Python 3 bindings for the protocol buffers. You will
+ need the protoc tool (in the protobuf-compiler package) to compile your
+ definition to Python classes, and then the modules in this package will allow
+ you to use those classes in your programs.
Package: libprotobuf-java
Architecture: all
diff -Nru protobuf-3.0.0/debian/python-protobuf3.README.Debian protobuf-3.0.0/debian/python-protobuf3.README.Debian
--- protobuf-3.0.0/debian/python-protobuf3.README.Debian 1970-01-01 01:00:00.000000000 +0100
+++ protobuf-3.0.0/debian/python-protobuf3.README.Debian 2016-09-11 15:39:56.000000000 +0200
@@ -0,0 +1,11 @@
+C++ backend
+===========
+
+As of protobuf 2.6.0, a new C++ backend for the Python protobuf bindings is
+available, which is faster than the default pure Python implementation. It can
+be activated by setting the following environment variables:
+
+PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
+PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
+
+ -- Robert Edmonds <edmo...@debian.org> Thu, 28 Aug 2014 21:10:30 -0700
diff -Nru protobuf-3.0.0/debian/rules protobuf-3.0.0/debian/rules
--- protobuf-3.0.0/debian/rules 2016-08-25 02:28:25.000000000 +0200
+++ protobuf-3.0.0/debian/rules 2016-09-11 15:42:48.000000000 +0200
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
%:
- dh $@ --with autoreconf,python2 --parallel
+ dh $@ --with autoreconf,python2,python3 --parallel
override_dh_auto_build-arch:
## Chicken<->Egg problem: protobuf requires self-generated .pb.go files to
@@ -13,9 +13,10 @@
# Generate the manpage.
xmlto man debian/protoc.xml
-
+ cp python python3 -r
# Python build.
cd python && python setup.py build --cpp_implementation
+ cd python3 && python3 setup.py build --cpp_implementation
override_dh_auto_build-indep:
dh_auto_build --indep
@@ -45,6 +46,9 @@
cd python && for python in $(shell pyversions -r); do \
$$python setup.py test --cpp_implementation; \
done
+ cd python3 && for python in $(shell py3versions -r); do \
+ $$python setup.py test --cpp_implementation; \
+ done
endif
override_dh_auto_test-indep:
@@ -58,6 +62,7 @@
$$python setup.py clean --all; \
done
rm -rf python/protobuf.egg-info
+ rm -rf python3
override_dh_auto_clean-indep:
dh_auto_clean --indep
@@ -76,7 +81,13 @@
--install-layout=deb --no-compile \
--root=$(CURDIR)/debian/python-protobuf; \
done
+ cd python3 && for python in $(shell py3versions -r); do \
+ $$python setup.py install --cpp_implementation \
+ --install-layout=deb --no-compile \
+ --root=$(CURDIR)/debian/python3-protobuf; \
+ done
find $(CURDIR)/debian/python-protobuf -name 'protobuf-*-nspkg.pth' -delete
+ find $(CURDIR)/debian/python3-protobuf -name 'protobuf-*-nspkg.pth' -delete
override_dh_auto_install-indep:
dh_auto_install --indep