proxmox-ve-rs/build.sh
Stefan Hanreich f41170ba15 debian: add files for packaging
Since we now have a standalone repository for Proxmox VE related
crates, add the required files for packaging the crates contained in
this repository.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2024-11-12 19:37:36 +01:00

36 lines
836 B
Bash
Executable File

#!/bin/sh
set -eux
export CARGO=/usr/bin/cargo
export RUSTC=/usr/bin/rustc
CRATE=$1
BUILDCMD=${BUILDCMD:-"dpkg-buildpackage -b -uc -us"}
mkdir -p build
echo system >build/rust-toolchain
rm -rf "build/${CRATE}"
CONTROL="$PWD/${CRATE}/debian/control"
if [ -e "$CONTROL" ]; then
# check but only warn, debcargo fails anyway if crates are missing
dpkg-checkbuilddeps $PWD/${CRATE}/debian/control || true
# rm -f "$PWD/${CRATE}/debian/control"
fi
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/-.*//')"
cd "build/${CRATE}"
rm -f debian/source/format.debcargo.hint
${BUILDCMD}
cp debian/control "$CONTROL"