1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/usr/bin/make -f
# resolve crate version
# * get topmost version except prerelease suffix
# from Cargo.toml file in dir passed as argument
# * source package version if matching upstream part modulo prerelease
# * otherwise append source package version
crate_version = \
$(shell perl -n \
-E '/^version\W+\K\d+\.\d+\.\d+/ ' \
-E 'and say "$(DEB_VERSION_UPSTREAM)" =~ /^\Q$$&\E(?:~[a-z]+\d*)?$$/ ? "$(DEB_VERSION)" : "$$&+$(DEB_VERSION_UPSTREAM_REVISION)" and exit' \
$1/Cargo.toml)
%:
dh $@
# cargo-clean only with workspace patch applied
override_dh_auto_clean:
grep -qv 'workspace' Cargo.toml || dh_auto_clean --buildsystem rust
override_dh_gencontrol:
dh_gencontrol -- \
-Vrust:Version:librust-asn1-rs-derive-dev='$(call crate_version,derive)' \
-Vrust:Version:librust-asn1-rs-impl-dev='$(call crate_version,impl)'
|