summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2009-10-14 08:04:19 +0000
committerThilo Bangert <bangert@gentoo.org>2009-10-14 08:04:19 +0000
commitdc1fca7d61a6d5b59e9939d9a66b68a4d9ba4d72 (patch)
tree3943eba37e3e882a4596885f13684ea40a3ef775 /net-misc/openntpd
parentVersion bump to 2.08. Bug #287217 (diff)
downloadgentoo-2-dc1fca7d61a6d5b59e9939d9a66b68a4d9ba4d72.tar.gz
gentoo-2-dc1fca7d61a6d5b59e9939d9a66b68a4d9ba4d72.tar.bz2
gentoo-2-dc1fca7d61a6d5b59e9939d9a66b68a4d9ba4d72.zip
eapi=2 - fix timezone info for chrooted process (bug #226491)
(Portage version: 2.2_rc42/cvs/Linux i686)
Diffstat (limited to 'net-misc/openntpd')
-rw-r--r--net-misc/openntpd/ChangeLog11
-rw-r--r--net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r27
-rw-r--r--net-misc/openntpd/files/openntpd.rc-3.9_p1-r245
-rw-r--r--net-misc/openntpd/openntpd-3.9_p1-r2.ebuild61
4 files changed, 122 insertions, 2 deletions
diff --git a/net-misc/openntpd/ChangeLog b/net-misc/openntpd/ChangeLog
index d9369425517a..07bc94357a96 100644
--- a/net-misc/openntpd/ChangeLog
+++ b/net-misc/openntpd/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/openntpd
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.41 2008/10/10 09:40:10 bangert Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.42 2009/10/14 08:04:18 bangert Exp $
+
+*openntpd-3.9_p1-r2 (14 Oct 2009)
+
+ 14 Oct 2009; Thilo Bangert <bangert@gentoo.org>
+ +files/openntpd.conf.d-3.9_p1-r2, +files/openntpd.rc-3.9_p1-r2,
+ +openntpd-3.9_p1-r2.ebuild:
+ eapi=2 - fix timezone info for chrooted process (bug #226491)
10 Oct 2008; Thilo Bangert <bangert@gentoo.org> files/openntpd.rc:
make sure ntpd stops - bug #240676
diff --git a/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2 b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2
new file mode 100644
index 000000000000..f07752752022
--- /dev/null
+++ b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r2
@@ -0,0 +1,7 @@
+# /etc/conf.d/ntpd: config file for openntpd's ntpd
+
+NTPD_HOME=/var/lib/openntpd/chroot
+
+# See ntpd(8) man page ... some popular options:
+# -s Set the time immediately at startup
+NTPD_OPTS=""
diff --git a/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2 b/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2
new file mode 100644
index 000000000000..455e4e21cfd2
--- /dev/null
+++ b/net-misc/openntpd/files/openntpd.rc-3.9_p1-r2
@@ -0,0 +1,45 @@
+#!/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-3.9_p1-r2,v 1.1 2009/10/14 08:04:19 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 $?
+
+ #prepare chroot
+ mkdir -p /var/lib/openntpd/chroot/etc/
+ cp /etc/localtime /var/lib/openntpd/chroot/etc
+
+ 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/net-misc/openntpd/openntpd-3.9_p1-r2.ebuild b/net-misc/openntpd/openntpd-3.9_p1-r2.ebuild
new file mode 100644
index 000000000000..a6413d823ed4
--- /dev/null
+++ b/net-misc/openntpd/openntpd-3.9_p1-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/openntpd-3.9_p1-r2.ebuild,v 1.1 2009/10/14 08:04:18 bangert Exp $
+
+EAPI="2"
+
+inherit eutils
+
+MY_P=${P/_/}
+DESCRIPTION="Lightweight NTP server ported from OpenBSD"
+HOMEPAGE="http://www.openntpd.org/"
+SRC_URI="mirror://openbsd/OpenNTPD/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="ssl selinux"
+
+RDEPEND="ssl? ( dev-libs/openssl )
+ selinux? ( sec-policy/selinux-ntp )
+ !<=net-misc/ntp-4.2.0-r2"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewgroup ntp 123
+ enewuser ntp 123 -1 /var/lib/openntpd/chroot ntp
+
+ #make sure user has correct HOME
+ usermod -d /var/lib/openntpd/chroot ntp
+
+ if has_version net-misc/ntp && ! built_with_use net-misc/ntp openntpd ; then
+ die "you need to emerge ntp with USE=openntpd"
+ fi
+}
+
+src_prepare() {
+ sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || die
+ epatch "${FILESDIR}"/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff
+}
+
+src_configure() {
+ econf \
+ --disable-strip \
+ $(use_with !ssl builtin-arc4random) || die
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die
+ dodoc ChangeLog CREDITS README
+
+ newinitd "${FILESDIR}"/openntpd.rc-3.9_p1-r2 ntpd
+ newconfd "${FILESDIR}"/openntpd.conf.d-3.9_p1-r2 ntpd
+
+ dodir /var/lib/openntpd/chroot
+}