2020-04-17 20:06:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST}
|
|
|
|
source $HOME/.cargo/env
|
|
|
|
|
|
|
|
rustup target add i686-unknown-linux-gnu
|
|
|
|
rustup target add armv7-unknown-linux-gnueabihf
|
|
|
|
rustup target add aarch64-unknown-linux-gnu
|
|
|
|
|
|
|
|
cargo install cargo-deb
|
|
|
|
|
|
|
|
VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/')
|
2020-10-09 20:46:44 +00:00
|
|
|
DEB_VERSION=$(echo "$VERSION" | sed -e 's/-/~/g')
|
2020-04-17 20:06:09 +00:00
|
|
|
|
|
|
|
mkdir dist
|
|
|
|
|
|
|
|
cargo deb
|
2020-10-09 20:46:44 +00:00
|
|
|
cp target/debian/vpncloud_${DEB_VERSION}_amd64.deb dist/vpncloud_${DEB_VERSION}_amd64.deb
|
2020-04-17 20:06:09 +00:00
|
|
|
|
|
|
|
# i386 deb
|
|
|
|
cargo deb --target i686-unknown-linux-gnu
|
2020-10-09 20:46:44 +00:00
|
|
|
cp target/i686-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_i386.deb dist/vpncloud_${DEB_VERSION}_i386.deb
|
2020-04-17 20:06:09 +00:00
|
|
|
|
|
|
|
# arm7hf deb
|
|
|
|
cargo deb --target armv7-unknown-linux-gnueabihf
|
2020-10-09 20:46:44 +00:00
|
|
|
cp target/armv7-unknown-linux-gnueabihf/debian/vpncloud_${DEB_VERSION}_armhf.deb dist/vpncloud_${DEB_VERSION}_armhf.deb
|
2020-04-17 20:06:09 +00:00
|
|
|
|
|
|
|
# aarch64 deb
|
|
|
|
cargo deb --target aarch64-unknown-linux-gnu
|
2020-10-09 20:46:44 +00:00
|
|
|
cp target/aarch64-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_arm64.deb dist/vpncloud_${DEB_VERSION}_arm64.debllll
|