f1917e6ea0a6b8cb557beb7b56d1df12e6196afd
[vpp.git] / src / pkg / debian / rules.in
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
10 export PYBUILD_NAME = vpp-api-python
11 export PYBUILD_DIR = @CMAKE_SOURCE_DIR@/vpp-api/python
12 export PYBUILD_DESTDIR_python2=debian/vpp-api-python/
13 export PYBUILD_DISABLE_python2=test
14 export PYBUILD_SYSTEM=distutils
15
16 # main packaging script based on dh7 syntax
17 %:
18         dh $@ --with systemd,python2 --buildsystem=pybuild
19
20 override_dh_strip:
21         dh_strip --dbg-package=vpp-dbg
22
23 DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
24
25 override_dh_install:
26         @for c in @VPP_COMPONENTS@; do \
27           @CMAKE_COMMAND@ \
28             -D CMAKE_INSTALL_CONFIG_NAME=@CMAKE_BUILD_TYPE@ \
29             -D CMAKE_INSTALL_COMPONENT=$$c \
30             -D CMAKE_INSTALL_PREFIX=@CMAKE_BINARY_DIR@/debian/$$c \
31             -P @CMAKE_BINARY_DIR@/cmake_install.cmake ; \
32           if [ -d debian/$$c/lib ] ; then \
33             mv debian/$$c/lib debian/$$c/$(DEB_HOST_MULTIARCH) ; \
34             mkdir -p debian/$$c/usr/lib ; \
35             mv debian/$$c/$(DEB_HOST_MULTIARCH) debian/$$c/usr/lib ; \
36           fi ; \
37           for d in bin include share ; do \
38             if [ -d debian/$$c/$$d ] ; then \
39               mkdir -p debian/$$c/usr ; \
40               mv debian/$$c/$$d debian/$$c/usr/$$d ; \
41             fi ; \
42           done ; \
43           if [ -d debian/$$c ] ; then \
44             @CMAKE_SOURCE_DIR@/scripts/remove-rpath debian/$$c ; \
45           fi ; \
46         done