summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Gavin <pete@gentoo.org>2001-05-01 17:20:56 +0000
committerPeter Gavin <pete@gentoo.org>2001-05-01 17:20:56 +0000
commit054fc2424b56506ae0864532e788d3f455c45e46 (patch)
tree6a0cdb2aad602df1826ad85feeb022ecfc2c6580 /net-misc/clockspeed
parent*** empty log message *** (diff)
downloadgentoo-2-054fc2424b56506ae0864532e788d3f455c45e46.tar.gz
gentoo-2-054fc2424b56506ae0864532e788d3f455c45e46.tar.bz2
gentoo-2-054fc2424b56506ae0864532e788d3f455c45e46.zip
added ntpclockset script to clockspeed package
Diffstat (limited to 'net-misc/clockspeed')
-rw-r--r--net-misc/clockspeed/clockspeed-0.62-r1.ebuild38
-rwxr-xr-xnet-misc/clockspeed/files/ntpclockset-0.62-r131
2 files changed, 69 insertions, 0 deletions
diff --git a/net-misc/clockspeed/clockspeed-0.62-r1.ebuild b/net-misc/clockspeed/clockspeed-0.62-r1.ebuild
new file mode 100644
index 000000000000..ce31efe99c40
--- /dev/null
+++ b/net-misc/clockspeed/clockspeed-0.62-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Your Name <your email>
+# $Header: /var/cvsroot/gentoo-x86/net-misc/clockspeed/clockspeed-0.62-r1.ebuild,v 1.1 2001/05/01 17:20:56 pete Exp $
+
+#P=
+A=${P}.tar.gz
+S=${WORKDIR}/${P}
+DESCRIPTION="a simple ntp client"
+SRC_URI="http://cr.yp.to/clockspeed/clockspeed-0.62.tar.gz"
+HOMEPAGE="http://cr.yp.to/"
+
+DEPEND="virtual/glibc"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${PF}-gentoo.diff
+ cp -a conf-cc conf-cc.orig
+ sed "s/@CFLAGS@/${CFLAGS}/" < conf-cc.orig > conf-cc
+}
+
+src_compile() {
+ try make
+}
+
+src_install () {
+ dodir /etc /usr/bin /usr/share/man/man1
+ insinto /etc
+ doins leapsecs.dat
+
+ into /usr
+ dobin clockspeed clockadd clockview sntpclock taiclock taiclockd
+ doman clockspeed.1 clockadd.1 clockview.1 sntpclock.1 taiclock.1 taiclockd.1
+ install -o root -g root -m 0700 ${FILESDIR}/ntpclockset-${PVR} ${D}/usr/sbin/ntpclockset
+
+ dodoc BLURB CHANGES README THANKS TODO
+}
diff --git a/net-misc/clockspeed/files/ntpclockset-0.62-r1 b/net-misc/clockspeed/files/ntpclockset-0.62-r1
new file mode 100755
index 000000000000..6657da712b33
--- /dev/null
+++ b/net-misc/clockspeed/files/ntpclockset-0.62-r1
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+if [ -z "${1}" ]
+then
+ NTPSERVER=132.163.135.130
+else
+ NTPSERVER="${1}"
+fi
+
+#display how much your clock is off by
+sntpclock $NTPSERVER > /tmp/sntpclock
+
+if [ "${?}" != "0" ]
+then
+ echo ">>> Could not contact NTP server: $NTPSERVER" >&2
+ exit 1
+fi
+
+echo ">>> Current clock sync:"
+cat /tmp/sntpclock | clockview
+echo
+echo -n ">>> Now setting clock..."
+cat /tmp/sntpclock | clockadd
+echo " done."
+#wite data to the hardware clock so it survives a reboot
+echo -n ">>> Writing time to hardware clock..."
+hwclock --systohc
+echo " done."
+echo
+echo ">>> New clock sync:"
+sntpclock $NTPSERVER | clockview