diff options
author | naddy <naddy@FreeBSD.org> | 2004-07-12 01:18:24 +0800 |
---|---|---|
committer | naddy <naddy@FreeBSD.org> | 2004-07-12 01:18:24 +0800 |
commit | cd6b165d82dca9bdfa8e32d772b8d3be66af253f (patch) | |
tree | 1d3fadce4fe6be60be403b2f4c23593b018184be /net | |
parent | 2d7f095e98b759e83e6585084e0d5f40dae20fde (diff) | |
download | freebsd-ports-graphics-cd6b165d82dca9bdfa8e32d772b8d3be66af253f.tar.gz freebsd-ports-graphics-cd6b165d82dca9bdfa8e32d772b8d3be66af253f.tar.zst freebsd-ports-graphics-cd6b165d82dca9bdfa8e32d772b8d3be66af253f.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')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/openntpd/Makefile | 40 | ||||
-rw-r--r-- | net/openntpd/distinfo | 2 | ||||
-rw-r--r-- | net/openntpd/files/openntpd.sh | 23 | ||||
-rw-r--r-- | net/openntpd/pkg-descr | 7 | ||||
-rw-r--r-- | net/openntpd/pkg-install | 35 | ||||
-rw-r--r-- | net/openntpd/pkg-plist | 6 |
7 files changed, 114 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index e9f646f6de4..a0e80297d6b 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 00000000000..0ed6ba7f012 --- /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 00000000000..bbb5e78751b --- /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 00000000000..22553d1f608 --- /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 00000000000..63c94ed853f --- /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 00000000000..62ded74d3b3 --- /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 00000000000..d2bc3f3d905 --- /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 |