summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/Makefile1
-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
7 files changed, 114 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index e9f646f..a0e8029 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -403,6 +403,7 @@
SUBDIR += openldap22-sasl-server
SUBDIR += openldap22-server
SUBDIR += openmcu
+ SUBDIR += openntpd
SUBDIR += openradius
SUBDIR += openslp
SUBDIR += openverse
diff --git a/net/openntpd/Makefile b/net/openntpd/Makefile
new file mode 100644
index 0000000..0ed6ba7
--- /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 0000000..bbb5e78
--- /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 0000000..22553d1
--- /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 0000000..63c94ed
--- /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 0000000..62ded74
--- /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 0000000..d2bc3f3
--- /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
OpenPOWER on IntegriCloud