1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
COHERENT_DMA_ARCHS = amd64 arm64 i386 ia64 powerpc powerpcspe ppc64 ppc64el s390x sparc64 x32
dh_params = --with python3 --builddirectory=build-deb
%:
dh $@ $(dh_params)
override_dh_auto_clean:
dh_auto_clean
rm -rf build-deb
for package in ibverbs-providers libibverbs-dev rdma-core; do \
test ! -e debian/$$package.install.backup || mv debian/$$package.install.backup debian/$$package.install; \
done
# Upstream wishes to use CMAKE_BUILD_TYPE=Release, and ensures that has a
# sensible basis of options (eg no -O3, including -g). Debian specific options
# come from CFLAGS as usual.
#
# Upstream encourages the use of Ninja to build the source, convince dh to use
# it until someone writes native support for dh+cmake+ninja.
DH_AUTO_CONFIGURE := "--" \
"-GNinja" \
"-DDISTRO_FLAVOUR=Debian" \
"-DCMAKE_BUILD_TYPE=Release" \
"-DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc" \
"-DCMAKE_INSTALL_SYSTEMD_SERVICEDIR:PATH=/lib/systemd/system" \
"-DCMAKE_INSTALL_INITDDIR:PATH=/etc/init.d" \
"-DCMAKE_INSTALL_LIBEXECDIR:PATH=/usr/lib" \
"-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=/var/lib" \
"-DCMAKE_INSTALL_RUNDIR:PATH=/run" \
"-DCMAKE_INSTALL_UDEV_RULESDIR:PATH=/lib/udev/rules.d" \
"-DCMAKE_INSTALL_PERLDIR:PATH=/usr/share/perl5" \
"-DENABLE_STATIC=1" \
$(EXTRA_CMAKE_FLAGS)
override_dh_auto_configure:
if [ -e /usr/bin/python3 ]; then \
dh_auto_configure $(DH_AUTO_CONFIGURE) \
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python3 \
-DCMAKE_INSTALL_PYTHON_ARCH_LIB:PATH=/usr/lib/python3/dist-packages; \
else \
dh_auto_configure $(DH_AUTO_CONFIGURE) \
-DNO_PYVERBS=1; \
fi
override_dh_auto_build:
ninja -C build-deb -v
# upstream does not ship test cases
override_dh_auto_test:
override_dh_auto_install:
# Some providers are disabled on architectures that are not able to do coherent DMA
ifneq (,$(filter-out $(COHERENT_DMA_ARCHS),$(DEB_HOST_ARCH)))
for package in ibverbs-providers libibverbs-dev rdma-core; do \
test -e debian/$$package.install.backup || cp debian/$$package.install debian/$$package.install.backup; \
done
sed -i '/efa\|mlx[45]/d' debian/ibverbs-providers.install debian/libibverbs-dev.install debian/rdma-core.install
endif
DESTDIR=$(CURDIR)/debian/tmp ninja -C build-deb install
# The following files are not used on Debian (we ship our own sysvinit script)
INST_EXCLUDE := "etc/init.d/srpd" \
"etc/init.d/ibacm" \
"usr/sbin/run_srp_daemon" \
"usr/sbin/srp_daemon.sh"
INST_EXCLUDE := $(addprefix -X,$(INST_EXCLUDE))
override_dh_install:
if [ -e build-deb/python/pyverbs/__init__.py ]; then \
dh_install $(INST_EXCLUDE); \
else \
dh_install -Npython3-pyverbs $(INST_EXCLUDE) --remaining-packages; \
fi
override_dh_missing:
dh_missing --fail-missing $(INST_EXCLUDE)
# cmake installs the correct init scripts in the correct place, just setup the
# pre-postrms
override_dh_installinit:
dh_installinit -prdma-core --onlyscripts --name=iwpmd
dh_installinit --remaining-packages
override_dh_installsystemd:
dh_installsystemd -pibacm --no-start ibacm.service
dh_installsystemd -pibacm ibacm.socket
dh_installsystemd --remaining-packages
# Provider plugin libaries are not shared libraries and do not belong in the
# shlibs file.
# librspreload is a LD_PRELOAD library and does not belong in the shlib files
SHLIBS_EXCLUDE = "/libibverbs/" "librspreload" "/ibacm/"
SHLIBS_EXCLUDE := $(addprefix --exclude=,$(SHLIBS_EXCLUDE))
override_dh_makeshlibs:
dh_makeshlibs $(SHLIBS_EXCLUDE)
# Upstream encourages the use of 'build' as the developer build output
# directory, allow that directory to be present and still allow dh to work.
.PHONY: build
build:
dh $@ $(dh_params)
|