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.
This commit is contained in:
Christian Weisgerber 2004-07-11 17:18:24 +00:00
parent 114923d073
commit f8e7096728
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=113409
7 changed files with 114 additions and 0 deletions

View File

@ -403,6 +403,7 @@
SUBDIR += openldap22-sasl-server
SUBDIR += openldap22-server
SUBDIR += openmcu
SUBDIR += openntpd
SUBDIR += openradius
SUBDIR += openslp
SUBDIR += openverse

40
net/openntpd/Makefile Normal file
View File

@ -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>

2
net/openntpd/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (openntpd-0.2p1-pre1.tar.gz) = 9e62bb9aac029293c695ff27928dc9ec
SIZE (openntpd-0.2p1-pre1.tar.gz) = 66400

View File

@ -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"

7
net/openntpd/pkg-descr Normal file
View File

@ -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.

35
net/openntpd/pkg-install Normal file
View File

@ -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

6
net/openntpd/pkg-plist Normal file
View File

@ -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