Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Description: This package contains development files for Switch State Service.

Package: python-swsscommon
Architecture: any
Build-Profiles: <!nopython2>
Depends: ${shlibs:Depends}, ${misc:Pre-Depends}
Section: libs
Description: This package contains Switch State Service common Python2 library.
Expand Down
1 change: 1 addition & 0 deletions debian/python-swsscommon.dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python2.7
1 change: 1 addition & 0 deletions debian/python-swsscommon.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/lib/python2.7/dist-packages/swsscommon/*
22 changes: 7 additions & 15 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ include /usr/share/dpkg/default.mk

DEBIAN_DIST_CODENAME := $(shell lsb_release -sc | sed -e 's/\#/ /g')

DOPACKAGES = $(shell dh_listpackages)

# For Debian jessie, stretch, and buster, and Ubuntu bionic and focal, build
# Python 2 bindings.
ifneq (,$(filter jessie stretch buster bionic focal,$(DEBIAN_DIST_CODENAME)))
CONFIGURE_ARGS = --enable-python2
# Python 2 bindings. This is controlled by the build profile being used.
ifneq (,$(filter python-swsscommon,$(DOPACKAGES)))
CONFIGURE_ARGS += --enable-python2
else
CONFIGURE_ARGS = --disable-python2
CONFIGURE_ARGS += --disable-python2
endif

# main packaging script based on dh7 syntax
Expand All @@ -33,19 +35,9 @@ endif
# dh_make generated override targets
# This is example for Cmake (See https://bugs.debian.org/641051 )
override_dh_auto_configure:
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS)
dh_auto_configure -- $(CONFIGURE_ARGS) $(DEB_CONFIGURE_EXTRA_FLAGS)
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

override_dh_auto_configure:
dh_auto_configure -- $(CONFIGURE_ARGS)

override_dh_auto_install:
dh_auto_install
if [ -d debian/tmp/usr/lib/python2.7/dist-packages/swsscommon ]; then \
dh_installdirs --package=python-swsscommon /usr/lib/python2.7/dist-packages/swsscommon/ ; \
cp -a debian/tmp/usr/lib/python2.7/dist-packages/swsscommon/* debian/python-swsscommon/usr/lib/python2.7/dist-packages/swsscommon/ ; \
fi

override_dh_clean:
dh_clean
rm -f pyext/swsscommon.py pyext/swsscommon_wrap.cpp
Expand Down