debmaker/ressources/gotify/debmaker

41 lines
954 B
Plaintext
Raw Normal View History

2022-02-12 18:30:28 +01:00
#!/bin/bash
APP=gotify
2022-09-10 18:11:22 +02:00
VERSION=2.1.6
GIT_VERSION=v$VERSION
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
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-08-17 20:35:16 +02:00
STEP="base_package_upgrade envinit get_git_source build makedeb"
2022-02-20 15:02:18 +01:00
2022-02-12 18:30:28 +01:00
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
}