blob: f09db38e2a1b742df7152cc76f9af3cbeaf4b1fb [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 +020015ifeq (@VPP_DEB_WITH_PYTHON2@,yes)
16export PYBUILD_DESTDIR_python2=debian/vpp-api-python/
17export PYBUILD_DISABLE_python2=test
Ole Troane4a6d692019-03-13 18:08:42 +010018buildvers := $(shell pyversions -sv)
Damjan Mariona4164932020-05-12 12:22:18 +020019DH_WITH = systemd,python2,python3
20else
21DH_WITH = systemd,python3
22endif
23
Ole Troane4a6d692019-03-13 18:08:42 +010024build3vers := $(shell py3versions -sv)
25
Damjan Marion4d2f86a2019-01-18 13:28:22 +010026# main packaging script based on dh7 syntax
27%:
Damjan Mariona4164932020-05-12 12:22:18 +020028 dh $@ --with $(DH_WITH) --buildsystem=pybuild
Damjan Marion4d2f86a2019-01-18 13:28:22 +010029
Damjan Marion4d2f86a2019-01-18 13:28:22 +010030override_dh_strip:
31 dh_strip --dbg-package=vpp-dbg
32
33DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
34
35override_dh_install:
Damjan Marion4686d392019-01-22 10:28:29 +010036 @for c in @VPP_COMPONENTS@; do \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010037 @CMAKE_COMMAND@ \
38 -D CMAKE_INSTALL_CONFIG_NAME=@CMAKE_BUILD_TYPE@ \
39 -D CMAKE_INSTALL_COMPONENT=$$c \
40 -D CMAKE_INSTALL_PREFIX=@CMAKE_BINARY_DIR@/debian/$$c \
Damjan Mariond734b8d2019-01-22 11:14:46 +010041 -P @CMAKE_BINARY_DIR@/cmake_install.cmake 2>&1 \
42 | grep -v 'Set runtime path of' ; \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010043 if [ -d debian/$$c/lib ] ; then \
44 mv debian/$$c/lib debian/$$c/$(DEB_HOST_MULTIARCH) ; \
45 mkdir -p debian/$$c/usr/lib ; \
46 mv debian/$$c/$(DEB_HOST_MULTIARCH) debian/$$c/usr/lib ; \
47 fi ; \
Damjan Marion4686d392019-01-22 10:28:29 +010048 for d in bin include share ; do \
49 if [ -d debian/$$c/$$d ] ; then \
50 mkdir -p debian/$$c/usr ; \
51 mv debian/$$c/$$d debian/$$c/usr/$$d ; \
52 fi ; \
53 done ; \
54 if [ -d debian/$$c ] ; then \
55 @CMAKE_SOURCE_DIR@/scripts/remove-rpath debian/$$c ; \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010056 fi ; \
Damjan Marion4d2f86a2019-01-18 13:28:22 +010057 done