]> git.proxmox.com Git - cargo.git/blob - debian/rules
refresh patches, rm Cargo.lock
[cargo.git] / debian / rules
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/pkg-info.mk
4 include /usr/share/dpkg/architecture.mk
5 include /usr/share/dpkg/buildflags.mk
6 include /usr/share/rustc/architecture.mk
7
8 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
9 export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
10
11 CARGO = $(CURDIR)/debian/bin/cargo
12
13 export CARGO_HOME = $(CURDIR)/debian/cargo_home
14 export DEB_CARGO_CRATE=cargo_$(DEB_VERSION_UPSTREAM)
15 export RUSTFLAGS += --remap-path-prefix=$(CURDIR)=/usr/src/cargo-$(DEB_VERSION_UPSTREAM)
16
17 # don't shrink, this can take ages
18 # see https://github.com/rust-lang/cargo/issues/6490 for details
19 export PROPTEST_MAX_SHRINK_ITERS = 0
20 export CARGO_TEST_SLOW_CPU_MULTIPLIER = 4
21
22 # To run a specific test, run something like:
23 # $ debian/rules override_dh_auto_test-arch \
24 # CARGO_TEST_FLAGS="package::include -- <args ...>"
25 # See `cargo test --help` for more options.
26 CARGO_TEST_FLAGS =
27
28 %:
29 dh $@ --with bash-completion
30
31 override_dh_auto_configure:
32 $(CARGO) prepare-debian $(CURDIR)/vendor
33
34 override_dh_auto_build-arch:
35 $(CARGO) build
36
37 override_dh_auto_build-indep:
38 $(CARGO) doc
39
40 override_dh_auto_test-arch:
41 CFG_DISABLE_CROSS_TESTS=1 $(CARGO) test $(CARGO_TEST_FLAGS)
42
43 override_dh_auto_test-indep:
44 # no arch-indep tests
45
46 override_dh_auto_install:
47 DESTDIR=$(CURDIR)/debian/cargo $(CARGO) install
48
49 override_dh_auto_clean:
50 $(CARGO) clean
51
52 override_dh_clean:
53 # Upstream contains a lot of these
54 dh_clean -XCargo.toml.orig
55 rm -f Cargo.lock