]> git.proxmox.com Git - pve-lxc-syscalld.git/blob - debian/rules
buildsys: cleanup, derive upload dist, drop debcargo usage
[pve-lxc-syscalld.git] / debian / rules
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 include /usr/share/dpkg/pkg-info.mk
7 include /usr/share/rustc/architecture.mk
8
9 export BUILD_MODE=release
10
11 CARGO=/usr/share/cargo/bin/cargo
12
13 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
14 export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
15 export CARGO_HOME = $(CURDIR)/debian/cargo_home
16
17 export DEB_CARGO_CRATE=pve-lxc-syscalld_$(DEB_VERSION_UPSTREAM)
18 export DEB_CARGO_PACKAGE=pve-lxc-syscalld
19
20 %:
21 dh $@
22
23 override_dh_auto_configure:
24 @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \
25 die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml
26 $(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system
27 dh_auto_configure
28
29 override_dh_missing:
30 dh_missing --fail-missing
31
32 override_dh_auto_build:
33 dh_auto_build -- \
34 LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
35
36 override_dh_auto_install:
37 dh_auto_install -- \
38 LIBEXECDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
39
40 #override_dh_installinit:
41 # dh_installinit
42 # dh_installinit --name pve-lxc-syscalld
43
44 # # workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933541
45 # # TODO: remove once available (Debian 11 ?)
46 # override_dh_dwz:
47 # dh_dwz --no-dwz-multifile