summaryrefslogtreecommitdiff
path: root/sysutils/go-ntfy
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/go-ntfy')
-rw-r--r--sysutils/go-ntfy/Makefile66
-rw-r--r--sysutils/go-ntfy/distinfo7
-rw-r--r--sysutils/go-ntfy/files/ntfy.in32
-rw-r--r--sysutils/go-ntfy/pkg-descr5
4 files changed, 110 insertions, 0 deletions
diff --git a/sysutils/go-ntfy/Makefile b/sysutils/go-ntfy/Makefile
new file mode 100644
index 000000000000..fb8db411df89
--- /dev/null
+++ b/sysutils/go-ntfy/Makefile
@@ -0,0 +1,66 @@
+PORTNAME= ntfy
+DISTVERSIONPREFIX= v
+DISTVERSION= 2.12.0
+CATEGORIES= sysutils
+MASTER_SITES= LOCAL/dtxdf/${PORTNAME}/
+PKGNAMEPREFIX= go-
+DISTFILES= ${PORTNAME}-${DISTVERSION}.frontend${EXTRACT_SUFX}
+
+MAINTAINER= dtxdf@FreeBSD.org
+COMMENT= Send push notifications to your phone or desktop using PUT/POST
+WWW= https://ntfy.sh
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= go:modules
+USE_GITHUB= yes
+GH_ACCOUNT= binwiederhier
+
+USE_RC_SUBR= ${PORTNAME}
+
+GO_MOD_DIST= github
+GO_MODULE= github.com/binwiederhier/${PORTNAME}
+GO_BUILDFLAGS= -ldflags "\
+ -X 'main.version=${DISTVERSION}' \
+ -X 'main.commit=${GITID}' \
+ -X 'main.date=${BUILD_DATE}'"
+
+CONFLICTS_INSTALL= sysutils/ntfy
+
+PLIST_FILES= "@sample ${ETCDIR}/client.yml.sample" \
+ "@sample ${ETCDIR}/server.yml.sample" \
+ bin/${PORTNAME}
+
+OPTIONS_DEFINE= DOCS
+
+DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocs-material>=0:textproc/py-mkdocs-material@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}mkdocs-minify-plugin>=0:textproc/py-mkdocs-minify-plugin@${PY_FLAVOR}
+DOCS_USES= python
+
+# Run 'git checkout ${DISTVERSIONPREFIX}${DISTVERSION} && git rev-parse --short HEAD'
+# in the ntfy repository to get the value of GITID.
+GITID= 061677a7
+
+BUILD_DATE= $$(date -u "+%Y-%m-%dT%H:%M:%SZ")
+
+post-patch:
+ @${GREP} -rl "/etc/${PORTNAME}" ${WRKSRC}/cmd \
+ | ${XARGS} ${REINPLACE_CMD} -e 's#/etc/${PORTNAME}#${ETCDIR}#g'
+
+pre-build:
+ @${MKDIR} ${WRKSRC}/server/docs
+ ${TOUCH} ${WRKSRC}/server/docs/index.html
+ ${RM} -r ${WRKSRC}/server/site
+ @${MKDIR} ${WRKSRC}/server/site
+ @cd ${WRKDIR}/ntfy-frontend && ${COPYTREE_SHARE} . ${WRKSRC}/server/site
+
+pre-build-DOCS-on:
+ @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} mkdocs build
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/server/server.yml ${STAGEDIR}${ETCDIR}/server.yml.sample
+ ${INSTALL_DATA} ${WRKSRC}/client/client.yml ${STAGEDIR}${ETCDIR}/client.yml.sample
+
+.include <bsd.port.mk>
diff --git a/sysutils/go-ntfy/distinfo b/sysutils/go-ntfy/distinfo
new file mode 100644
index 000000000000..3ed506c03a3d
--- /dev/null
+++ b/sysutils/go-ntfy/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1750965231
+SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/ntfy-2.12.0.frontend.tar.gz) = 8b777d3618b2dde7095be53b09cb220e50a7e52af2a4211d074c5796151e5d4f
+SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/ntfy-2.12.0.frontend.tar.gz) = 2297703
+SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/go.mod) = f88dd70c2bc8386f38d575e2c424cfb729a6c36a0c6299449df3cac40d289a7d
+SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/go.mod) = 4705
+SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/binwiederhier-ntfy-v2.12.0_GH0.tar.gz) = 210b7409894aa51719077da6a771c82d460bd710a52a527cf52694166f6103d0
+SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.12.0_GH0/binwiederhier-ntfy-v2.12.0_GH0.tar.gz) = 13608026
diff --git a/sysutils/go-ntfy/files/ntfy.in b/sysutils/go-ntfy/files/ntfy.in
new file mode 100644
index 000000000000..f681ce0b5c1b
--- /dev/null
+++ b/sysutils/go-ntfy/files/ntfy.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# PROVIDE: ntfy
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for ntfy in /etc/rc.conf
+#
+# ntfy_enable (bool): Enable ntfy. (default=NO)
+# ntfy_log (str): Log output. (default=/var/log/ntfy.log)
+# ntfy_runas (str): User to run ntfy as. (default=www)
+#
+
+. /etc/rc.subr
+
+name="ntfy"
+desc="Send push notifications to your phone or desktop using PUT/POST"
+rcvar="${name}_enable"
+
+load_rc_config $name
+
+: ${ntfy_enable:="NO"}
+: ${ntfy_log:="/var/log/ntfy.log"}
+: ${ntfy_runas:="www"}
+: ${ntfy_args="--listen-http :8080"}
+
+pidfile="/var/run/${name}.pid"
+procname="%%LOCALBASE%%/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-c -u '${ntfy_runas}' -p '${pidfile}' -t '${desc}' -o '${ntfy_log}' '${procname}' serve ${ntfy_args}"
+
+run_rc_command "$1"
diff --git a/sysutils/go-ntfy/pkg-descr b/sysutils/go-ntfy/pkg-descr
new file mode 100644
index 000000000000..279182934b82
--- /dev/null
+++ b/sysutils/go-ntfy/pkg-descr
@@ -0,0 +1,5 @@
+ntfy (pronounced "notify") is a simple HTTP-based pub-sub notification
+service. With ntfy, you can send notifications to your phone or
+desktop via scripts from any computer, without having to sign up
+or pay any fees. If you'd like to run your own instance of the
+service, you can easily do so since ntfy is open source.