Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 export DH_VERBOSE = 1
3 export RUST_BACKTRACE=full
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 include /usr/share/dpkg/vendor.mk
7
8 %:
9 dh $@ --buildsystem cargo
10
11 execute_after_dh_auto_configure:
12 ifeq ($(DEB_VENDOR),Ubuntu)
13 rm -rf debian/cargo_registry/*
14 for d in vendor/*; do \
15 ln -rs $$d debian/cargo_registry; \
16 done
17 CARGO_HOME=debian /usr/share/cargo/bin/cargo generate-lockfile --offline
18 rm -rf debian/.package-cache
19 else
20 rm -rf vendor
21 endif
22
23 # After being built with cargo this leaves a Makefile around to get everything
24 # into the right places. Run that to have files in place
25 execute_before_dh_install:
26 make install DESTDIR=debian/mdevctl
27
28 override_dh_auto_test:
29 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
30 ifeq ($(DEB_VENDOR),Ubuntu)
31 CARGO_HOME=debian /usr/share/cargo/bin/cargo test --offline
32 else
33 dh_auto_test -- test
34 endif
35 endif
36
37 execute_after_dh_auto_clean:
38 rm -f mdevctl.spec Makefile