Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/dpkg/default.mk
4 include /usr/share/rustc/architecture.mk
5 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
6 export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
7 export PATH := /usr/share/cargo/bin:$(PATH)
8 export CARGO=/usr/share/cargo/bin/cargo
9 export CARGO_HOME=$(CURDIR)/debian/cargo_home
10 export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
11 export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
12 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
13
14 %:
15 dh $@ --buildsystem=cargo --with=shell-completions
16
17 execute_after_dh_auto_clean:
18 rm -rf debian/cargo_registry debian/man debian/jujutsu.bash-completion
19
20 execute_before_dh_auto_configure:
21 $(CARGO) prepare-debian debian/cargo_registry --link-from-system
22 rm -f Cargo.lock debian/cargo-checksum.json
23 touch debian/cargo-checksum.json
24
25 override_dh_installman:
26 mkdir -p debian/man
27 ./debian/jujutsu/usr/bin/jj util install-man-pages ./debian/man
28 dh_installman ./debian/man/*/*
29
30 override_dh_installchangelogs:
31 dh_installchangelogs CHANGELOG.md
32
33 override_dh_auto_build:
34 ifeq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
35 $(CARGO) tree --workspace --color=never
36 endif
37 $(CARGO) build --release --bins
38
39 override_dh_auto_install:
40 install -D -m755 target/$(DEB_HOST_RUST_TYPE)/release/jj \
41 debian/jujutsu/usr/bin/jj
42 /usr/share/cargo/bin/dh-cargo-built-using jujutsu