debmaker/ressources/vaultwarden/debmaker

27 lines
742 B
Bash
Executable File

#!/bin/bash
VERSION=1.30.5
APP=vaultwarden
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
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
}