Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # resolve DEB_VERSION DEB_VERSION_UPSTREAM DEB_VERSION_UPSTREAM_REVISION
4 include /usr/share/dpkg/pkg-info.mk
5
6 # resolve crate version
7 # * get topmost version except prerelease suffix
8 # from Cargo.toml file in dir passed as argument
9 # * source package version if matching upstream part modulo prerelease
10 # * otherwise append source package version
11 crate_version = \
12 $(shell perl -n \
13 -E '/version\W+\K\d+\.\d+\.\d+/ ' \
14 -E 'and say "$(DEB_VERSION_UPSTREAM)" =~ /^\Q$$&\E(?:~[a-z]+\d*)?$$/ ? "$(DEB_VERSION)" : "$$&+$(DEB_VERSION_UPSTREAM_REVISION)" and exit' \
15 $1/Cargo.toml)
16
17 %:
18 dh $@
19
20 # declare version for virtually provided embedded crates
21 packages = $(patsubst %,librust-%-dev,\
22 peg peg-macros peg-runtime)
23 override_dh_gencontrol:
24 $(eval librust-peg-dev_version = $(call crate_version,.))\
25 $(eval librust-peg-macros-dev_version = $(call crate_version,peg-macros))\
26 $(eval librust-peg-runtime-dev_version = $(call crate_version,peg-runtime))\
27 set -e; $(foreach p,$(packages),\
28 dh_gencontrol -p$p -- \
29 -v'$($p_version)' \
30 $(foreach q,$(filter-out $p,$(packages)),\
31 -V'rust:Version:$q=$($q_version)');)
32 dh_gencontrol --remaining-packages