debmaker/ressources/vaultwarden/vaultwarden

36 lines
818 B
Plaintext
Raw Normal View History

2022-02-12 18:30:28 +01:00
#!/bin/bash
2022-02-20 15:02:18 +01:00
STEP="envinit prebuild build makedeb"
2022-02-12 18:30:28 +01:00
envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates libmariadb-dev libpq-dev pkg-config libmysql++-dev
cd /tmp
wget -qO - https://sh.rustup.rs > rustup
bash rustup -qy
apt clean
}
prebuild(){
VERSION=$1
cd /tmp/
git clone https://github.com/dani-garcia/vaultwarden.git
cd vaultwarden/
git checkout $VERSION
}
build() {
cd /tmp/vaultwarden/
source ~/.cargo/env
cargo build --features sqlite,mysql,postgresql --release
}
makedeb(){
2022-02-20 15:02:18 +01:00
GIT_VERSION=$1
DEB_VERSION=$2
PATH_DEB=/tmp/dist/rootfs
2022-02-12 18:30:28 +01:00
2022-02-20 15:02:18 +01:00
cp -fr /tmp/vaultwarden/target/release/vaultwarden ${PATH_DEB}/usr/lib/vaultwarden/
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
2022-02-12 18:30:28 +01:00
}