diff options
author | Krzysztof Pawlik <nelchael@gentoo.org> | 2011-08-13 15:38:31 +0000 |
---|---|---|
committer | Krzysztof Pawlik <nelchael@gentoo.org> | 2011-08-13 15:38:31 +0000 |
commit | 5b31fcc6c4bec311086f7486ba5661ed8df9a47a (patch) | |
tree | 26223c9e1b2a8481b5da2c664a562d7e23968786 /net-misc/openntpd | |
parent | Version bumps. (diff) | |
download | gentoo-2-5b31fcc6c4bec311086f7486ba5661ed8df9a47a.tar.gz gentoo-2-5b31fcc6c4bec311086f7486ba5661ed8df9a47a.tar.bz2 gentoo-2-5b31fcc6c4bec311086f7486ba5661ed8df9a47a.zip |
Revision bump to fix bug #241002 (OpenRC related improvements) and bug #363051 (hardcoded ntp directory in init.d script).
(Portage version: 2.1.10.11/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/openntpd')
-rw-r--r-- | net-misc/openntpd/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff | 43 | ||||
-rw-r--r-- | net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r4 (renamed from net-misc/openntpd/files/openntpd.conf.d) | 2 | ||||
-rw-r--r-- | net-misc/openntpd/files/openntpd.init.d-3.9_p1-r4 (renamed from net-misc/openntpd/files/openntpd.rc) | 28 | ||||
-rw-r--r-- | net-misc/openntpd/openntpd-3.9_p1-r4.ebuild | 59 |
5 files changed, 83 insertions, 61 deletions
diff --git a/net-misc/openntpd/ChangeLog b/net-misc/openntpd/ChangeLog index bf25156b4b2c..04de08822740 100644 --- a/net-misc/openntpd/ChangeLog +++ b/net-misc/openntpd/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-misc/openntpd # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.51 2011/07/30 15:49:34 nelchael Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/ChangeLog,v 1.52 2011/08/13 15:38:31 nelchael Exp $ + +*openntpd-3.9_p1-r4 (13 Aug 2011) + + 13 Aug 2011; Krzysztof Pawlik <nelchael@gentoo.org> + +files/openntpd.conf.d-3.9_p1-r4, +files/openntpd.init.d-3.9_p1-r4, + +openntpd-3.9_p1-r4.ebuild, + -files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff, + -files/openntpd.conf.d, -files/openntpd.rc: + Revision bump to fix bug #241002 (OpenRC related improvements) and bug + #363051 (hardcoded ntp directory in init.d script). 30 Jul 2011; Krzysztof Pawlik <nelchael@gentoo.org> metadata.xml: Add myself as maintainer. diff --git a/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff b/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff deleted file mode 100644 index adca55614a49..000000000000 --- a/net-misc/openntpd/files/openntpd-3.9p1_reconnect_on_sendto_EINVAL.diff +++ /dev/null @@ -1,43 +0,0 @@ -diff -Naur openntpd-3.9p1/client.c openntpd-3.9p1-fixed/client.c ---- openntpd-3.9p1/client.c 2006-05-14 07:29:21.000000000 +0200 -+++ openntpd-3.9p1-fixed/client.c 2006-10-11 02:41:44.000000000 +0200 -@@ -116,6 +116,7 @@ - client_query(struct ntp_peer *p) - { - int tos = IPTOS_LOWDELAY; -+ int result; - - if (p->addr == NULL && client_nextaddr(p) == -1) { - set_next(p, error_interval()); -@@ -163,9 +164,17 @@ - p->query->msg.xmttime.fractionl = arc4random(); - p->query->xmttime = gettime(); - -- if (ntp_sendmsg(p->query->fd, NULL, &p->query->msg, -- NTP_MSGSIZE_NOAUTH, 0) == -1) { -+ if ((result = ntp_sendmsg(p->query->fd, NULL, &p->query->msg, -+ NTP_MSGSIZE_NOAUTH, 0)) < 0) { - set_next(p, INTERVAL_QUERY_PATHETIC); -+ if (result == -2) { -+ /* -+ * got EINVAL in sendto(), probably the local socket -+ * address got invalidated -> force re-connect() -+ */ -+ close(p->query->fd); -+ p->query->fd = -1; -+ } - return (-1); - } - -diff -Naur openntpd-3.9p1/ntp_msg.c openntpd-3.9p1-fixed/ntp_msg.c ---- openntpd-3.9p1/ntp_msg.c 2006-05-14 07:29:21.000000000 +0200 -+++ openntpd-3.9p1-fixed/ntp_msg.c 2006-10-11 02:41:49.000000000 +0200 -@@ -98,6 +98,8 @@ - return (-1); - } - log_warn("sendto"); -+ if (errno == EINVAL) -+ return (-2); - return (-1); - } - diff --git a/net-misc/openntpd/files/openntpd.conf.d b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r4 index 6b938dc766ce..f07752752022 100644 --- a/net-misc/openntpd/files/openntpd.conf.d +++ b/net-misc/openntpd/files/openntpd.conf.d-3.9_p1-r4 @@ -1,6 +1,6 @@ # /etc/conf.d/ntpd: config file for openntpd's ntpd -NTPD_HOME=/var/empty +NTPD_HOME=/var/lib/openntpd/chroot # See ntpd(8) man page ... some popular options: # -s Set the time immediately at startup diff --git a/net-misc/openntpd/files/openntpd.rc b/net-misc/openntpd/files/openntpd.init.d-3.9_p1-r4 index 81648dc03f41..23b003f7b3ca 100644 --- a/net-misc/openntpd/files/openntpd.rc +++ b/net-misc/openntpd/files/openntpd.init.d-3.9_p1-r4 @@ -1,7 +1,11 @@ #!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2011 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 $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/files/openntpd.init.d-3.9_p1-r4,v 1.1 2011/08/13 15:38:31 nelchael Exp $ + +name="OpenNTPD" +command="/usr/sbin/ntpd" +command_args="${NTPD_OPTS}" depend() { need net @@ -9,7 +13,7 @@ depend() { use dns logger } -checkconfig() { +start_pre() { if [ ! -f /etc/ntpd.conf ] ; then eerror "Could not find /etc/ntpd.conf!" return 1 @@ -23,19 +27,11 @@ checkconfig() { fi fi - return 0 -} - -start() { - checkconfig || return $? + checkpath -d -o 0:0 "${NTPD_HOME}" - ebegin "Starting ntpd" - start-stop-daemon --start --exec /usr/sbin/ntpd --name ntpd -- ${NTPD_OPTS} - eend $? "Failed to start ntpd" -} + # prepare chroot + mkdir -p "${NTPD_HOME}/etc" + cp /etc/localtime "${NTPD_HOME}/etc" -stop() { - ebegin "Stopping ntpd" - start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root - eend $? "Failed to stop openntpd" + return 0 } diff --git a/net-misc/openntpd/openntpd-3.9_p1-r4.ebuild b/net-misc/openntpd/openntpd-3.9_p1-r4.ebuild new file mode 100644 index 000000000000..5ca555548a31 --- /dev/null +++ b/net-misc/openntpd/openntpd-3.9_p1-r4.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2011 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-r4.ebuild,v 1.1 2011/08/13 15:38:31 nelchael Exp $ + +EAPI="2" + +inherit eutils autotools + +MY_P=${P/_/} +DEB_VER="8" +DESCRIPTION="Lightweight NTP server ported from OpenBSD" +HOMEPAGE="http://www.openntpd.org/" +SRC_URI="mirror://openbsd/OpenNTPD/${MY_P}.tar.gz + mirror://debian/pool/main/o/openntpd/${MY_P/-/_}+debian-${DEB_VER}.debian.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 + !net-misc/ntp[-openntpd]" +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 when flipping between + # the standard ntp pkg and this one + usermod -d /var/lib/openntpd/chroot ntp +} + +src_prepare() { + sed -i '/NTPD_USER/s:_ntp:ntp:' ntpd.h || die + + epatch "${WORKDIR}"/debian/patches/*.patch + sed -i 's:debian:gentoo:g' ntpd.conf || die + eautoreconf # deb patchset touches .ac files and such +} + +src_configure() { + econf \ + --disable-strip \ + --with-adjtimex \ + $(use_with !ssl builtin-arc4random) +} + +src_install() { + emake install DESTDIR="${D}" || die + dodoc ChangeLog CREDITS README + + newinitd "${FILESDIR}/openntpd.init.d-${PVR}" ntpd + newconfd "${FILESDIR}/openntpd.conf.d-${PVR}" ntpd +} |