debmaker/ressources/gotify/debmaker

47 lines
962 B
Bash
Executable File

#!/bin/bash
APP=gotify
VERSION=2.4.0
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=6
DEPOT=https://github.com/gotify/server.git
PACKAGE_DEPENDENCY="build-essential nodejs yarn"
main(){
base_package_upgrade
envinit
get_git_source
build
makedeb
}
envinit() {
configure_depot_yarn
configure_depot_nodejs
install_package_dependency
install_go
}
build() {
cd /tmp/${APP}
PATH=${PATH}:/usr/local/go/bin
export GO111MODULE=on
make download-tools
go get -d
(cd ui && yarn && yarn build)
go run hack/packr/packr.go
go build -ldflags="$LD_FLAGS" -o gotify-server
}
makedeb(){
PATH_DEB=/tmp/src/rootfs
cp /tmp/${APP}/gotify-server ${PATH_DEB}/usr/bin/
chmod +x ${PATH_DEB}/usr/bin/gotify-server
cp /tmp/${APP}/config.example.yml ${PATH_DEB}/etc/gotify/config.yml
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
}