blob: 1958497f5edefe5460dd93b5c745a62a08963726 [file] [log] [blame]
Damjan Marion4d2f86a2019-01-18 13:28:22 +01001#!/usr/bin/make -f
2# See debhelper(7) (uncomment to enable)
3# output every command that modifies files on the build system.
4DH_VERBOSE = 1
5
6# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
7DPKG_EXPORT_BUILDFLAGS = 1
8include /usr/share/dpkg/default.mk
9
Ole Troane4a6d692019-03-13 18:08:42 +010010export PYBUILD_NAME = vpp-api
Damjan Marion4d2f86a2019-01-18 13:28:22 +010011export PYBUILD_DIR = @CMAKE_SOURCE_DIR@/vpp-api/python
Ole Troane4a6d692019-03-13 18:08:42 +010012export PYBUILD_DESTDIR_python3=debian/python3-vpp-api/
13export PYBUILD_DISABLE_python3=test
Damjan Marion4d2f86a2019-01-18 13:28:22 +010014export PYBUILD_SYSTEM=distutils
Damjan Mariona4164932020-05-12 12:22:18 +020015DH_WITH = systemd,python3
Damjan Mariona4164932020-05-12 12:22:18 +020016
Ole Troane4a6d692019-03-13 18:08:42 +010017build3vers := $(shell py3versions -sv)
18
Damjan Marion4d2f86a2019-01-18 13:28:22 +010019# main packaging script based on dh7 syntax
20%:
Damjan Mariona4164932020-05-12 12:22:18 +020021 dh $@ --with $(DH_WITH) --buildsystem=pybuild
Damjan Marion4d2f86a2019-01-18 13:28:22 +010022
Damjan Marion4d2f86a2019-01-18 13:28:22 +010023override_dh_strip:
24 dh_strip --dbg-package=vpp-dbg
25
Damjan Marion4d2f86a2019-01-18 13:28:22 +010026override_dh_install:
Damjan Marion4686d392019-01-22 10:28:29 +010027 @for c in @VPP_COMPONENTS@; do \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010028 @CMAKE_COMMAND@ \
29 -D CMAKE_INSTALL_CONFIG_NAME=@CMAKE_BUILD_TYPE@ \
30 -D CMAKE_INSTALL_COMPONENT=$$c \
Damjan Marion88b2e362021-04-29 18:47:25 +020031 -D CMAKE_INSTALL_PREFIX=@VPP_BINARY_DIR@/debian/$$c \
Damjan Mariond734b8d2019-01-22 11:14:46 +010032 -P @CMAKE_BINARY_DIR@/cmake_install.cmake 2>&1 \
33 | grep -v 'Set runtime path of' ; \
Damjan Marionfd51e842021-10-06 12:07:04 +020034 for d in bin include share lib ; do \
Damjan Marion4686d392019-01-22 10:28:29 +010035 if [ -d debian/$$c/$$d ] ; then \
36 mkdir -p debian/$$c/usr ; \
37 mv debian/$$c/$$d debian/$$c/usr/$$d ; \
38 fi ; \
39 done ; \
40 if [ -d debian/$$c ] ; then \
41 @CMAKE_SOURCE_DIR@/scripts/remove-rpath debian/$$c ; \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010042 fi ; \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010043 done