diff options
Diffstat (limited to 'sysutils/go-ntfy')
-rw-r--r-- | sysutils/go-ntfy/Makefile | 67 | ||||
-rw-r--r-- | sysutils/go-ntfy/distinfo | 7 | ||||
-rw-r--r-- | sysutils/go-ntfy/files/ntfy.in | 32 | ||||
-rw-r--r-- | sysutils/go-ntfy/pkg-descr | 5 |
4 files changed, 111 insertions, 0 deletions
diff --git a/sysutils/go-ntfy/Makefile b/sysutils/go-ntfy/Makefile new file mode 100644 index 000000000000..2d2ebeac5192 --- /dev/null +++ b/sysutils/go-ntfy/Makefile @@ -0,0 +1,67 @@ +PORTNAME= ntfy +DISTVERSIONPREFIX= v +DISTVERSION= 2.13.0 +PORTREVISION= 1 +CATEGORIES= sysutils +MASTER_SITES= LOCAL/dtxdf/${PORTNAME}/ +PKGNAMEPREFIX= go- +DISTFILES= ${PORTNAME}-${DISTVERSIONPREFIX}${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= 1ce08a18 + +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..f551bd41bebb --- /dev/null +++ b/sysutils/go-ntfy/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1754093629 +SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/ntfy-v2.13.0.frontend.tar.gz) = 4a70e73ed6dca413496ce8240f933918ad5d6a96546ea231ffc89590ea9868d7 +SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/ntfy-v2.13.0.frontend.tar.gz) = 2295908 +SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/go.mod) = 8cf4cbfd868521d2535b87ddaca8ee6d6c3bd0786e792d86c584e38afdf95fd2 +SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/go.mod) = 4765 +SHA256 (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/binwiederhier-ntfy-v2.13.0_GH0.tar.gz) = 228e521ad682ca3dad23242a266321da2df557646b01fbac08f2d42bd8fc1fa8 +SIZE (go/sysutils_go-ntfy/binwiederhier-ntfy-v2.13.0_GH0/binwiederhier-ntfy-v2.13.0_GH0.tar.gz) = 13664549 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. |