Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ntfy package #6355

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions cross/ntfy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
PKG_NAME = ntfy
PKG_VERS = 2.11.0
# keep the commit in sync with version $(PKG_VERS)
PKG_COMMIT = d11b1007ef5cf8546adee9db3fb8ebf61ce9b17a
PKG_DATE = $(shell date +%s)
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/binwiederhier/ntfy/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

BUILD_DEPENDS = native/go

DEPENDS =

# go does not support ppc archs
UNSUPPORTED_ARCHS += $(PPC_ARCHS)
# ARMv5 is lacking atomics support (error: '__ATOMIC_CONSUME' undeclared, error: '__ATOMIC_RELEASE' undeclared)
UNSUPPORTED_ARCHS = $(ARMv5_ARCHS)

HOMEPAGE = https://ntfy.sh/
COMMENT = Send push notifications to your phone or desktop using PUT/POST.
LICENSE = Apache-2.0 and GPLv2

COMPILE_TARGET = ntfy_compile
INSTALL_TARGET = ntfy_install

GO = $(WORK_DIR)/../../../native/go/work-native/go/bin/go

include ../../mk/spksrc.cross-go.mk

.PHONY: ntfy_compile
# build similar to original Makefile targets: cli-deps-static-sites and cli-linux-server
# we can't use the original Makefile because it takes version and commit from
# spksrc repo that we are running within.
# For the same reason we can't use goreleaser either.
ntfy_compile:
@$(MSG) - build cli-linux-server
@cd $(WORK_DIR)/$(PKG_DIR) && mkdir -p dist server/docs server/site && touch server/docs/index.html server/site/app.html
@$(RUN) CGO_ENABLED=1 $(GO) build -o dist/ntfy \
-tags sqlite_omit_load_extension,osusergo,netgo \
-ldflags "-linkmode=external -extldflags=-static -s -w -X main.version=$(PKG_VERSION) -X main.commit=$(PKG_COMMIT) -X main.date=$(PKG_DATE)"

.PHONY: ntfy_install
ntfy_install:
@install -m 755 -d $(STAGING_INSTALL_PREFIX)/bin/
@install -m 755 $(WORK_DIR)/$(PKG_DIR)/dist/ntfy $(STAGING_INSTALL_PREFIX)/bin/
1 change: 1 addition & 0 deletions cross/ntfy/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/ntfy
3 changes: 3 additions & 0 deletions cross/ntfy/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ntfy-2.11.0.tar.gz SHA1 f9aec3d92a44537bc3e26727e465e0defff16c1c
ntfy-2.11.0.tar.gz SHA256 56b4c91d53e479e207b8064d894516030f608848c76c6d4eed2d37277d337e71
ntfy-2.11.0.tar.gz MD5 dc00aaac0883d4dda358c402dce29aa7
34 changes: 34 additions & 0 deletions spk/ntfy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
SPK_NAME = ntfy
SPK_VERS = 2.11.0
SPK_REV = 1
SPK_ICON = src/ntfy.png

DEPENDS = cross/ntfy

UNSUPPORTED_ARCHS += $(PPC_ARCHS) $(ARMv5_ARCHS)

MAINTAINER = hgy59
DISPLAY_NAME = ntfy
DESCRIPTION = Send push notifications to your phone or desktop using PUT/POST.
HOMEPAGE = https://ntfy.sh/
LICENSE = Apache-2.0 and GPLv2
CHANGELOG = "Initial package release."

STARTABLE = yes
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT = 8094
# There is no web app on service port:
NO_SERVICE_SHORTCUT = true

SPK_COMMANDS = bin/ntfy

POST_STRIP_TARGET = ntfy_extra_install

include ../../mk/spksrc.spk.mk

.PHONY: ntfy_extra_install
ntfy_extra_install:
@$(MSG) Install config file
@install -d $(STAGING_DIR)/var
@install -m 644 src/server.yml $(STAGING_DIR)/var/server.yml
Binary file added spk/ntfy/src/ntfy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading