| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
#export DH_VERBOSE = 1 |
| 4 |
export ASSET_OUT_DIR=debian/tmp |
| 5 |
|
| 6 |
include /usr/share/dpkg/pkg-info.mk |
| 7 |
|
| 8 |
# Disable lto on 32-bit arches since it OOMs otherwise |
| 9 |
execute_before_dh_auto_configure-arch: |
| 10 |
ifeq ($(DEB_HOST_ARCH_BITS),32) |
| 11 |
export DEB_BUILD_OPTIONS += optimize=-lto |
| 12 |
endif |
| 13 |
|
| 14 |
# enable on 64-bit |
| 15 |
execute_after_dh_auto_configure-arch: |
| 16 |
ifeq ($(DEB_HOST_ARCH_BITS),64) |
| 17 |
echo 'lto="fat"' >> debian/cargo_home/config.toml |
| 18 |
echo 'codegen-units=1' >> debian/cargo_home/config.toml |
| 19 |
echo 'opt-level="z"' >> debian/cargo_home/config.toml |
| 20 |
cat debian/cargo_home/config.toml |
| 21 |
endif |
| 22 |
|
| 23 |
%: |
| 24 |
dh $@ --buildsystem cargo |
| 25 |
|
| 26 |
# skip these targets on arch:all builds |
| 27 |
override_dh_auto_configure-indep: |
| 28 |
override_dh_auto_test-indep: |
| 29 |
override_dh_auto_build-indep: |
| 30 |
override_dh_auto_install-indep: |
| 31 |
dh_install |
| 32 |
|
| 33 |
override_dh_auto_install-arch: |
| 34 |
# separately, to avoid installing binaries into wrong DESTDIR |
| 35 |
dh_auto_install -p gpg-sq -- --bin gpg-sq |
| 36 |
dh_auto_install -p gpgv-sq -- --bin gpgv-sq |
| 37 |
|
| 38 |
override_dh_install-arch: |
| 39 |
mkdir -p debian/gpg-sq/usr/bin/ |
| 40 |
# compat for dh-cargo < 33, can be removed once it is in forky |
| 41 |
mv debian/*/usr/bin/gpg-sq debian/gpg-sq/usr/bin/ || true |
| 42 |
|
| 43 |
dh_install |