56 lines
1.5 KiB
Bash
Executable File
56 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
[ -e ./lib/function.sh ] && source ./lib/function.sh
|
|
|
|
APP=rustdesk-server
|
|
VERSION=1.1.5-1
|
|
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
|
|
|
|
STEP="envinit prebuild build makedeb"
|
|
|
|
envinit() {
|
|
apt-get update
|
|
apt-get dist-upgrade -y
|
|
apt install -y --no-install-recommends wget fakeroot dpkg ca-certificates build-essential git
|
|
apt clean
|
|
}
|
|
|
|
STEP="envinit prebuild build makedeb"
|
|
|
|
envinit() {
|
|
apt-get update
|
|
apt-get dist-upgrade -y
|
|
apt install -y --no-install-recommends build-essential git wget fakeroot dpkg ca-certificates
|
|
cd /tmp
|
|
wget -qO - https://sh.rustup.rs > rustup
|
|
bash rustup -qy
|
|
apt clean
|
|
}
|
|
|
|
prebuild(){
|
|
[ -e /tmp/${APP} ] && rm -fr /tmp/${APP}
|
|
git clone --depth 1 ${DEPOT} /tmp/${APP}
|
|
}
|
|
|
|
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
|
|
}
|