debmaker/ressources/rustdesk-server/debmaker

38 lines
982 B
Bash
Executable File

#!/bin/bash
APP=rustdesk-server
VERSION=1.1.8
GIT_VERSION=$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=5
DEPOT=https://github.com/rustdesk/rustdesk-server.git
PACKAGE_DEPENDENCY="build-essential"
main() {
base_package_upgrade
install_package_dependency
install_rust
get_git_source
build
makedeb
}
build() {
cd /tmp/${APP}
source ~/.cargo/env
cargo build --release
}
makedeb(){
PATH_DEB=/tmp/src/rustdesk-server-hbbs
cp -fr //tmp/rustdesk-server/target/release/hbbs ${PATH_DEB}/usr/bin/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
PATH_DEB=/tmp/src/rustdesk-server-hbbr
cp -fr //tmp/rustdesk-server/target/release/hbbr ${PATH_DEB}/usr/bin/
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}