Fix build for alpha versions

This commit is contained in:
Dennis Schwerdel 2020-10-09 22:46:44 +02:00
parent f824c1f44d
commit eb638efadf
4 changed files with 23 additions and 13 deletions

View File

@ -12,22 +12,21 @@ rustup target add aarch64-unknown-linux-gnu
cargo install cargo-deb cargo install cargo-deb
VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/') VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/')
DEB_VERSION=$(echo "$VERSION" | sed -e 's/-/~/g')
mkdir dist mkdir dist
cargo deb cargo deb
cp target/debian/vpncloud_${VERSION}_amd64.deb dist/vpncloud_${VERSION}_amd64.deb cp target/debian/vpncloud_${DEB_VERSION}_amd64.deb dist/vpncloud_${DEB_VERSION}_amd64.deb
# i386 deb # i386 deb
cargo deb --target i686-unknown-linux-gnu cargo deb --target i686-unknown-linux-gnu
cp target/i686-unknown-linux-gnu/debian/vpncloud_${VERSION}_i386.deb dist/vpncloud_${VERSION}_i386.deb cp target/i686-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_i386.deb dist/vpncloud_${DEB_VERSION}_i386.deb
# arm7hf deb # arm7hf deb
cargo deb --target armv7-unknown-linux-gnueabihf cargo deb --target armv7-unknown-linux-gnueabihf
cp target/armv7-unknown-linux-gnueabihf/debian/vpncloud_${VERSION}_armhf.deb dist/vpncloud_${VERSION}_armhf.deb cp target/armv7-unknown-linux-gnueabihf/debian/vpncloud_${DEB_VERSION}_armhf.deb dist/vpncloud_${DEB_VERSION}_armhf.deb
# aarch64 deb # aarch64 deb
cargo deb --target aarch64-unknown-linux-gnu cargo deb --target aarch64-unknown-linux-gnu
cp target/aarch64-unknown-linux-gnu/debian/vpncloud_${VERSION}_arm64.deb dist/vpncloud_${VERSION}_arm64.deb cp target/aarch64-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_arm64.deb dist/vpncloud_${DEB_VERSION}_arm64.debllll

View File

@ -11,9 +11,14 @@ rustup target add armv7-unknown-linux-gnueabihf
cargo install cargo-rpm cargo install cargo-rpm
VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/') VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/')
if echo "$VERSION" | fgrep -q "-"; then
RPM_VERSION=$(echo "$VERSION" | sed -e 's/-/-0./g')
else
RPM_VERSION="$VERSION-1"
fi
mkdir dist mkdir dist
cargo build --release cargo build --release
cargo rpm build cargo rpm build
cp target/release/rpmbuild/RPMS/x86_64/vpncloud-${VERSION}-1.x86_64.rpm dist/vpncloud_${VERSION}.x86_64.rpm cp target/release/rpmbuild/RPMS/x86_64/vpncloud-${RPM_VERSION}.x86_64.rpm dist/vpncloud_${RPM_VERSION}.x86_64.rpm

View File

@ -5,7 +5,7 @@
Name: vpncloud Name: vpncloud
Summary: Peer-to-peer VPN Summary: Peer-to-peer VPN
Version: @@VERSION@@ Version: @@VERSION@@
Release: 1 Release: @@RELEASE@@
License: GPL-3.0 License: GPL-3.0
Group: Applications/System Group: Applications/System
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz

View File

@ -17,6 +17,12 @@ set -e
cd $(dirname $0) cd $(dirname $0)
VERSION=$(grep -e '^version =' ../Cargo.toml | sed -e 's/version = "\(.*\)"/\1/') VERSION=$(grep -e '^version =' ../Cargo.toml | sed -e 's/version = "\(.*\)"/\1/')
DEB_VERSION=$(echo "$VERSION" | sed -e 's/-/~/g')
if echo "$VERSION" | fgrep -q "-"; then
RPM_VERSION=$(echo "$VERSION" | sed -e 's/-/-0./g')
else
RPM_VERSION="$VERSION-1"
fi
mkdir -p cache/{rpm,deb} mkdir -p cache/{rpm,deb}
CACHE=$(pwd)/cache CACHE=$(pwd)/cache
@ -27,23 +33,23 @@ docker build --rm -f=Dockerfile-deb -t vpncloud-builder-deb .
# x86_64 deb # x86_64 deb
docker_cmd deb 'cd code && cargo deb' docker_cmd deb 'cd code && cargo deb'
cp $CACHE/deb/target/debian/vpncloud_${VERSION}_amd64.deb ../dist/vpncloud_${VERSION}_amd64.deb cp $CACHE/deb/target/debian/vpncloud_${DEB_VERSION}_amd64.deb ../dist/vpncloud_${DEB_VERSION}_amd64.deb
# i386 deb # i386 deb
docker_cmd deb 'cd code && cargo deb --target i686-unknown-linux-gnu' docker_cmd deb 'cd code && cargo deb --target i686-unknown-linux-gnu'
cp $CACHE/deb/target/i686-unknown-linux-gnu/debian/vpncloud_${VERSION}_i386.deb ../dist/vpncloud_${VERSION}_i386.deb cp $CACHE/deb/target/i686-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_i386.deb ../dist/vpncloud_${DEB_VERSION}_i386.deb
# arm7hf deb # arm7hf deb
docker_cmd deb 'cd code && cargo deb --target armv7-unknown-linux-gnueabihf' docker_cmd deb 'cd code && cargo deb --target armv7-unknown-linux-gnueabihf'
cp $CACHE/deb/target/armv7-unknown-linux-gnueabihf/debian/vpncloud_${VERSION}_armhf.deb ../dist/vpncloud_${VERSION}_armhf.deb cp $CACHE/deb/target/armv7-unknown-linux-gnueabihf/debian/vpncloud_${DEB_VERSION}_armhf.deb ../dist/vpncloud_${DEB_VERSION}_armhf.deb
# aarch64 deb # aarch64 deb
docker_cmd deb 'cd code && cargo deb --target aarch64-unknown-linux-gnu' docker_cmd deb 'cd code && cargo deb --target aarch64-unknown-linux-gnu'
cp $CACHE/deb/target/aarch64-unknown-linux-gnu/debian/vpncloud_${VERSION}_arm64.deb ../dist/vpncloud_${VERSION}_arm64.deb cp $CACHE/deb/target/aarch64-unknown-linux-gnu/debian/vpncloud_${DEB_VERSION}_arm64.deb ../dist/vpncloud_${DEB_VERSION}_arm64.deb
docker build --rm -f=Dockerfile-rpm -t vpncloud-builder-rpm . docker build --rm -f=Dockerfile-rpm -t vpncloud-builder-rpm .
# x86_64 rpm # x86_64 rpm
docker_cmd rpm 'cd code && cargo rpm build' docker_cmd rpm 'cd code && cargo rpm build'
cp $CACHE/rpm/target/release/rpmbuild/RPMS/x86_64/vpncloud-${VERSION}-1.x86_64.rpm ../dist/vpncloud_${VERSION}.x86_64.rpm cp $CACHE/rpm/target/release/rpmbuild/RPMS/x86_64/vpncloud-${RPM_VERSION}.x86_64.rpm ../dist/vpncloud_${RPM_VERSION}.x86_64.rpm