diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 9e17ef87702e..1fc5b1d298c2 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -114,7 +114,7 @@ jobs: set -ex rm ../*.deb || true ./autogen.sh - fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs + DEB_BUILD_OPTIONS=nocheck fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs mv ../*.deb . displayName: "Compile sonic sairedis with coverage enabled" - script: | diff --git a/debian/control b/debian/control index 044c2ee9e7b5..5b5284e0b5d5 100644 --- a/debian/control +++ b/debian/control @@ -117,6 +117,7 @@ Description: debugging symbols for libsaimetadata Package: python-pysairedis Architecture: any +Build-Profiles: Depends: ${shlibs:Depends}, ${misc:Pre-Depends} Section: libs Description: This package contains Switch State Service sairedis Python2 library. diff --git a/debian/python-pysairedis.install b/debian/python-pysairedis.install index 3108ecb46f29..3b6076a2b016 100644 --- a/debian/python-pysairedis.install +++ b/debian/python-pysairedis.install @@ -1 +1 @@ -usr/lib/python2.7/dist-packages/pysairedis/* +usr/lib/python2.7/dist-packages/sairedis/* diff --git a/debian/python3-pysairedis.install b/debian/python3-pysairedis.install index 6b510bba9910..8ec73be35d1f 100644 --- a/debian/python3-pysairedis.install +++ b/debian/python3-pysairedis.install @@ -1 +1 @@ -usr/lib/python3/dist-packages/pysairedis/* +usr/lib/python3/dist-packages/sairedis/* diff --git a/debian/rules b/debian/rules index 09f063dbde93..7568b68ca83b 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ .ONESHELL: SHELL = /bin/bash -.SHELLFLAGS += -x +.SHELLFLAGS += -ex # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 @@ -29,6 +29,16 @@ endif # package maintainers to append LDFLAGS #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed +DOPACKAGES = $(shell dh_listpackages) + +# For Debian jessie, stretch, and buster, and Ubuntu bionic and focal, build +# Python 2 bindings. This is controlled by the build profile being used. +ifneq (,$(filter python-pysairedis,$(DOPACKAGES))) +configure_opts += --enable-python2 +else +configure_opts += --disable-python2 +endif + clean: dh $@ --with autotools-dev