]> git.proxmox.com Git - proxmox.git/blame - build.sh
tfa: make 'anyhow' optional, enable with the 'api' feature
[proxmox.git] / build.sh
CommitLineData
a94de245
FG
1#!/bin/sh
2
3set -e
4
66d117f4
WB
5export CARGO=/usr/bin/cargo
6export RUSTC=/usr/bin/rustc
7
a94de245
FG
8CRATE=$1
9BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
10
11mkdir -p build
95ab7b68 12echo system >build/rust-toolchain
a94de245
FG
13rm -rf "build/${CRATE}"
14
cce052e9
FG
15CONTROL="$PWD/${CRATE}/debian/control"
16
17if [ -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"
21fi
22
66d117f4 23debcargo 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
24cd "build/${CRATE}"
25${BUILDCMD}
cce052e9
FG
26
27cp debian/control "$CONTROL"