Debian Codegraph @

debian/rules

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