aboutsummaryrefslogtreecommitdiffstats
path: root/net/openntpd
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2004-07-12 01:18:24 +0800
committerChristian Weisgerber <naddy@FreeBSD.org>2004-07-12 01:18:24 +0800
commitf8e7096728c0c7a5cfdbde1c80a7d2d3706ae0b4 (patch)
treedae8d75eba9ccc1c5dc7e878403563b6b39819ad /net/openntpd
parent114923d073d82ac85266d56b44a5393d4cbc4b7a (diff)
downloadfreebsd-ports-gnome-f8e7096728c0c7a5cfdbde1c80a7d2d3706ae0b4.tar.gz
freebsd-ports-gnome-f8e7096728c0c7a5cfdbde1c80a7d2d3706ae0b4.tar.zst
freebsd-ports-gnome-f8e7096728c0c7a5cfdbde1c80a7d2d3706ae0b4.zip
Initial import of openntpd (OpenBSD's ntpd, portable version).
The ntpd daemon implements the Simple Network Time Protocol version 4 as described in RFC 2030 and the Network Time Protocol version 3 as de- scribed in RFC 1305. It can synchronize the local clock to one or more remote NTP servers and act as NTP server itself, redistributing the local time.
Diffstat (limited to 'net/openntpd')
-rw-r--r--net/openntpd/Makefile40
-rw-r--r--net/openntpd/distinfo2
-rw-r--r--net/openntpd/files/openntpd.sh23
-rw-r--r--net/openntpd/pkg-descr7
-rw-r--r--net/openntpd/pkg-install35
-rw-r--r--net/openntpd/pkg-plist6
6 files changed, 113 insertions, 0 deletions
diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile
new file mode 100644
index 000000000000..0ed6ba7f0121
--- /dev/null
+++ b/net/openntpd/Makefile
@@ -0,0 +1,40 @@
+# New ports collection makefile for: openntpd
+# Date created: 2004-07-11
+# Whom: Christian Weisgerber <naddy@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= openntpd
+PORTVERSION= 0.2p1
+CATEGORIES= net
+MASTER_SITES= http://www.zip.com.au/~dtucker/openntpd/
+DISTNAME= ${PORTNAME}-${PORTVERSION}-pre1
+
+MAINTAINER= naddy@FreeBSD.org
+COMMENT= OpenBSD's Network Time Protocol daemon
+
+USE_RC_SUBR= yes
+GNU_CONFIGRUE= yes
+
+MAN5= ntpd.conf.5
+MAN8= ntpd.8
+
+pre-build:
+ @${SED} -e 's:%%PREFIX%%:${PREFIX}:g' \
+ -e 's:%%RC_SUBR%%:${RC_SUBR}:g' \
+ ${FILESDIR}/openntpd.sh >${WRKDIR}/openntpd.sh
+
+do-install:
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+ ${INSTALL_PROGRAM} ${WRKSRC}/ntpd ${PREFIX}/sbin
+ ${INSTALL_MAN} ${WRKSRC}/ntpd.conf.5 ${PREFIX}/man/man5
+ ${INSTALL_MAN} ${WRKSRC}/ntpd.8 ${PREFIX}/man/man8
+ @${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/ntpd.conf ${EXAMPLESDIR}
+ ${INSTALL_SCRIPT} ${WRKDIR}/openntpd.sh ${PREFIX}/etc/rc.d
+ @if [ ! -f ${PREFIX}/etc/ntpd.conf ]; then \
+ ${CP} -p ${EXAMPLESDIR}/ntpd.conf ${PREFIX}/etc; \
+ fi
+
+.include <bsd.port.mk>
diff --git a/net/openntpd/distinfo b/net/openntpd/distinfo
new file mode 100644
index 000000000000..bbb5e78751b7
--- /dev/null
+++ b/net/openntpd/distinfo
@@ -0,0 +1,2 @@
+MD5 (openntpd-0.2p1-pre1.tar.gz) = 9e62bb9aac029293c695ff27928dc9ec
+SIZE (openntpd-0.2p1-pre1.tar.gz) = 66400
diff --git a/net/openntpd/files/openntpd.sh b/net/openntpd/files/openntpd.sh
new file mode 100644
index 000000000000..22553d1f6084
--- /dev/null
+++ b/net/openntpd/files/openntpd.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: openntpd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+# KEYWORD: FreeBSD nojail
+
+. %%RC_SUBR%%
+
+name=openntpd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/ntpd
+required_files=%%PREFIX%%/etc/ntpd.conf
+
+# set default
+openntpd_enable=${openntpd_enable:-"NO"}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net/openntpd/pkg-descr b/net/openntpd/pkg-descr
new file mode 100644
index 000000000000..63c94ed853fd
--- /dev/null
+++ b/net/openntpd/pkg-descr
@@ -0,0 +1,7 @@
+OpenBSD's ntpd, portable version.
+
+The ntpd daemon implements the Simple Network Time Protocol version 4 as
+described in RFC 2030 and the Network Time Protocol version 3 as de-
+scribed in RFC 1305. It can synchronize the local clock to one or more
+remote NTP servers and act as NTP server itself, redistributing the local
+time.
diff --git a/net/openntpd/pkg-install b/net/openntpd/pkg-install
new file mode 100644
index 000000000000..62ded74d3b34
--- /dev/null
+++ b/net/openntpd/pkg-install
@@ -0,0 +1,35 @@
+#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+USER=_ntp
+GROUP=${USER}
+UID=123
+GID=${UID}
+
+if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -s "/sbin/nologin" -d "/var/empty" \
+ -c "NTP daemon"; \
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+
+exit 0
diff --git a/net/openntpd/pkg-plist b/net/openntpd/pkg-plist
new file mode 100644
index 000000000000..d2bc3f3d9052
--- /dev/null
+++ b/net/openntpd/pkg-plist
@@ -0,0 +1,6 @@
+@comment $FreeBSD$
+etc/rc.d/openntpd.sh
+sbin/ntpd
+@unexec if cmp -s %D/etc/ntpd.conf %D/%%EXAMPLESDIR%%/ntpd.conf; then rm -f %D/etc/ntpd.conf; fi
+%%EXAMPLESDIR%%/ntpd.conf
+@exec if [ ! -f %D/etc/ntpd.conf ]; then cp -p %D/%F %D/etc; fi