debmaker/ressources/gotify/debmaker

47 lines
962 B
Text
Raw Normal View History

2022-02-12 18:30:28 +01:00
#!/bin/bash
APP=gotify
2023-07-11 23:00:08 +02:00
VERSION=2.2.4
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
2023-07-11 23:00:08 +02:00
DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=6
2022-09-10 18:11:22 +02:00
DEPOT=https://github.com/gotify/server.git
PACKAGE_DEPENDENCY="build-essential nodejs yarn"
2022-12-04 03:31:12 +01:00
main(){
base_package_upgrade
2023-07-11 23:00:08 +02:00
envinit
get_git_source
build
makedeb
}
envinit() {
2022-08-17 20:35:16 +02:00
configure_depot_yarn
configure_depot_nodejs
2022-09-10 18:11:22 +02:00
install_package_dependency
2022-08-17 20:35:16 +02:00
install_go
2022-02-12 18:30:28 +01:00
}
build() {
cd /tmp/${APP}
2022-02-20 15:02:18 +01:00
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
2022-02-12 18:30:28 +01:00
}
makedeb(){
2022-02-24 00:02:53 +01:00
PATH_DEB=/tmp/src/rootfs
cp /tmp/${APP}/gotify-server ${PATH_DEB}/usr/bin/
2022-09-10 18:11:22 +02:00
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
2022-02-24 00:02:53 +01:00
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
2022-02-12 18:30:28 +01:00
}