debmaker/ressources/vaultwarden/debmaker
2023-01-01 23:02:32 +01:00

26 lines
742 B
Bash
Executable file

#!/bin/bash
VERSION=1.27.0
APP=vaultwarden
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=8
DEPOT=https://github.com/dani-garcia/vaultwarden.git
PACKAGE_DEPENDENCY="build-essential libmariadb-dev libpq-dev pkg-config libmysql++-dev"
STEP="base_package_upgrade install_package_dependency install_rust default_prebuild build makedeb"
build() {
cd /tmp/${APP}
source ~/.cargo/env
cargo build --features sqlite,mysql,postgresql --release
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp -fr /tmp/${APP}/target/release/vaultwarden ${PATH_DEB}/usr/lib/vaultwarden/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}