File: rules

package info (click to toggle)
libblkio 1.5.0-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,040 kB
  • sloc: ansic: 3,443; sh: 460; makefile: 35; python: 16
file content (63 lines) | stat: -rwxr-xr-x 2,000 bytes parent folder | download
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
#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
include /usr/share/dpkg/pkg-info.mk
ifeq (${DEB_HOST_GNU_TYPE},)
# Fast version of dpkg/architecture.mk defining all vars in one go
   $(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d))
endif

# CARGO_HOME *must* end with "/debian/cargo_home"
export CARGO_HOME=${CURDIR}/b/debian/cargo_home
export CARGO=/usr/share/cargo/bin/cargo

export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

V = $(if $(filter terse, ${DEB_BUILD_OPTIONS}),,-v)

# libblkio build system wraps cargo in meson.

build   build-arch   build-indep \
install install-arch install-indep \
binary  binary-arch  binary-indep \
: %:
	dh $@

# /usr/share/cargo/bin/cargo wrapper is stupid and broken in many ways,
# and apparently needs huge work to fix. Instead of trying to fight all
# its issues, use it only when absolutely necessary: just to set up
# the system registry and build flags.
# The rest is done using regular cargo directly.
override_dh_auto_configure:
	DEB_CARGO_CRATE=${DEB_SOURCE}_${DEB_VERSION_UPSTREAM} \
	DEB_HOST_RUST_TYPE=${DEB_HOST_GNU_TYPE} DEB_HOST_GNU_TYPE=${DEB_HOST_GNU_TYPE} \
	${CARGO} prepare-debian b/cargo-registry --link-from-system $V

	meson setup b/ --wrap-mode=nodownload --buildtype=plain \
		--prefix=/usr --sysconfdir=/etc --localstatedir=/var \
		--libdir=/usr/lib/${DEB_HOST_MULTIARCH}

override_dh_auto_build:
	meson compile -C b/ -v

override_dh_auto_test:
ifneq (,$(filter nocheck,${DEB_BUILD_OPTIONS}))
	meson test -C b/ \
		--suite generic --suite io_uring+parallel --suite examples
endif

b := libblkio.so.1
f := libblkio.so.${DEB_VERSION_UPSTREAM}
override_dh_auto_install:
	meson install -C b/ --destdir ${CURDIR}/debian/tmp

#	cd debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}; \
#	    patchelf --set-soname ${b} ${f}; \
#	    ln -sf ${f} ${b}; \
#	    ln -sf ${b} libblkio.so

# dwz: Allocatable section in libblkio.so.1.4.0 after non-allocatable ones
override_dh_dwz:

clean:
	dh_clean b/ Cargo.lock