From a416493d3b9017181054d5ff24d5efdcdb5bf39f Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 12 May 2020 12:22:18 +0200 Subject: misc: fix ubuntu 20.04 python deps Type: fix Change-Id: I9cdfbffd6333d090f970422bf047aaa90c1e4c65 Signed-off-by: Damjan Marion --- Makefile | 14 +++---- src/pkg/CMakeLists.txt | 24 ++++++++++- src/pkg/debian/control | 85 --------------------------------------- src/pkg/debian/control.in | 83 ++++++++++++++++++++++++++++++++++++++ src/pkg/debian/rules.in | 13 ++++-- src/vpp-api/python/CMakeLists.txt | 6 ++- 6 files changed, 126 insertions(+), 99 deletions(-) delete mode 100644 src/pkg/debian/control create mode 100644 src/pkg/debian/control.in diff --git a/Makefile b/Makefile index 35140711d09..709fb73dce9 100644 --- a/Makefile +++ b/Makefile @@ -65,8 +65,7 @@ DEB_DEPENDS = curl build-essential autoconf automake ccache DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config DEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev -DEB_DEPENDS += python-all python3-all python3-setuptools -DEB_DEPENDS += python-virtualenv python-pip check +DEB_DEPENDS += python3-all python3-setuptools check DEB_DEPENDS += libboost-all-dev libffi-dev python3-ply libmbedtls-dev DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml DEB_DEPENDS += python3-venv # ensurepip @@ -75,20 +74,21 @@ DEB_DEPENDS += python3-dev # needed for python3 -m pip install psutil LIBFFI=libffi6 # works on all but 20.04 -ifeq ($(OS_VERSION_ID),16.04) - DEB_DEPENDS += python-dev - DEB_DEPENDS += libssl-dev -else ifeq ($(OS_VERSION_ID),18.04) - DEB_DEPENDS += python-dev +ifeq ($(OS_VERSION_ID),18.04) + DEB_DEPENDS += python-dev python-all python-pip python-virtualenv DEB_DEPENDS += libssl-dev DEB_DEPENDS += clang-9 else ifeq ($(OS_VERSION_ID),20.04) + DEB_DEPENDS += python3-virtualenv LIBFFI=libffi7 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8) DEB_DEPENDS += libssl-dev + DEB_DEPENDS += python-dev python-all python-pip python-virtualenv APT_ARGS = -t jessie-backports else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-9) DEB_DEPENDS += libssl1.0-dev + DEB_DEPENDS += python-all python-pip + DEB_DEPENDS += python-dev python-all python-pip python-virtualenv else DEB_DEPENDS += libssl-dev endif diff --git a/src/pkg/CMakeLists.txt b/src/pkg/CMakeLists.txt index 357d966ddee..a5a0ffe5827 100644 --- a/src/pkg/CMakeLists.txt +++ b/src/pkg/CMakeLists.txt @@ -20,14 +20,34 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE ) -foreach(f rules changelog) +# parse /etc/os-release +file(READ "/etc/os-release" os_release) +string(REPLACE "\n" ";" os_release ${os_release}) +foreach(l ${os_release}) + string(REPLACE "=" ";" l ${l}) + list(GET l 0 _name) + list(GET l 1 _value) + string(REPLACE "\"" "" _value ${_value}) + set(OS_${_name} ${_value}) +endforeach() + +if (OS_ID STREQUAL "ubuntu" AND OS_VERSION_ID VERSION_LESS 20.04) + set(VPP_DEB_BUILD_DEPENDS "python-all, python3-all, python3-setuptools") + set(VPP_DEB_WITH_PYTHON2 "yes") +else() + set(VPP_DEB_BUILD_DEPENDS "python3-all, python3-setuptools") + set(VPP_DEB_WITH_PYTHON2 "no") +endif() + +foreach(f rules changelog control) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f}.in ${CMAKE_BINARY_DIR}/debian/${f} + @ONLY ) endforeach() -foreach(f control copyright vpp.preinst vpp.postrm vpp.postinst vpp.service) +foreach(f copyright vpp.preinst vpp.postrm vpp.postinst vpp.service) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f} DESTINATION ${CMAKE_BINARY_DIR}/debian diff --git a/src/pkg/debian/control b/src/pkg/debian/control deleted file mode 100644 index 48de48ab115..00000000000 --- a/src/pkg/debian/control +++ /dev/null @@ -1,85 +0,0 @@ -Source: vpp -Section: net -Priority: extra -Maintainer: fd.io VPP Packaging Team -Build-Depends: debhelper (>= 9), - dh-systemd, - dh-python, - python-all, - python3-all, - python3-setuptools -Standards-Version: 3.9.4 - -Package: vpp -Architecture: any -Depends: libvppinfra (= ${source:Version}), - ${shlibs:Depends}, - ${misc:Depends} -Description: Vector Packet Processing--executables - This package provides VPP executables: vpp, vpp_api_test, vpp_json_test - vpp - the vector packet engine - vpp_api_test - vector packet engine API test tool - vpp_json_test - vector packet engine JSON test tool - -Package: vpp-dbg -Architecture: any -Depends: ${misc:Depends} -Description: Vector Packet Processing--debug symbols - -Package: vpp-dev -Architecture: any -Depends: libvppinfra-dev (= ${source:Version}), - ${misc:Depends}, - ${python:Depends} -Description: Vector Packet Processing--development support - This package contains development support files for the VPP libraries - . - -Package: libvppinfra -Architecture: any -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Vector Packet Processing--runtime libraries - This package contains the VPP shared libraries, including: - . - -Package: libvppinfra-dev -Architecture: any -Depends: ${misc:Depends} -Description: Vector Packet Processing--runtime libraries - This package contains the VPP shared libraries, including: - . - -Package: vpp-plugin-core -Architecture: any -Depends: vpp (= ${source:Version}), - ${shlibs:Depends} -Description: Vector Packet Processing--runtime core plugins - This package contains VPP core plugins - . - -Package: vpp-plugin-dpdk -Architecture: any -Depends: vpp (= ${source:Version}), - ${shlibs:Depends} -Description: Vector Packet Processing--runtime dpdk plugin - This package contains the VPP dpdk plugin - . - -Package: vpp-api-python -Architecture: any -Depends: vpp (= ${source:Version}), - ${python:Depends}, - ${misc:Depends} -Description: VPP Python API bindings - This package contains VPP python api bindings - . - -Package: python3-vpp-api -Architecture: any -Depends: vpp (= ${source:Version}), - ${python3:Depends}, - ${misc:Depends} -Description: VPP Python3 API bindings - This package contains VPP python api bindings - . diff --git a/src/pkg/debian/control.in b/src/pkg/debian/control.in new file mode 100644 index 00000000000..0b0c621e50c --- /dev/null +++ b/src/pkg/debian/control.in @@ -0,0 +1,83 @@ +Source: vpp +Section: net +Priority: extra +Maintainer: fd.io VPP Packaging Team +Build-Depends: debhelper (>= 9), + dh-systemd, + dh-python, + @VPP_DEB_BUILD_DEPENDS@ +Standards-Version: 3.9.4 + +Package: vpp +Architecture: any +Depends: libvppinfra (= ${source:Version}), + ${shlibs:Depends}, + ${misc:Depends} +Description: Vector Packet Processing--executables + This package provides VPP executables: vpp, vpp_api_test, vpp_json_test + vpp - the vector packet engine + vpp_api_test - vector packet engine API test tool + vpp_json_test - vector packet engine JSON test tool + +Package: vpp-dbg +Architecture: any +Depends: ${misc:Depends} +Description: Vector Packet Processing--debug symbols + +Package: vpp-dev +Architecture: any +Depends: libvppinfra-dev (= ${source:Version}), + ${misc:Depends}, + ${python:Depends} +Description: Vector Packet Processing--development support + This package contains development support files for the VPP libraries + . + +Package: libvppinfra +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends} +Description: Vector Packet Processing--runtime libraries + This package contains the VPP shared libraries, including: + . + +Package: libvppinfra-dev +Architecture: any +Depends: ${misc:Depends} +Description: Vector Packet Processing--runtime libraries + This package contains the VPP shared libraries, including: + . + +Package: vpp-plugin-core +Architecture: any +Depends: vpp (= ${source:Version}), + ${shlibs:Depends} +Description: Vector Packet Processing--runtime core plugins + This package contains VPP core plugins + . + +Package: vpp-plugin-dpdk +Architecture: any +Depends: vpp (= ${source:Version}), + ${shlibs:Depends} +Description: Vector Packet Processing--runtime dpdk plugin + This package contains the VPP dpdk plugin + . + +Package: vpp-api-python +Architecture: any +Depends: vpp (= ${source:Version}), + ${python:Depends}, + ${misc:Depends} +Description: VPP Python API bindings + This package contains VPP python api bindings + . + +Package: python3-vpp-api +Architecture: any +Depends: vpp (= ${source:Version}), + ${python3:Depends}, + ${misc:Depends} +Description: VPP Python3 API bindings + This package contains VPP python api bindings + . diff --git a/src/pkg/debian/rules.in b/src/pkg/debian/rules.in index ceef46a297a..f09db38e2a1 100755 --- a/src/pkg/debian/rules.in +++ b/src/pkg/debian/rules.in @@ -9,18 +9,23 @@ include /usr/share/dpkg/default.mk export PYBUILD_NAME = vpp-api export PYBUILD_DIR = @CMAKE_SOURCE_DIR@/vpp-api/python -export PYBUILD_DESTDIR_python2=debian/vpp-api-python/ -export PYBUILD_DISABLE_python2=test export PYBUILD_DESTDIR_python3=debian/python3-vpp-api/ export PYBUILD_DISABLE_python3=test export PYBUILD_SYSTEM=distutils - +ifeq (@VPP_DEB_WITH_PYTHON2@,yes) +export PYBUILD_DESTDIR_python2=debian/vpp-api-python/ +export PYBUILD_DISABLE_python2=test buildvers := $(shell pyversions -sv) +DH_WITH = systemd,python2,python3 +else +DH_WITH = systemd,python3 +endif + build3vers := $(shell py3versions -sv) # main packaging script based on dh7 syntax %: - dh $@ --with systemd,python2,python3 --buildsystem=pybuild + dh $@ --with $(DH_WITH) --buildsystem=pybuild override_dh_strip: dh_strip --dbg-package=vpp-dbg diff --git a/src/vpp-api/python/CMakeLists.txt b/src/vpp-api/python/CMakeLists.txt index 910df6bfd6b..6450fd92f2d 100644 --- a/src/vpp-api/python/CMakeLists.txt +++ b/src/vpp-api/python/CMakeLists.txt @@ -11,7 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -find_package(Python3 COMPONENTS Interpreter) +if (CMAKE_VERSION VERSION_LESS 3.12) + find_package(PythonInterp 2.7) +else() + find_package(Python3 COMPONENTS Interpreter) +endif() if(PYTHONINTERP_FOUND) install( -- cgit 1.2.3-korg