Control: tag -1 patch
Control: block 908848 by -1
Hi,
here's a patch against grpc/1.3.2-1 that adds python{,3}-grpcio
packages.
Cheers,
-Hilko
>From 3473c855f3cb68370fbc2be51426899b3025e4ba Mon Sep 17 00:00:00 2001
From: Hilko Bengen <[email protected]>
Date: Mon, 17 Sep 2018 10:24:16 +0200
Subject: [PATCH] Add python-grpcio, python3-grpcio packages (Closes: #871442)
---
debian/control | 30 ++++++++++++++++++++++++-
debian/patches/python-unvendor.diff | 24 ++++++++++++++++++++
debian/patches/series | 1 +
debian/python-grpcio.install | 1 +
debian/python-grpcio.lintian-overrides | 1 +
debian/python3-grpcio.install | 1 +
debian/python3-grpcio.lintian-overrides | 1 +
debian/rules | 16 ++++++++++++-
8 files changed, 73 insertions(+), 2 deletions(-)
create mode 100644 debian/patches/python-unvendor.diff
create mode 100644 debian/python-grpcio.install
create mode 100644 debian/python-grpcio.lintian-overrides
create mode 100644 debian/python3-grpcio.install
create mode 100644 debian/python3-grpcio.lintian-overrides
diff --git a/debian/control b/debian/control
index 5abf03d..408e32e 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,13 @@ Source: grpc
Priority: optional
Maintainer: gRPC Package Maintainers <[email protected]>
Uploaders: Andrew Pollock <[email protected]>, Laszlo Boszormenyi (GCS) <[email protected]>
-Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libprotobuf-dev, protobuf-compiler, libgflags-dev, libgtest-dev, libgoogle-perftools-dev, python, libprotoc-dev, libc-ares-dev
+Build-Depends: debhelper (>= 9), zlib1g-dev, libssl-dev, libprotobuf-dev, protobuf-compiler, libgflags-dev, libgtest-dev, libgoogle-perftools-dev, python, libprotoc-dev, libc-ares-dev,
+ dh-python,
+ python-all-dev, python3-all-dev,
+ cython, cython3,
+ python-six, python3-six,
+ python-setuptools, python3-setuptools,
+ python-pkg-resources, python3-pkg-resources,
Standards-Version: 3.9.8
Section: libs
Homepage: http://www.grpc.io/
@@ -61,3 +67,25 @@ Description: high performance general RPC framework - protobuf plugin
.
This package provides the plugins needed for compiling gRPC service
definitions with the protobuf compiler.
+
+Package: python-grpcio
+Section: python
+Architecture: any
+Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends},
+Description: GRPC system (Python 2)
+ A modern, open source remote procedure call (RPC) framework that can
+ run anywhere. It enables client and server applications to communicate
+ transparently, and makes it easier to build connected systems.
+ .
+ This package contains the Python 2 bindings.
+
+Package: python3-grpcio
+Section: python
+Architecture: any
+Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends},
+Description: GRPC system (Python 3)
+ A modern, open source remote procedure call (RPC) framework that can
+ run anywhere. It enables client and server applications to communicate
+ transparently, and makes it easier to build connected systems.
+ .
+ This package contains the Python 3 bindings.
diff --git a/debian/patches/python-unvendor.diff b/debian/patches/python-unvendor.diff
new file mode 100644
index 0000000..ec6e95c
--- /dev/null
+++ b/debian/patches/python-unvendor.diff
@@ -0,0 +1,24 @@
+Index: grpc-1.3.2/setup.py
+===================================================================
+--- grpc-1.3.2.orig/setup.py
++++ grpc-1.3.2/setup.py
+@@ -144,6 +144,10 @@ CORE_C_FILES = tuple(grpc_core_dependenc
+ if "win32" in sys.platform and "64bit" in platform.architecture()[0]:
+ CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
+
++CORE_C_FILES = filter(lambda x: 'boringssl' not in x, CORE_C_FILES)
++CORE_C_FILES = filter(lambda x: 'third_party/zlib' not in x, CORE_C_FILES)
++CORE_C_FILES = filter(lambda x: 'third_party/cares' not in x, CORE_C_FILES)
++
+ EXTENSION_INCLUDE_DIRECTORIES = (
+ (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE)
+@@ -156,6 +160,8 @@ if not "win32" in sys.platform:
+ if "win32" in sys.platform:
+ EXTENSION_LIBRARIES += ('advapi32', 'ws2_32',)
+
++EXTENSION_LIBRARIES += ('ssl', 'crypto', 'cares', 'z',)
++
+ DEFINE_MACROS = (
+ ('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
+ ('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),)
diff --git a/debian/patches/series b/debian/patches/series
index 489fffe..a40de5b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ unvendor-zlib.diff
fix-libgrpc++-soname.diff
make-pkg-config-files-nonexecutable.diff
add-wrap-memcpy-flags.diff
+python-unvendor.diff
diff --git a/debian/python-grpcio.install b/debian/python-grpcio.install
new file mode 100644
index 0000000..dbdb301
--- /dev/null
+++ b/debian/python-grpcio.install
@@ -0,0 +1 @@
+/usr/lib/python2*
diff --git a/debian/python-grpcio.lintian-overrides b/debian/python-grpcio.lintian-overrides
new file mode 100644
index 0000000..6c17eb3
--- /dev/null
+++ b/debian/python-grpcio.lintian-overrides
@@ -0,0 +1 @@
+possible-gpl-code-linked-with-openssl
diff --git a/debian/python3-grpcio.install b/debian/python3-grpcio.install
new file mode 100644
index 0000000..fef6392
--- /dev/null
+++ b/debian/python3-grpcio.install
@@ -0,0 +1 @@
+/usr/lib/python3*
diff --git a/debian/python3-grpcio.lintian-overrides b/debian/python3-grpcio.lintian-overrides
new file mode 100644
index 0000000..6c17eb3
--- /dev/null
+++ b/debian/python3-grpcio.lintian-overrides
@@ -0,0 +1 @@
+possible-gpl-code-linked-with-openssl
diff --git a/debian/rules b/debian/rules
index c18cd5a..bbb7b61 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,21 +9,35 @@ include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+# Flags for Python build
+export GRPC_PYTHON_BUILD_WITH_CYTHON = 1
+
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+override_dh_auto_clean:
+ dh_auto_clean
+ dh_auto_clean -O--buildsystem=pybuild
+
+override_dh_auto_configure:
+ dh_auto_configure
+ dh_auto_configure -O--buildsystem=pybuild
+
override_dh_auto_build:
make shared prefix=/usr
+ dh_auto_build -O--buildsystem=pybuild
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# make test_c
endif
+ dh_auto_test -O--buildsystem=pybuild
override_dh_auto_install:
make install prefix=$(CURDIR)/debian/tmp/usr
+ dh_auto_install -O--buildsystem=pybuild
%:
- dh $@ --parallel
+ dh $@ --parallel --with=python2,python3
--
2.18.0