diff mbox series

[ovs-dev,v4,6/9] debian: Fix build of python json C extension.

Message ID 20220714155546.3402682-6-frode.nordahl@canonical.com
State Accepted
Commit 6ad3be9749abe6d840a45e5be7ed28abb4c45262
Headers show
Series [ovs-dev,v4,1/9] debian: Archive debian packaging source. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Frode Nordahl July 14, 2022, 3:55 p.m. UTC
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
---
 debian/control |  3 ++-
 debian/rules   | 13 +++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/debian/control b/debian/control
index a813d7cc7..0ff894461 100644
--- a/debian/control
+++ b/debian/control
@@ -278,11 +278,12 @@  Description: Open vSwitch VTEP utilities
  VTEP-configured database and a VTEP emulator.
 
 Package: python3-openvswitch
-Architecture: all
+Architecture: linux-any
 Section: python
 Depends:
  ${misc:Depends},
  ${python3:Depends},
+ ${shlibs:Depends},
 Description: Python 3 bindings for Open vSwitch
  Open vSwitch is a production quality, multilayer, software-based,
  Ethernet virtual switch. It is designed to enable massive network
diff --git a/debian/rules b/debian/rules
index f24801d14..9a2f8ac1c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,10 +85,15 @@  override_dh_auto_install:
 
 execute_after_dh_install:
 	set -e && for pyvers in $(PYTHON3S); do \
-		cd python && python$$pyvers setup.py install --install-layout=deb \
-			--root $(CURDIR)/debian/python3-openvswitch; cd ..; \
+		cd python && \
+		enable_shared=no \
+		CFLAGS=-I$(CURDIR)/debian/tmp/usr/include \
+		LDFLAGS=$(CURDIR)/debian/tmp/usr/lib/libopenvswitch.a \
+		python$$pyvers setup.py install --install-layout=deb \
+			--root $(CURDIR)/debian/python3-openvswitch; \
+		cd ..; \
 		mkdir -p $(CURDIR)/debian/openvswitch-test/usr/lib/python$$pyvers/dist-packages/ovstest; \
-		install -v -D -m 644 python/ovstest/*.py \
+		install -v -D python/ovstest/*.py \
 			$(CURDIR)/debian/openvswitch-test/usr/lib/python$$pyvers/dist-packages/ovstest; \
 	done
 
@@ -108,7 +113,7 @@  override_dh_strip:
 	dh_strip --dbgsym-migration='openvswitch-dbg (<< 2.17~)'
 
 override_dh_python3:
-	dh_python3 --shebang=/usr/bin/python3
+	DEB_HOST_ARCH=$(DEB_HOST_ARCH) dh_python3 --shebang=/usr/bin/python3
 
 # Helper target for creating snapshots from upstream git
 DATE=$(shell date +%Y%m%d)