| 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 |
--without single-binary |
| 17 |
|
| 18 |
execute_after_dh_auto_clean: |
| 19 |
rm -rf debian/cargo_registry debian/man debian/jujutsu.bash-completion |
| 20 |
|
| 21 |
execute_before_dh_auto_configure: |
| 22 |
$(CARGO) prepare-debian debian/cargo_registry --link-from-system |
| 23 |
rm -f Cargo.lock debian/cargo-checksum.json |
| 24 |
touch debian/cargo-checksum.json |
| 25 |
|
| 26 |
override_dh_installman: |
| 27 |
mkdir -p debian/man |
| 28 |
./debian/jujutsu/usr/bin/jj util install-man-pages ./debian/man |
| 29 |
dh_installman ./debian/man/*/* |
| 30 |
|
| 31 |
override_dh_auto_build: |
| 32 |
ifeq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),) |
| 33 |
$(CARGO) tree --workspace --color=never |
| 34 |
endif |
| 35 |
$(CARGO) build --release --bins |
| 36 |
|
| 37 |
override_dh_auto_install: |
| 38 |
install -D -m755 target/$(DEB_HOST_RUST_TYPE)/release/jj \ |
| 39 |
debian/jujutsu/usr/bin/jj |
| 40 |
/usr/share/cargo/bin/dh-cargo-built-using jujutsu |
| 41 |
|