43 lines
876 B
Bash
Executable File
43 lines
876 B
Bash
Executable File
#!/bin/sh
|
|
|
|
ntfy_version=2.12.0
|
|
file_dir=`cat dir_struct`
|
|
CGO_ENABLED=1
|
|
|
|
# Grab Release tarball
|
|
fetch https://github.com/binwiederhier/ntfy/archive/refs/tags/v${ntfy_version}.tar.gz
|
|
|
|
# Extract Release source code
|
|
tar zxvf v${ntfy_version}.tar.gz
|
|
|
|
# Change to build directory
|
|
cd ntfy-${ntfy_version}
|
|
|
|
# Build
|
|
make cli-deps-static-sites
|
|
make web
|
|
make web-deps
|
|
make web-build
|
|
go build
|
|
|
|
# Up from build directory
|
|
cd ..
|
|
|
|
# Create directory structure
|
|
mkdir pkg
|
|
for i in ${dir_struct} ;do
|
|
mkdir -p pkg$i
|
|
done
|
|
|
|
# Copy files to directories
|
|
cp -rv rc.d/* pkg/usr/local/etc/rc.d/
|
|
cp ntfy-${ntfy_version}/ntfy pkg/usr/local/bin/
|
|
cp ntfy-${ntfy_version}/{server/server.yml,client/client.yml} pkg/usr/local/etc/ntfy/
|
|
|
|
# Make a tarball
|
|
cd pkg
|
|
tar zcvf ../ntfy_server-${ntfy_version}.tar.gz .
|
|
sha256 ../ntfy_server-${ntfy_version}.tar.gz > ../ntfy_server-${ntfy_version}.sha256
|
|
cd ..
|
|
|