Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | # See debhelper(7) (uncomment to enable) |
| 3 | # output every command that modifies files on the build system. |
| 4 | DH_VERBOSE = 1 |
| 5 | |
| 6 | # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* |
| 7 | DPKG_EXPORT_BUILDFLAGS = 1 |
| 8 | include /usr/share/dpkg/default.mk |
| 9 | |
Ole Troan | e4a6d69 | 2019-03-13 18:08:42 +0100 | [diff] [blame] | 10 | export PYBUILD_NAME = vpp-api |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 11 | export PYBUILD_DIR = @CMAKE_SOURCE_DIR@/vpp-api/python |
Ole Troan | e4a6d69 | 2019-03-13 18:08:42 +0100 | [diff] [blame] | 12 | export PYBUILD_DESTDIR_python3=debian/python3-vpp-api/ |
| 13 | export PYBUILD_DISABLE_python3=test |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 14 | export PYBUILD_SYSTEM=distutils |
Damjan Marion | a416493 | 2020-05-12 12:22:18 +0200 | [diff] [blame] | 15 | DH_WITH = systemd,python3 |
Damjan Marion | a416493 | 2020-05-12 12:22:18 +0200 | [diff] [blame] | 16 | |
Ole Troan | e4a6d69 | 2019-03-13 18:08:42 +0100 | [diff] [blame] | 17 | build3vers := $(shell py3versions -sv) |
| 18 | |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 19 | # main packaging script based on dh7 syntax |
| 20 | %: |
Damjan Marion | a416493 | 2020-05-12 12:22:18 +0200 | [diff] [blame] | 21 | dh $@ --with $(DH_WITH) --buildsystem=pybuild |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 22 | |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 23 | override_dh_strip: |
| 24 | dh_strip --dbg-package=vpp-dbg |
| 25 | |
| 26 | DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 27 | |
| 28 | override_dh_install: |
Damjan Marion | 4686d39 | 2019-01-22 10:28:29 +0100 | [diff] [blame] | 29 | @for c in @VPP_COMPONENTS@; do \ |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 30 | @CMAKE_COMMAND@ \ |
| 31 | -D CMAKE_INSTALL_CONFIG_NAME=@CMAKE_BUILD_TYPE@ \ |
| 32 | -D CMAKE_INSTALL_COMPONENT=$$c \ |
| 33 | -D CMAKE_INSTALL_PREFIX=@CMAKE_BINARY_DIR@/debian/$$c \ |
Damjan Marion | d734b8d | 2019-01-22 11:14:46 +0100 | [diff] [blame] | 34 | -P @CMAKE_BINARY_DIR@/cmake_install.cmake 2>&1 \ |
| 35 | | grep -v 'Set runtime path of' ; \ |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 36 | if [ -d debian/$$c/lib ] ; then \ |
| 37 | mv debian/$$c/lib debian/$$c/$(DEB_HOST_MULTIARCH) ; \ |
| 38 | mkdir -p debian/$$c/usr/lib ; \ |
| 39 | mv debian/$$c/$(DEB_HOST_MULTIARCH) debian/$$c/usr/lib ; \ |
| 40 | fi ; \ |
Damjan Marion | 4686d39 | 2019-01-22 10:28:29 +0100 | [diff] [blame] | 41 | for d in bin include share ; do \ |
| 42 | if [ -d debian/$$c/$$d ] ; then \ |
| 43 | mkdir -p debian/$$c/usr ; \ |
| 44 | mv debian/$$c/$$d debian/$$c/usr/$$d ; \ |
| 45 | fi ; \ |
| 46 | done ; \ |
| 47 | if [ -d debian/$$c ] ; then \ |
| 48 | @CMAKE_SOURCE_DIR@/scripts/remove-rpath debian/$$c ; \ |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 49 | fi ; \ |
Damjan Marion | 4d2f86a | 2019-01-18 13:28:22 +0100 | [diff] [blame] | 50 | done |