ports/74340: New port: sysutils/pcfclock - userland access to the pcfclock device

Frank W. Josellis frank at dynamical-systems.org
Wed Nov 24 22:30:32 UTC 2004


>Number:         74340
>Category:       ports
>Synopsis:       New port: sysutils/pcfclock - userland access to the pcfclock device
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 24 22:30:31 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Frank W. Josellis
>Release:        FreeBSD 4.10-STABLE i386
>Organization:
none 
>Environment:
System: FreeBSD achilles.tractrix.org 4.10-STABLE FreeBSD 4.10-STABLE #0: Sun Oct 3 22:22:17 CEST 2004 root@:/usr/obj/usr/src/sys/ACHILLES i386

>Description:
This port provides the pcfdate utility which reads the time of day from a
pcfclock device, writes it to stdout or, optionally, sets the system time. 

You can benefit from pcfdate in case that

 - your geographic location is in Central Europe within a radius of roughly
   1500 km from the DCF77 transmitter near Frankfurt/Main, Germany,

 - you have the Conrad parallel port radio clock attached to your machine,

 - you have the pcfclock device driver enabled in your kernel configuration.

The primary use of pcfdate is to initialize the system time on boot. In its
normal operation the Conrad clock synchronizes with the transmitter once a
day, and the time of day displayed refers to its internal quartz clock
which,
however, suffers from a considerable drift. The resulting accumulated error
can reach about 0.6 sec after 24 hours. Combined with the clockspeed port
this can still be considered a useful initialization: sntpclock can later be
used to gradually adjust the system time with the global network time very
effectively within a few minutes.

WWW: http://www-stud.ims.uni-stuttgart.de/~voegelas/pcf.html

>How-To-Repeat:

>Fix:

--- pcfclock-0.44.shar begins here ---
# 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:
#
#	sysutils/pcfclock
#	sysutils/pcfclock/files
#	sysutils/pcfclock/files/patch-pcfdate_pcfdate.c
#	sysutils/pcfclock/Makefile
#	sysutils/pcfclock/distinfo
#	sysutils/pcfclock/pkg-descr
#	sysutils/pcfclock/pkg-install
#	sysutils/pcfclock/pkg-plist
#
echo c - sysutils/pcfclock
mkdir -p sysutils/pcfclock > /dev/null 2>&1
echo c - sysutils/pcfclock/files
mkdir -p sysutils/pcfclock/files > /dev/null 2>&1
echo x - sysutils/pcfclock/files/patch-pcfdate_pcfdate.c
sed 's/^X//' >sysutils/pcfclock/files/patch-pcfdate_pcfdate.c << 'END-of-sysutils/pcfclock/files/patch-pcfdate_pcfdate.c'
X--- pcfdate/pcfdate.c.orig	Tue Apr 20 07:26:04 2004
X+++ pcfdate/pcfdate.c	Tue Nov 23 23:16:23 2004
X@@ -162,16 +162,23 @@
X 		char buf[256];
X 
X 		tp = localtime(&newtime);
X-		strftime(buf, sizeof(buf), "%c", tp);
X-		fprintf(stdout, "%s\n", buf);
X+		strftime(buf, sizeof(buf), "%+", tp);
X+		fprintf(stdout, "%s", buf);
X 		if (verbose) {
X+		  /*
X 			fprintf(stdout, " - DST: \t%s\n", (
X 				(timecode[8]&3)==1 ? "Yes" :
X 				((timecode[8]&3)==2 ? "No" : "unknown" ))
X 			);
X 			fprintf(stdout, " - Sync:\t%s\n", (timecode[1] & 1 ? "Error" : "Ok"));
X 			fprintf(stdout, " - Battery:\t%s\n", (timecode[8] & 4 ? "Replace" : "Ok"));
X+		  */
X+		  /* Not too verbose: */
X+		  fprintf(stdout," [Sync: %s, Battery: %s]",
X+			 (timecode[1] & 1 ? "Error" : "Ok"),
X+			 (timecode[8] & 4 ? "Replace" : "Ok"));
X 		}
X+		fprintf(stdout, "\n");
X 	}
X 
X 	return 0;
END-of-sysutils/pcfclock/files/patch-pcfdate_pcfdate.c
echo x - sysutils/pcfclock/Makefile
sed 's/^X//' >sysutils/pcfclock/Makefile << 'END-of-sysutils/pcfclock/Makefile'
X# New ports collection makefile for:	pcfclock
X# Date created:				23 November 2004
X# Whom:					Frank W. Josellis <frank at dynamical-systems.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	pcfclock
XPORTVERSION=	0.44
XCATEGORIES=	sysutils
XMASTER_SITES=	http://www-stud.ims.uni-stuttgart.de/~voegelas/pcfclock/
X
XMAINTAINER=	frank at dynamical-systems.org
XCOMMENT=	Userland access to the pcfclock device
X
XGNU_CONFIGURE=	yes
XCONFIGURE_ARGS= --without-linux
X
X.include <bsd.port.pre.mk>
X
Xpost-install:
X.if ${OSVERSION} < 500000
X	${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
X.endif
X
X.include <bsd.port.post.mk>
END-of-sysutils/pcfclock/Makefile
echo x - sysutils/pcfclock/distinfo
sed 's/^X//' >sysutils/pcfclock/distinfo << 'END-of-sysutils/pcfclock/distinfo'
XMD5 (pcfclock-0.44.tar.gz) = 35f436caf4e6adb077b72bb49d5af3bb
XSIZE (pcfclock-0.44.tar.gz) = 89914
END-of-sysutils/pcfclock/distinfo
echo x - sysutils/pcfclock/pkg-descr
sed 's/^X//' >sysutils/pcfclock/pkg-descr << 'END-of-sysutils/pcfclock/pkg-descr'
XThis port provides the pcfdate utility which reads the time of day from a
Xpcfclock device, writes it to stdout or, optionally, sets the system time. 
X
XYou can benefit from pcfdate in case that
X
X - your geographic location is in Central Europe within a radius of roughly
X   1500 km from the DCF77 transmitter near Frankfurt/Main, Germany,
X
X - you have the Conrad parallel port radio clock attached to your machine,
X
X - you have the pcfclock device driver enabled in your kernel configuration.
X
XThe primary use of pcfdate is to initialize the system time on boot. In its
Xnormal operation the Conrad clock synchronizes with the transmitter once a
Xday, and the time of day displayed refers to its internal quartz clock which,
Xhowever, suffers from a considerable drift. The resulting accumulated error
Xcan reach about 0.6 sec after 24 hours. Combined with the clockspeed port
Xthis can still be considered a useful initialization: sntpclock can later be
Xused to gradually adjust the system time with the global network time very
Xeffectively within a few minutes.
X
XWWW: http://www-stud.ims.uni-stuttgart.de/~voegelas/pcf.html
END-of-sysutils/pcfclock/pkg-descr
echo x - sysutils/pcfclock/pkg-install
sed 's/^X//' >sysutils/pcfclock/pkg-install << 'END-of-sysutils/pcfclock/pkg-install'
X#!/bin/sh
X
Xcase $2 in
X    POST-INSTALL)
X    [ -c /dev/pcfclock0 ] || ( cd /dev && ./MAKEDEV pcfclock0 )
X    ;;
Xesac
END-of-sysutils/pcfclock/pkg-install
echo x - sysutils/pcfclock/pkg-plist
sed 's/^X//' >sysutils/pcfclock/pkg-plist << 'END-of-sysutils/pcfclock/pkg-plist'
Xsbin/pcfdate
Xman/man8/pcfdate.8
END-of-sysutils/pcfclock/pkg-plist
exit
--- pcfclock-0.44.shar ends here ---


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



More information about the freebsd-ports-bugs mailing list