Refactor build/install process

This commit is contained in:
2025-06-02 13:37:18 -05:00
parent 0403f6a3e2
commit c30c8f8677
5 changed files with 81 additions and 24 deletions

View File

@ -1,24 +1,10 @@
#!/bin/sh
ntfy_version=2.11.0
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
# Copy binary to install directory
cp ntfy /usr/local/bin/
@ -30,17 +16,15 @@ cp server/server.yml client/client.yml /usr/local/etc/ntfy/
cd ..
# Make executable & Copy startup scripts
chmod +x rc.d/ntfy*
cp rc.d/ntfy rc.d/ntfy-client /usr/local/etc/rc.d/
chmod +x rc.d/ntfy*
cp rc.d/ntfy* /usr/local/etc/rc.d/
# Create ntfy user
pw user add -n ntfy -c 'ntfy user' -d /var/empty -s /usr/sbin/nologin
# Create directories for attachments, db, and pid file
mkdir -p /var/run/ntfy /var/cache/ntfy/attachments /var/lib/ntfy
chown ntfy /var/run/ntfy /var/cache/ntfy/attachments /var/lib/ntfy
mkdir -p /var/{run/ntfy,cache/ntfy/attachments,/lib/ntfy}
chown ntfy /var/{run/ntfy,cache/ntfy/attachments,/lib/ntfy}
# Setup instructions
cat postinstall