Skip site navigation (1)Skip section navigation (2)
Date:      17 Jun 2000 03:45:03 -0000
From:      "Mario Sergio Fujikawa Ferreira" <lioux@uol.com.br>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/19349: New port net/clockspeed depends upon ports/19348
Message-ID:  <20000617034503.908.qmail@Fedaykin.here>

next in thread | raw e-mail | index | archive | help

>Number:         19349
>Category:       ports
>Synopsis:       New port net/clockspeed depends upon ports/19348
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 16 20:50:04 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mario Sergio Fujikawa Ferreira
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

FreeBSD Here.here 4.0-STABLE FreeBSD 4.0-STABLE #2: Fri Jun  9 13:22:10 EST 2000     lioux@Here.here:/usr/src/sys/compile/LIOUX  i386

>Description:

Uses a hardware tick counter to compensate for deviant system clock
Depends upon ports/19348

>How-To-Repeat:

n/a

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	clockspeed
#	clockspeed/files
#	clockspeed/files/md5
#	clockspeed/files/patch-aa
#	clockspeed/pkg
#	clockspeed/pkg/COMMENT
#	clockspeed/pkg/DESCR
#	clockspeed/pkg/PLIST
#	clockspeed/Makefile
#	clockspeed/patches
#	clockspeed/patches/patch-aa
#	clockspeed/patches/patch-ab
#	clockspeed/patches/patch-ac
#
echo c - clockspeed
mkdir -p clockspeed > /dev/null 2>&1
echo c - clockspeed/files
mkdir -p clockspeed/files > /dev/null 2>&1
echo x - clockspeed/files/md5
sed 's/^X//' >clockspeed/files/md5 << 'END-of-clockspeed/files/md5'
XMD5 (clockspeed-0.62.tar.gz) = 425614174fcfe2ad42d22d3d02e2d567
END-of-clockspeed/files/md5
echo x - clockspeed/files/patch-aa
sed 's/^X//' >clockspeed/files/patch-aa << 'END-of-clockspeed/files/patch-aa'
X--- INSTALL.orig	Fri Jun 16 23:36:18 2000
X+++ INSTALL	Fri Jun 16 23:46:18 2000
X@@ -5,7 +5,7 @@
X Things you have to decide before starting:
X 
X * Where the clockspeed package will be installed, normally
X-/usr/local/clockspeed. To change this directory, edit conf-home now.
X+PREFIX. To change this directory, edit conf-home now.
X 
X 
X How to install:
X@@ -16,9 +16,9 @@
X     or with gethrtime(). The compiler must support a 64-bit type, either
X     long or long long.
X 
X- 2. Install the programs, the man pages, and /etc/leapsecs.dat:
X+ 2. Install the programs, the man pages, and PREFIX/etc/leapsecs.dat:
X        # make setup check
X-    Put /usr/local/clockspeed/bin into $PATH.
X+    Put PREFIX/bin into $PATH.
X 
X 
X How to test:
X@@ -39,20 +39,20 @@
X  5. Start clockspeed:
X        # clockspeed &
X     Give clockspeed a time measurement:
X-       # sntpclock 1.2.3.4 > /usr/local/clockspeed/adjust &
X+       # sntpclock 1.2.3.4 > PREFIX/etc/clockspeed/adjust &
X 
X  6. After a few hours, give clockspeed a second time measurement:
X-       # sntpclock 1.2.3.4 > /usr/local/clockspeed/adjust &
X+       # sntpclock 1.2.3.4 > PREFIX/etc/clockspeed/adjust &
X     You can run sntpclock as a non-root user, if you change
X-    /usr/local/clockspeed/adjust to be owned by that user. I recommend
X+    PREFIX/etc/clockspeed/adjust to be owned by that user. I recommend
X     this for security.
X 
X  7. After a few days, check how well clockspeed has adjusted your clock:
X        % sntpclock 1.2.3.4 | clockview
X     Check how many attoseconds clockspeed thinks are in one tick:
X-       % clockview < /usr/local/clockspeed/etc/atto
X+       % clockview < PREFIX/etc/clockspeed/atto
X     Give it another time measurement:
X-       # sntpclock 1.2.3.4 > /usr/local/clockspeed/adjust &
X+       # sntpclock 1.2.3.4 > PREFIX/etc/clockspeed/adjust &
X 
X  8. Repeat step 7 after a few weeks, then after a few months. Your clock
X     should now be synchronized to the remote clock to within a few
X@@ -70,7 +70,7 @@
X     Here 5.6.7.8 is the master's IP address. Set the client's clock:
X        # clockadd < adjustment
X     Finally, run clockspeed as in step 5, and do
X-       % taiclock 5.6.7.8 > /usr/local/clockspeed/adjust &
X+       % taiclock 5.6.7.8 > PREFIX/etc/clockspeed/adjust &
X     after a few days.
X 
X 
END-of-clockspeed/files/patch-aa
echo c - clockspeed/pkg
mkdir -p clockspeed/pkg > /dev/null 2>&1
echo x - clockspeed/pkg/COMMENT
sed 's/^X//' >clockspeed/pkg/COMMENT << 'END-of-clockspeed/pkg/COMMENT'
XUses a hardware tick counter to compensate for deviant system clock
END-of-clockspeed/pkg/COMMENT
echo x - clockspeed/pkg/DESCR
sed 's/^X//' >clockspeed/pkg/DESCR << 'END-of-clockspeed/pkg/DESCR'
Xclockspeed uses a hardware tick counter to compensate for a persistently
Xfast or slow system clock. Given a few time measurements from a reliable
Xsource, it computes and then eliminates the clock skew.
X
Xsntpclock checks another system's NTP clock, and prints the results in a
Xformat suitable for input to clockspeed. sntpclock is the simplest
Xavailable NTP/SNTP client.
X
Xtaiclock and taiclockd form an even simpler alternative to SNTP. They
Xare suitable for precise time synchronization over a local area network,
Xwithout the hassles and potential security problems of an NTP server.
X
XThis version of clockspeed can use the Pentium RDTSC tick counter or the
XSolaris gethrtime() nanosecond counter.
X
XWWW: http://cr.yp.to/clockspeed.html
END-of-clockspeed/pkg/DESCR
echo x - clockspeed/pkg/PLIST
sed 's/^X//' >clockspeed/pkg/PLIST << 'END-of-clockspeed/pkg/PLIST'
Xbin/clockadd
Xbin/clockspeed
Xbin/clockview
Xbin/sntpclock
Xbin/taiclock
Xbin/taiclockd
X%%PORTDOCS:%%share/doc/clockspeed/INSTALL
X%%PORTDOCS:%%@dirrm share/doc/clockspeed
X@mode 0755
X@exec mkdir %D/etc/clockspeed
X@unexec rm %D/etc/clockspeed/atto.tmp 2>/dev/null || true
X@unexec rm %D/etc/clockspeed/atto 2>/dev/null || true
X@unexec rmdir %D/etc/clockspeed 2>/dev/null || true
END-of-clockspeed/pkg/PLIST
echo x - clockspeed/Makefile
sed 's/^X//' >clockspeed/Makefile << 'END-of-clockspeed/Makefile'
X# New ports collection makefile for: clockspeed
X# Date created:		16 June 2000
X# Whom:			Mario S F Ferreira <lioux@linf.unb.br> et al.
X#
X# $FreeBSD$
X#
X
XPORTNAME=	clockspeed
XPORTVERSION=	0.62
XCATEGORIES=	net
XMASTER_SITES=	http://cr.yp.to/clockspeed/
X
XMAINTAINER=	lioux@linf.unb.br
X
XLIB_DEPENDS=	tai.1:${PORTSDIR}/devel/libtai
X
XEXTRA_PATCHES=	${WRKDIR}/patch-aa
XALL_TARGET=	it
XINSTALL_TARGET=	setup check
X
XMAN1=	clockadd.1 clockspeed.1 clockview.1 sntpclock.1 \
X	taiclock.1 taiclockd.1
X
X.if defined(NOPORTDOCS)
XPLIST_SUB+=     PORTDOCS:="@comment "
X.else
XPLIST_SUB+=     PORTDOCS:=
X.endif # !defined(NOPORTDOCS)
X
Xdo-configure:
X	@${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
X	@${ECHO} ${CC} -s -L${LOCALBASE}/lib > ${WRKSRC}/conf-ld
X	@${ECHO} ${PREFIX} > ${WRKSRC}/conf-home
X
Xpre-patch:
X	@${SED} s!PREFIX!${PREFIX}! ${FILESDIR}/patch-aa > \
X		${WRKDIR}/patch-aa
X
Xpost-install:
X.if !defined(NOPORTDOCS)
X	@${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755 \
X		${PREFIX}/share/doc/clockspeed
X	@${INSTALL_DATA} ${WRKSRC}/INSTALL ${PREFIX}/share/doc/clockspeed
X.endif
X	@${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m 755 \
X		${PREFIX}/etc/clockspeed
X
X.include <bsd.port.mk>
END-of-clockspeed/Makefile
echo c - clockspeed/patches
mkdir -p clockspeed/patches > /dev/null 2>&1
echo x - clockspeed/patches/patch-aa
sed 's/^X//' >clockspeed/patches/patch-aa << 'END-of-clockspeed/patches/patch-aa'
X--- Makefile.orig	Fri Jun 16 22:21:58 2000
X+++ Makefile	Fri Jun 16 22:23:28 2000
X@@ -293,10 +293,10 @@
X 	chmod 400 shar
X 
X sntpclock: \
X-load sntpclock.o ip.o libtai.a strerr.a substdio.a error.a str.a fs.a \
X+load sntpclock.o ip.o strerr.a substdio.a error.a str.a fs.a \
X socket.lib
X-	./load sntpclock ip.o libtai.a strerr.a substdio.a error.a \
X-	str.a fs.a  `cat socket.lib`
X+	./load sntpclock ip.o strerr.a substdio.a error.a \
X+	str.a fs.a  `cat socket.lib` -ltai
X 
X sntpclock.0: \
X sntpclock.1
X@@ -406,10 +406,10 @@
X 	./compile taia_unpack.c
X 
X taiclock: \
X-load taiclock.o ip.o libtai.a strerr.a substdio.a error.a str.a fs.a \
X+load taiclock.o ip.o strerr.a substdio.a error.a str.a fs.a \
X socket.lib
X-	./load taiclock ip.o libtai.a strerr.a substdio.a error.a \
X-	str.a fs.a  `cat socket.lib`
X+	./load taiclock ip.o strerr.a substdio.a error.a \
X+	str.a fs.a  `cat socket.lib` -ltai
X 
X taiclock.0: \
X taiclock.1
X@@ -421,10 +421,10 @@
X 	./compile taiclock.c
X 
X taiclockd: \
X-load taiclockd.o libtai.a strerr.a substdio.a error.a str.a \
X+load taiclockd.o strerr.a substdio.a error.a str.a \
X socket.lib
X-	./load taiclockd libtai.a strerr.a substdio.a error.a \
X-	str.a  `cat socket.lib`
X+	./load taiclockd strerr.a substdio.a error.a \
X+	str.a  `cat socket.lib` -ltai
X 
X taiclockd.0: \
X taiclockd.1
END-of-clockspeed/patches/patch-aa
echo x - clockspeed/patches/patch-ab
sed 's/^X//' >clockspeed/patches/patch-ab << 'END-of-clockspeed/patches/patch-ab'
X--- hier.c.orig	Fri Jun 16 23:14:45 2000
X+++ hier.c	Fri Jun 16 23:15:27 2000
X@@ -2,16 +2,6 @@
X 
X void hier()
X {
X-  c("/","etc","leapsecs.dat",-1,-1,0644);
X-
X-  h(auto_home,-1,-1,0755);
X-
X-  d(auto_home,"etc",-1,-1,0755);
X-  d(auto_home,"bin",-1,-1,0755);
X-  d(auto_home,"man",-1,-1,0755);
X-  d(auto_home,"man/man1",-1,-1,0755);
X-  d(auto_home,"man/cat1",-1,-1,0755);
X-
X   c(auto_home,"bin","clockspeed",-1,-1,0755);
X   c(auto_home,"bin","clockadd",-1,-1,0755);
X   c(auto_home,"bin","clockview",-1,-1,0755);
END-of-clockspeed/patches/patch-ab
echo x - clockspeed/patches/patch-ac
sed 's/^X//' >clockspeed/patches/patch-ac << 'END-of-clockspeed/patches/patch-ac'
X--- clockspeed.c.orig	Fri Jun 16 23:37:32 2000
X+++ clockspeed.c	Fri Jun 16 23:38:10 2000
X@@ -83,7 +83,7 @@
X   if (deriv <= 0) return;
X   if (deriv > 200000000) return; /* 5Hz ticks? be serious */
X 
X-  fd = open_trunc("etc/atto.tmp");
X+  fd = open_trunc("etc/clockspeed/atto.tmp");
X   if (fd == -1) return;
X 
X   buf[0] = 0;
X@@ -119,7 +119,7 @@
X   if (fsync(fd) == -1) { close(fd); return; }
X   if (close(fd) == -1) return; /* NFS stupidity */
X 
X-  rename("etc/atto.tmp","etc/atto"); /* if it fails, bummer */
X+  rename("etc/clockspeed/atto.tmp","etc/clockspeed/atto"); /* if it fails, bummer */
X }
X 
X void main()
X@@ -136,7 +136,7 @@
X   if (chdir(auto_home) == -1) _exit(1);
X   umask(033);
X 
X-  if (open_read("etc/atto") == 0) {
X+  if (open_read("etc/clockspeed/atto") == 0) {
X     r = read(0,buf,sizeof buf);
X     if (r == sizeof buf)
X       deriv = nano(buf);
END-of-clockspeed/patches/patch-ac
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000617034503.908.qmail>