X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=debian%2Frules;fp=debian%2Frules;h=177294571ca59f4c27e968fb93a17ac9525faf6e;hb=816f103231dc53f7afae5e2445810e6a58bcf926;hp=fd523507ca0a417387107635177daaccc694a8bf;hpb=149c9c70aaa53ab2ec37717ff331ff4765b0de63;p=bcachefs-tools-debian diff --git a/debian/rules b/debian/rules index fd52350..1772945 100755 --- a/debian/rules +++ b/debian/rules @@ -1,15 +1,20 @@ #!/usr/bin/make -f +include /usr/share/dpkg/architecture.mk +include /usr/share/rustc/architecture.mk + +export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE + export DEB_BUILD_MAINT_OPTIONS=hardening=+all -# Do not build rust code (dependencies currently unmet) -export NO_RUST=-true +export CARGO=/usr/share/cargo/bin/cargo +export CARGO_HOME=$(CURDIR)/debian/cargo_home +export DEB_CARGO_CRATE=bcachefs-tools_$(DEB_VERSION_UPSTREAM) PREFIX := /usr ROOT_SBINDIR := /usr/sbin DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) - ifeq ($(DEB_BUILD_ARCH),amd64) DEB_BUILD_MAINT_OPTIONS += optimize=-lto endif @@ -17,7 +22,20 @@ endif %: dh $@ +override_dh_auto_configure: + $(CARGO) prepare-debian $(CURDIR)/vendor --link-from-system + +override_dh_auto_build: + $(RM) Cargo.lock + dh_auto_build -- CARGO="$(CARGO)" + override_dh_auto_install: dh_auto_install -- "PREFIX=$(PREFIX)" "ROOT_SBINDIR=$(ROOT_SBINDIR)" +override_dh_auto_clean: + ! [ -d $(CURDIR)/vendor ] || $(RM) -r $(CURDIR)/vendor + ! [ -d $(CARGO_HOME) ] || $(RM) -r $(CARGO_HOME) + $(RM) Cargo.lock + dh_auto_clean + override_dh_auto_test: