summaryrefslogtreecommitdiff
path: root/opt/openntpd
diff options
context:
space:
mode:
Diffstat (limited to 'opt/openntpd')
-rw-r--r--opt/openntpd/.footprint25
-rw-r--r--opt/openntpd/.signature6
-rw-r--r--opt/openntpd/MAKEPKG96
3 files changed, 127 insertions, 0 deletions
diff --git a/opt/openntpd/.footprint b/opt/openntpd/.footprint
new file mode 100644
index 0000000..5460a46
--- /dev/null
+++ b/opt/openntpd/.footprint
@@ -0,0 +1,25 @@
+drwxr-xr-x root/root etc/
+-rw-r--r-- root/root etc/ntpd.conf
+drwxr-xr-x root/root etc/sv/
+drwxr-xr-x root/root etc/sv/ntpd/
+-rwxr-xr-x root/root etc/sv/ntpd/finish
+-rwxr-xr-x root/root etc/sv/ntpd/run
+drwxr-xr-x root/root etc/sv/ntpd/log/
+-rwxr-xr-x root/root etc/sv/ntpd/log/run
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/sbin/
+-rwxr-xr-x root/root usr/sbin/ntpctl
+-rwxr-xr-x root/root usr/sbin/ntpd
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man5/
+-rw-r--r-- root/root usr/share/man/man5/ntpd.conf.5.gz
+drwxr-xr-x root/root usr/share/man/man8/
+-rw-r--r-- root/root usr/share/man/man8/ntpctl.8.gz
+-rw-r--r-- root/root usr/share/man/man8/ntpd.8.gz
+drwxr-xr-x root/root var/
+drwxr-xr-x root/root var/lib/
+drwxr-xr-x root/root var/lib/pkg/
+drwxr-xr-x root/root var/lib/pkg/meta/
+-rw-r--r-- root/root var/lib/pkg/meta/openntpd
+drwxr-xr-x root/root var/run/
diff --git a/opt/openntpd/.signature b/opt/openntpd/.signature
new file mode 100644
index 0000000..53e1b8e
--- /dev/null
+++ b/opt/openntpd/.signature
@@ -0,0 +1,6 @@
+RWTZ9IduCSQ/mJoeQLZUPcU9qsjykqnK0erHX/WR1/VfalVJnChn6P5IpDrGHPDeURLfiK75kIM1RIB5zB5ukdFXXakxXLagLwM=
+
+SHA256 (MAKEPKG) = 5a9cb069db167cb777c3561f56b5715f53d099de8778205f65d2100b5e63f5b6
+SHA256 (.footprint) = 67751d1ad5bd6aa07c97668073309661e362d0c7d581897724a9e2da7345d37c
+SHA256 (openntpd-7.9p1.tar.gz) = 091eeb3f4e358e28c3ab2ea58f93d7a0b5758a20d7c8a0418e162e9b2c27addc
+SHA256 (openntpd#7.9p1-5.pkg.tar.gz) = 23a8c7dbe4dcf0ef1e5143b28544c3b6bf68103022a1710d9b9dcf11b274a5a6
diff --git a/opt/openntpd/MAKEPKG b/opt/openntpd/MAKEPKG
new file mode 100644
index 0000000..dd3530f
--- /dev/null
+++ b/opt/openntpd/MAKEPKG
@@ -0,0 +1,96 @@
+#!/bin/mkpkg
+# description: Free, easy to use NTP implementation from OpenBSD
+# url: https://www.openntpd.org
+
+name=openntpd
+version=7.9p1
+release=5
+depends=(libressl)
+groups=(ntp:user:ntp:/var/empty:755:902:902)
+services=(ntpd)
+permissions=(
+ /var/empty:root:root:755
+ /etc/ntpd.conf:root:root:644
+)
+source=(https://cdn.openbsd.org/pub/OpenBSD/OpenNTPD/$name-$version.tar.gz)
+
+sha256sums=(
+ "091eeb3f4e358e28c3ab2ea58f93d7a0b5758a20d7c8a0418e162e9b2c27addc"
+)
+
+patch() {
+ cd $name-$version
+
+ # musl: no /etc/services so getservbyname("ntp","udp") returns NULL
+ # and fatal() fires immediately. Two-file fix:
+ #
+ # 1. ntp.c: remove the fatal() guard so NULL se is allowed to pass through
+ # 2. server.c: replace both se->s_port dereferences with htons(123)
+
+ sed -i '/if ((se = getservbyname("ntp", "udp")) == NULL)/{n; s/.*fatal.*//;}' \
+ src/ntp.c
+
+ sed -i 's/se->s_port/htons(123)/g' \
+ src/server.c
+}
+
+build() {
+ cd $name-$version
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --with-privsep-user=ntp \
+ --with-cacert=/etc/ssl/cert.pem
+ make
+ make DESTDIR=$PKG install
+}
+
+post_build() {
+ cd $name-$version
+
+ # ntpd.conf — pool.ntp.org with HTTPS constraints
+ printf '%s\n' \
+ '# krypt ntpd.conf' \
+ '' \
+ 'servers pool.ntp.org' \
+ '' \
+ '# HTTPS time constraint validation (requires libtls)' \
+ 'constraints from "https://www.google.com/search?q=openntpd"' \
+ > $PKG/etc/ntpd.conf
+
+ # runit service
+ # ntpd manages its own privilege separation — runs as root,
+ # forks an unprivileged child as ntp.
+ # -s removed: deprecated and fatal in 6.8p1; use constraints instead.
+ install -d $PKG/etc/sv/ntpd/log
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec 2>&1' \
+ 'exec ntpd -d' \
+ > $PKG/etc/sv/ntpd/run
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'rm -f /var/run/ntpd.sock' \
+ > $PKG/etc/sv/ntpd/finish
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'mkdir -p /var/log/ntpd' \
+ 'exec svlogd -tt /var/log/ntpd' \
+ > $PKG/etc/sv/ntpd/log/run
+
+ chmod 755 $PKG/etc/sv/ntpd/run
+ chmod 755 $PKG/etc/sv/ntpd/finish
+ chmod 755 $PKG/etc/sv/ntpd/log/run
+
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh