nqptp: Add new port nqptp for use with shairport-sync
authorBen Klang <bklang@wirehack.net>
Thu, 28 Dec 2023 19:40:49 +0000 (14:40 -0500)
committerRosen Penev <rosenp@gmail.com>
Tue, 2 Jan 2024 23:15:00 +0000 (15:15 -0800)
Signed-off-by: Ben Klang <bklang@wirehack.net>
net/nqptp/Makefile [new file with mode: 0644]
net/nqptp/files/nqptp.init [new file with mode: 0644]

diff --git a/net/nqptp/Makefile b/net/nqptp/Makefile
new file mode 100644 (file)
index 0000000..b16efec
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+# updated to work with latest source from abrasive
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nqptp
+PKG_VERSION:=1.2.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/mikebrady/nqptp/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=1df1d5edd5b713010d6495b3abca4c1cf4ad8fa6029df0abeb9e4de8e0eb707a
+
+PKG_MAINTAINER:=Ben Klang <bklang@wirehack.net>
+PKG_LICENSE:=GPL-2.0-only
+PKG_LICENSE_FILES:=COPYING LICENSES nqptp.c
+
+PKG_FIXUP:=autoreconf
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nqptp
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Not Quite Peer-to-Peer
+  URL:=https://github.com/mikebrady/nqptp
+endef
+
+define Package/nqptp/description
+  nqptp is a daemon that monitors timing data from PTP clocks it sees on ports
+  319 and 320. It maintains records for one clock, identified by its Clock ID.
+
+  It is a companion application to Shairport Sync and provides timing
+  information for AirPlay 2 operation.
+endef
+
+define Package/nqptp/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/nqptp $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/nqptp.init $(1)/etc/init.d/nqptp
+endef
+
+$(eval $(call BuildPackage,nqptp))
diff --git a/net/nqptp/files/nqptp.init b/net/nqptp/files/nqptp.init
new file mode 100644 (file)
index 0000000..d40ef87
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2023 Ben Klang <bklang@wirehack.net>
+
+START=99
+USE_PROCD=1
+
+service_triggers() {
+       procd_add_reload_trigger "nqptp"
+}
+
+start_service() {
+       procd_open_instance
+       procd_set_param command /usr/bin/nqptp
+       procd_close_instance
+}