]>
Commit | Line | Data |
---|---|---|
a94de245 FG |
1 | #!/bin/sh |
2 | ||
3 | set -e | |
4 | ||
66d117f4 WB |
5 | export CARGO=/usr/bin/cargo |
6 | export RUSTC=/usr/bin/rustc | |
7 | ||
a94de245 FG |
8 | CRATE=$1 |
9 | BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"} | |
10 | ||
11 | mkdir -p build | |
95ab7b68 | 12 | echo system >build/rust-toolchain |
a94de245 FG |
13 | rm -rf "build/${CRATE}" |
14 | ||
cce052e9 FG |
15 | CONTROL="$PWD/${CRATE}/debian/control" |
16 | ||
17 | if [ -e "$CONTROL" ]; then | |
18 | # check but only warn, debcargo fails anyway if crates are missing | |
19 | dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true | |
20 | rm -f "$PWD/${CRATE}/debian/control" | |
21 | fi | |
22 | ||
66d117f4 | 23 | debcargo package --config "$PWD/${CRATE}/debian/debcargo.toml" --changelog-ready --no-overlay-write-back --directory "$PWD/build/${CRATE}" "${CRATE}" "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')" |
a94de245 FG |
24 | cd "build/${CRATE}" |
25 | ${BUILDCMD} | |
cce052e9 FG |
26 | |
27 | cp debian/control "$CONTROL" |