From 34cf1842fe9ecfa0091bc37d885311a8ad2fcd4b Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 20 Oct 2009 12:45:58 +0000 Subject: main/openntpd: use /etc for config --- main/openntpd/APKBUILD | 19 ++++++++++--------- main/openntpd/openntpd.conf.d | 7 ------- main/openntpd/openntpd.confd | 7 +++++++ main/openntpd/openntpd.initd | 41 +++++++++++++++++++++++++++++++++++++++++ main/openntpd/openntpd.rc | 41 ----------------------------------------- 5 files changed, 58 insertions(+), 57 deletions(-) delete mode 100644 main/openntpd/openntpd.conf.d create mode 100644 main/openntpd/openntpd.confd create mode 100644 main/openntpd/openntpd.initd delete mode 100644 main/openntpd/openntpd.rc (limited to 'main/openntpd') diff --git a/main/openntpd/APKBUILD b/main/openntpd/APKBUILD index 38c11ca514..fb55acc660 100644 --- a/main/openntpd/APKBUILD +++ b/main/openntpd/APKBUILD @@ -14,9 +14,8 @@ license=BSD source=" ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-$_myver.tar.gz openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff - openntpd.conf.d - openntpd.rc - $install + openntpd.confd + openntpd.initd " _prepare() { @@ -27,15 +26,18 @@ _prepare() { _compile() { cd "$srcdir/$pkgname-$_myver" - ./configure --prefix=/usr --mandir=/usr/share/man + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --sysconfdir=/etc \ + || return 1 make || return 1 } _install() { cd "$srcdir/$pkgname-$_myver" make install DESTDIR="$pkgdir" - install -Dm755 ../openntpd.rc "$pkgdir/etc/init.d/ntpd" - install -Dm644 ../openntpd.conf.d "$pkgdir/etc/conf.d/ntpd" + install -Dm755 ../openntpd.initd "$pkgdir/etc/init.d/ntpd" + install -Dm644 ../openntpd.confd "$pkgdir/etc/conf.d/ntpd" } @@ -44,6 +46,5 @@ build() { } md5sums="afc34175f38d08867c1403d9008600b3 openntpd-3.9p1.tar.gz ae2f708b860975b64126bb316aeb6641 openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff -e3eee9eb2ea092dfdf9d887cd6df5795 openntpd.conf.d -5000453927b7ae9943d51194c1042355 openntpd.rc -05349f95db78fb482798b2c6d1f9c61e openntpd.pre-install" +e3eee9eb2ea092dfdf9d887cd6df5795 openntpd.confd +5000453927b7ae9943d51194c1042355 openntpd.initd" diff --git a/main/openntpd/openntpd.conf.d b/main/openntpd/openntpd.conf.d deleted file mode 100644 index 6b938dc766..0000000000 --- a/main/openntpd/openntpd.conf.d +++ /dev/null @@ -1,7 +0,0 @@ -# /etc/conf.d/ntpd: config file for openntpd's ntpd - -NTPD_HOME=/var/empty - -# See ntpd(8) man page ... some popular options: -# -s Set the time immediately at startup -NTPD_OPTS="" diff --git a/main/openntpd/openntpd.confd b/main/openntpd/openntpd.confd new file mode 100644 index 0000000000..6b938dc766 --- /dev/null +++ b/main/openntpd/openntpd.confd @@ -0,0 +1,7 @@ +# /etc/conf.d/ntpd: config file for openntpd's ntpd + +NTPD_HOME=/var/empty + +# See ntpd(8) man page ... some popular options: +# -s Set the time immediately at startup +NTPD_OPTS="" diff --git a/main/openntpd/openntpd.initd b/main/openntpd/openntpd.initd new file mode 100644 index 0000000000..81648dc03f --- /dev/null +++ b/main/openntpd/openntpd.initd @@ -0,0 +1,41 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/files/openntpd.rc,v 1.7 2008/10/10 09:40:10 bangert Exp $ + +depend() { + need net + after ntp-client + use dns logger +} + +checkconfig() { + if [ ! -f /etc/ntpd.conf ] ; then + eerror "Could not find /etc/ntpd.conf!" + return 1 + fi + + if [ -x /usr/bin/getent ] ; then + if [ "`getent passwd ntp | cut -d: -f 6`" != "${NTPD_HOME}" ] ; then + eerror "Home directory of ntp needs to be ${NTPD_HOME}" + eerror "Please run 'usermod -d ${NTPD_HOME} ntp'" + return 1 + fi + fi + + return 0 +} + +start() { + checkconfig || return $? + + ebegin "Starting ntpd" + start-stop-daemon --start --exec /usr/sbin/ntpd --name ntpd -- ${NTPD_OPTS} + eend $? "Failed to start ntpd" +} + +stop() { + ebegin "Stopping ntpd" + start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root + eend $? "Failed to stop openntpd" +} diff --git a/main/openntpd/openntpd.rc b/main/openntpd/openntpd.rc deleted file mode 100644 index 81648dc03f..0000000000 --- a/main/openntpd/openntpd.rc +++ /dev/null @@ -1,41 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/files/openntpd.rc,v 1.7 2008/10/10 09:40:10 bangert Exp $ - -depend() { - need net - after ntp-client - use dns logger -} - -checkconfig() { - if [ ! -f /etc/ntpd.conf ] ; then - eerror "Could not find /etc/ntpd.conf!" - return 1 - fi - - if [ -x /usr/bin/getent ] ; then - if [ "`getent passwd ntp | cut -d: -f 6`" != "${NTPD_HOME}" ] ; then - eerror "Home directory of ntp needs to be ${NTPD_HOME}" - eerror "Please run 'usermod -d ${NTPD_HOME} ntp'" - return 1 - fi - fi - - return 0 -} - -start() { - checkconfig || return $? - - ebegin "Starting ntpd" - start-stop-daemon --start --exec /usr/sbin/ntpd --name ntpd -- ${NTPD_OPTS} - eend $? "Failed to start ntpd" -} - -stop() { - ebegin "Stopping ntpd" - start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root - eend $? "Failed to stop openntpd" -} -- cgit v1.2.3