]> git.proxmox.com Git - proxmox.git/blob - build.sh
Merge branch 'proxmox-acme'
[proxmox.git] / build.sh
1 #!/bin/sh
2
3 set -e
4
5 export CARGO=/usr/bin/cargo
6 export RUSTC=/usr/bin/rustc
7
8 CRATE=$1
9 BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
10
11 mkdir -p build
12 echo system >build/rust-toolchain
13 rm -rf "build/${CRATE}"
14
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
23 debcargo package \
24 --config "$PWD/${CRATE}/debian/debcargo.toml" \
25 --changelog-ready \
26 --no-overlay-write-back \
27 --directory "$PWD/build/${CRATE}" \
28 "${CRATE}" \
29 "$(dpkg-parsechangelog -l "${CRATE}/debian/changelog" -SVersion | sed -e 's/-.*//')"
30
31 cd "build/${CRATE}"
32 rm -f debian/source/format.debcargo.hint
33 ${BUILDCMD}
34
35 cp debian/control "$CONTROL"