27 lines
863 B
Bash
Executable File
27 lines
863 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
cd "$ROOT"
|
|
|
|
for tool in cargo rustc dpkg-buildpackage; do
|
|
command -v "$tool" >/dev/null 2>&1 || { echo "Missing build tool: $tool" >&2; exit 2; }
|
|
done
|
|
|
|
RUSTC_VERSION=$(rustc --version | awk '{print $2}')
|
|
if ! dpkg --compare-versions "$RUSTC_VERSION" ge 1.88; then
|
|
echo "RustProxy requires rustc >= 1.88 (found $RUSTC_VERSION)" >&2
|
|
exit 2
|
|
fi
|
|
|
|
# Fetch against Cargo.lock before the Debian build. Use CARGO_NET_OFFLINE=true
|
|
# when the registry/cache has already been prepared or dependencies are vendored.
|
|
cargo fetch --locked
|
|
|
|
dpkg-buildpackage -us -uc -b
|
|
|
|
mkdir -p dist
|
|
find .. -maxdepth 1 -type f \( -name 'rustproxy_0.25.1_*.deb' -o -name 'rustproxy_0.25.1_*.changes' -o -name 'rustproxy_0.25.1_*.buildinfo' \) \
|
|
-exec cp -f {} dist/ \;
|
|
echo "Packages copied to $ROOT/dist"
|