1 # Copyright (c) 2019 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 if(CMAKE_CROSSCOMPILING)
18 get_cmake_property(VPP_COMPONENTS COMPONENTS)
19 string(REPLACE ";" " " VPP_COMPONENTS "${VPP_COMPONENTS}")
23 OUTPUT_VARIABLE TIMESTAMP
24 OUTPUT_STRIP_TRAILING_WHITESPACE
27 # parse /etc/os-release
28 file(READ "/etc/os-release" os_release)
29 string(REPLACE "\n" ";" os_release ${os_release})
30 foreach(l ${os_release})
31 string(REPLACE "=" ";" l ${l})
34 string(REPLACE "\"" "" _value ${_value})
35 set(OS_${_name} ${_value})
38 set(VPP_DEB_BUILD_DEPENDS "python3-all, python3-setuptools")
39 set(VPP_DEB_WITH_PYTHON2 "no")
41 foreach(f rules changelog control)
43 ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f}.in
44 ${VPP_BINARY_DIR}/debian/${f}
49 foreach(f copyright vpp.preinst vpp.postrm vpp.postinst vpp.service)
51 ${CMAKE_CURRENT_SOURCE_DIR}/debian/${f}
52 DESTINATION ${VPP_BINARY_DIR}/debian
56 file(WRITE ${VPP_BINARY_DIR}/debian/compat "10\n")
58 add_custom_target(pkg-deb
59 COMMENT "Building .deb packages..."
60 WORKING_DIRECTORY ${VPP_BINARY_DIR}
61 COMMAND "dpkg-buildpackage" "-us" "-uc" "-b"