2022-05-16 11:52:48 -04:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
ARCH=$1
|
|
|
|
CARGO_ARCH=$2
|
2024-07-14 18:22:50 -04:00
|
|
|
IS_NIGHTLY=$3
|
|
|
|
BUILD_DATE=$(date '+%Y%m%d')
|
2022-05-16 11:52:48 -04:00
|
|
|
CARGO_VERSION="$(/veilid/package/cargo_version.sh /veilid/veilid-cli/Cargo.toml)"
|
|
|
|
rm -rf /dpkg
|
|
|
|
mkdir -p /dpkg/out
|
|
|
|
|
|
|
|
# veilid-cli dpkg control
|
2024-07-17 16:18:59 -04:00
|
|
|
cp -rf /veilid/package/debian/veilid-cli /dpkg
|
|
|
|
# Appropriatly set vars for STABLE or NIGHTLY release
|
2024-07-17 12:17:54 -04:00
|
|
|
if [ "$3" = "true" ]
|
|
|
|
then
|
|
|
|
/veilid/package/replace_variable.sh /dpkg/veilid-cli/DEBIAN/control CARGO_VERSION $BUILD_DATE
|
|
|
|
elif [ "$3" = "false" ]
|
|
|
|
then
|
|
|
|
/veilid/package/replace_variable.sh /dpkg/veilid-cli/DEBIAN/control CARGO_VERSION $CARGO_VERSION
|
|
|
|
else
|
|
|
|
echo $3 "is not a valid state to determine if the build is STABLE or NIGHTLY"
|
|
|
|
fi
|
2022-05-16 11:52:48 -04:00
|
|
|
/veilid/package/replace_variable.sh /dpkg/veilid-cli/DEBIAN/control ARCH $ARCH
|
|
|
|
# veilid-cli executable
|
|
|
|
mkdir -p /dpkg/veilid-cli/usr/bin
|
|
|
|
cp -f /veilid/target/$CARGO_ARCH/release/veilid-cli /dpkg/veilid-cli/usr/bin
|
|
|
|
# pack it up
|
|
|
|
dpkg-deb -b /dpkg/veilid-cli/
|
2024-07-14 18:22:50 -04:00
|
|
|
# Appropriatly name the package for STABLE or NIGHTLY release
|
2024-07-14 20:15:09 -04:00
|
|
|
if [ "$3" = "true" ]
|
2024-07-14 18:22:50 -04:00
|
|
|
then
|
|
|
|
mv /dpkg/veilid-cli.deb /dpkg/out/veilid-cli-$BUILD_DATE\_$ARCH.deb
|
2024-07-14 20:15:09 -04:00
|
|
|
elif [ "$3" = "false" ]
|
2024-07-14 18:22:50 -04:00
|
|
|
then
|
|
|
|
mv /dpkg/veilid-cli.deb /dpkg/out/veilid-cli-$CARGO_VERSION\_$ARCH.deb
|
|
|
|
else
|
|
|
|
echo $3 "is not a valid state to determine if the build is STABLE or NIGHTLY"
|
2024-07-17 16:18:59 -04:00
|
|
|
fi
|
|
|
|
echo "make veilid-cli deb process complete"
|