aboutsummaryrefslogtreecommitdiffstats
path: root/src/pkg/CMakeLists.txt
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-05-12 12:22:18 +0200
committerFlorin Coras <florin.coras@gmail.com>2020-05-15 23:42:40 +0000
commita416493d3b9017181054d5ff24d5efdcdb5bf39f (patch)
tree960b1d9cafdcbb91f218999c14b82d86a42af6c8 /src/pkg/CMakeLists.txt
parentd466c0cafcbc3189b5982f3df8d4cd4d553704ce (diff)
misc: fix ubuntu 20.04 python deps
Type: fix Change-Id: I9cdfbffd6333d090f970422bf047aaa90c1e4c65 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/pkg/CMakeLists.txt')
-rw-r--r--src/pkg/CMakeLists.txt24
1 files changed, 22 insertions, 2 deletions
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