summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-08-28 18:34:08 +0200
committerErich Eckner <git@eckner.net>2024-08-28 18:34:08 +0200
commite9ba055115eef33866d314d86f2397f26eb14451 (patch)
treeb97dab9a0fc0141812dd2c68adf6d11cf17b3697
parent114088b509fd120794fa355fb8e99b6aa0f3e847 (diff)
downloadcrux-ports-e9ba055115eef33866d314d86f2397f26eb14451.tar.xz
openntpd new
-rw-r--r--manualPorts/openntpd/.footprint18
-rw-r--r--manualPorts/openntpd/.md5sum2
-rw-r--r--manualPorts/openntpd/.signature6
-rw-r--r--manualPorts/openntpd/Pkgfile27
-rw-r--r--manualPorts/openntpd/ntpd77
5 files changed, 130 insertions, 0 deletions
diff --git a/manualPorts/openntpd/.footprint b/manualPorts/openntpd/.footprint
new file mode 100644
index 0000000..32c4e10
--- /dev/null
+++ b/manualPorts/openntpd/.footprint
@@ -0,0 +1,18 @@
+drwxr-xr-x root/root etc/
+-rw-r--r-- root/root etc/ntpd.conf
+drwxr-xr-x root/root etc/rc.d/
+-rwxr-xr-x root/root etc/rc.d/ntpd
+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 usr/var/
+drwxr-xr-x root/root usr/var/db/
+drwxr-xr-x root/root usr/var/run/
diff --git a/manualPorts/openntpd/.md5sum b/manualPorts/openntpd/.md5sum
new file mode 100644
index 0000000..f23b5ee
--- /dev/null
+++ b/manualPorts/openntpd/.md5sum
@@ -0,0 +1,2 @@
+0abcfe8c3fa7457aed04a7a7bdebccac ntpd
+7c68ce2627b2ea13f2b95db1ef4fcfc5 openntpd-6.8p1.tar.gz
diff --git a/manualPorts/openntpd/.signature b/manualPorts/openntpd/.signature
new file mode 100644
index 0000000..e92c0dc
--- /dev/null
+++ b/manualPorts/openntpd/.signature
@@ -0,0 +1,6 @@
+untrusted comment: verify with /etc/ports/deepthought.pub
+RWQxCptPusLGGgNilHTcPyA5kR/0NNJdcnXXdd0MUHoviw1MvuBka373FUliKKJm2rjNiyVAXJ9jxNhjkjPOGus0Ux6PrWczvQc=
+SHA256 (Pkgfile) = 2f95dd2600f6cc892060fa9d15d40cc7fb3ab3ccc0f9092f1af94d4a29297c75
+SHA256 (.footprint) = 8492c613b30d19381b57788157bfe3539c93126075dbb5329ba72f641db98ef5
+SHA256 (openntpd-6.8p1.tar.gz) = 8582db838a399153d4a17f2a76518b638cc3020f58028575bf54127518f55a46
+SHA256 (ntpd) = afc8073ec2adfb8df1d44e40bd50bd9d9723755bc21029ddf1287b93539ae90f
diff --git a/manualPorts/openntpd/Pkgfile b/manualPorts/openntpd/Pkgfile
new file mode 100644
index 0000000..0e19da0
--- /dev/null
+++ b/manualPorts/openntpd/Pkgfile
@@ -0,0 +1,27 @@
+# Description: Portable version of OpenBSD's NTP implementation
+# URL: http://www.openntpd.org/
+# Maintainer: Erich Eckner, crux at eckner dot net
+# Contributor: Lin SiFuh, #crux at libera dot chat
+
+name=openntpd
+version=6.8p1
+release=1
+source=(http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/${name}-${version}.tar.gz
+ ntpd)
+
+build() {
+
+ cd "${name}"-"${version}"
+
+ ./configure --prefix=/usr \
+ --with-adjtimex \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --with-privsep-user=ntp
+
+ make
+ make DESTDIR="${PKG}" install
+
+ install -D -m 0755 "${SRC}"/ntpd "${PKG}"/etc/rc.d/ntpd
+
+}
diff --git a/manualPorts/openntpd/ntpd b/manualPorts/openntpd/ntpd
new file mode 100644
index 0000000..7b5710e
--- /dev/null
+++ b/manualPorts/openntpd/ntpd
@@ -0,0 +1,77 @@
+#!/bin/bash
+
+NAME=ntpd
+USER=root
+CONFIG=
+RUNDIR=/var/run
+PIDFILE=
+STARTCMD="/usr/sbin/ntpd"
+STOPCMD=
+STOPTIMEOUT=120
+
+function getpid() {
+ if [ -z "$PIDFILE" ]; then
+ pid="$(pgrep -xfn "$STARTCMD")"
+ else
+ if [ -f "$PIDFILE" ]; then
+ pid=$(< $PIDFILE)
+ if [ ! -d /proc/"$pid" ]; then
+ echo "$NAME: removing stale pidfile $PIDFILE" >&2
+ rm -f "$PIDFILE"
+ unset pid
+ fi
+ fi
+ fi
+ echo "$pid"
+}
+
+case $1 in
+ start)
+ pid=$(getpid)
+ install -d -m 755 -o $USER $RUNDIR || exit 1
+ if [ -n "$pid" ]; then
+ echo "$NAME already running with pid $pid" >&2
+ exit 1
+ fi
+ eval "$STARTCMD"
+ ;;
+ stop)
+ pid=$(getpid)
+ if [ -n "$pid" ]; then
+ if [ -n "$STOPCMD" ]; then
+ eval "$STOPCMD"
+ else
+ kill "$pid"
+ fi
+ t=$(printf '%(%s)T' -1)
+ tend=$((t+STOPTIMEOUT))
+ while [ -d /proc/$pid -a $t -lt $tend ]; do
+ sleep 0.5
+ t=$(printf '%(%s)T' -1)
+ done
+ if [ -d /proc/"$pid" ]; then
+ echo "$NAME still running with pid $pid" >&2
+ else
+ [ -n "$PIDFILE" ] && rm -f "$PIDFILE"
+ fi
+ else
+ echo "$NAME is not running" >&2
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ pid=$(getpid)
+ if [ -n "$pid" ]; then
+ echo "$NAME is running with pid $pid"
+ else
+ echo "$NAME is not running"
+ fi
+ ;;
+ *)
+ echo "usage: $0 [start|stop|restart|status]"
+ ;;
+esac
+