ports/103369: [NEW PORT] comms/chu: Synchronise computer clock to CHU radio station

Diane Bruce db at db.net
Mon Sep 18 22:00:48 UTC 2006


>Number:         103369
>Category:       ports
>Synopsis:       [NEW PORT] comms/chu: Synchronise computer clock to CHU radio station
>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:   Mon Sep 18 22:00:37 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Diane Bruce
>Release:        FreeBSD 4.11-RELEASE-p9 i386
>Organization:
none
>Environment:
System: FreeBSD heceta.db.net 4.11-RELEASE-p9 FreeBSD 4.11-RELEASE-p9 #4: Tue May 17 16:07:52 EDT 2005
>Description:
CHU is a time-standard shortwave radio station operated by National
Research Council Canada (NRC). This software uses signals from radio
station CHU to set and frequency discipline the system clock on a
Linux (FreeBSD) based system.

WWW: http://www.rossi.com/chu/

- Diane Bruce, VA3DB <db at db.net>

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- chu-0.1.29.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:
#
#	chu
#	chu/distinfo
#	chu/files
#	chu/files/patch-chu.c
#	chu/Makefile
#	chu/pkg-plist
#	chu/pkg-descr
#
echo c - chu
mkdir -p chu > /dev/null 2>&1
echo x - chu/distinfo
sed 's/^X//' >chu/distinfo << 'END-of-chu/distinfo'
XMD5 (chu-0.1.29.tar.gz) = d8bc38f64d386240dd445993a1a646e3
XSHA256 (chu-0.1.29.tar.gz) = ac791bb2c9f80ec393f8cc7ddb833974e1f3b03960a73a206011256f4a4e8e72
XSIZE (chu-0.1.29.tar.gz) = 44441
END-of-chu/distinfo
echo c - chu/files
mkdir -p chu/files > /dev/null 2>&1
echo x - chu/files/patch-chu.c
sed 's/^X//' >chu/files/patch-chu.c << 'END-of-chu/files/patch-chu.c'
X--- chu.c.orig	Wed Mar 17 11:42:18 1999
X+++ chu.c	Mon Sep 18 17:46:42 2006
X@@ -20,15 +20,21 @@
X #include <stdlib.h>
X #include <string.h>
X #include <math.h>
X+#include <errno.h>
X+#include <sys/types.h>
X #include <sys/time.h>
X #include <sys/resource.h>
X #include <unistd.h>
X 
X-#define USE_TIMEX
X+#define ADJTIME
X+#undef USE_TIMEX
X+#define USE_ADJTIME
X+
X+#ifdef ADJTIME
X #ifdef USE_TIMEX
X #include <sys/timex.h>
X #endif
X-
X+#endif
X #define SAMPLE_RATE 8000
X #define SAMPLES 512
X #define OVERLAP 50
X@@ -389,6 +395,21 @@
X   }
X }
X 
X+#ifdef USE_ADJTIME
X+void
X+do_adjtime(int microsec)
X+{
X+  struct timeval delta;
X+  int status;
X+
X+  printf("do_adjtime adjustment: %d\n", microsec);
X+  delta.tv_sec = 0;
X+  delta.tv_usec = microsec;
X+  status = adjtime(&delta, NULL);
X+  printf("do_adjtime status: %d\n", status);
X+}
X+#endif
X+
X #ifdef USE_TIMEX
X void timex_adjustment(int microsec)
X {
X@@ -462,7 +483,8 @@
X   adjtimex(&t);
X   offset = t.offset;
X #endif
X-
X+#ifdef USE_ADJTIME
X+#endif
X   return (double) offset; 
X }
X 
X@@ -655,12 +677,17 @@
X     tv.tv_usec += 1000000;
X   }
X 
X+#ifdef ADJTIME
X #ifdef USE_TIMEX
X   if (fabs(d) < ((double)MAXPHASE))
X   {
X     timex_adjustment((int)-d);
X   }
X+#else
X+  if (fabs(d) < ((double)1000000))
X+    do_adjtime((int)-d);
X   else
X+#endif
X #endif
X   {
X     printf("standard adjustment ");
END-of-chu/files/patch-chu.c
echo x - chu/Makefile
sed 's/^X//' >chu/Makefile << 'END-of-chu/Makefile'
X# New ports collection makefile for:	chu
X# Date created:				September 16 2006
X# Whom:					Diane Bruce <db at db.net
X#
X# $FreeBSD:$
X#
X
XPORTNAME=	chu
XPORTVERSION=	0.1.29
XCATEGORIES=	comms hamradio
XMASTER_SITES=	${MASTER_SITE_SUNSITE} \
X		http://www.rossi.com/chu/
XMASTER_SITE_SUBDIR=	system/admin/time
X
XMAINTAINER=	db at db.net
XCOMMENT=	Synchronise computer clock to CHU radio station
X
Xdo-extract:
X	@${RM} -rf ${WRKDIR}
X	@${MKDIR} ${WRKDIR}
X	@${MKDIR} ${WRKSRC}
X	@for f in ${EXTRACT_ONLY}; do  \
X		if ! (cd ${WRKSRC} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$f ${EXTRACT_AFTER_ARGS});\
X		then \
X			exit 1; \
X		fi \
X	done
X	${EXTRACT_CMD} -d ${WRKSRC}/testsignal.gz
X
Xpost-patch:
X	${REINPLACE_CMD} -e 's|/etc/chu|${PREFIX}/etc/chu|g' ${WRKSRC}/chu.c ${WRKSRC}/chu.8
X	${REINPLACE_CMD} -e 's|/sbin/chu|${PREFIX}/sbin/chu|g' ${WRKSRC}/chu.8
X	@${REINPLACE_CMD} -e 's|gcc -O2|${CC} ${CFLAGS}|g' ${WRKSRC}/Makefile
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/chu ${PREFIX}/sbin
X	${MKDIR} ${DATADIR}
X	${INSTALL_DATA} ${WRKSRC}/testsignal ${DATADIR}
X	${INSTALL_MAN} ${WRKSRC}/chu.8 ${PREFIX}/man/man8
X.if	!defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X.for	d in ${WRKSRC}/COPYING \
X	${WRKSRC}/TESTING \
X	${WRKSRC}/chu.html \
X	${WRKSRC}/chuman.html \
X	${WRKSRC}/ntp.html
X	${INSTALL_DATA} ${WRKSRC}/${d} ${DOCSDIR}
X.endfor
X	@${ECHO} ""
X	@${ECHO} "chu docs installed in ${DOCSDIR}"
X	@${ECHO} ""
X.endif
X
XMAN8=	chu.8
X
X.include <bsd.port.mk>
END-of-chu/Makefile
echo x - chu/pkg-plist
sed 's/^X//' >chu/pkg-plist << 'END-of-chu/pkg-plist'
Xsbin/chu
X%%DATADIR%%/testsignal
X%%PORTDOCS%%%%DOCSDIR%%/COPYING
X%%PORTDOCS%%%%DOCSDIR%%/chu.html
X%%PORTDOCS%%%%DOCSDIR%%/chuman.html
X%%PORTDOCS%%%%DOCSDIR%%/ntp.html
X%%PORTDOCS%%%%DOCSDIR%%/TESTING
X at dirrm %%DATADIR%%
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
END-of-chu/pkg-plist
echo x - chu/pkg-descr
sed 's/^X//' >chu/pkg-descr << 'END-of-chu/pkg-descr'
XCHU is a time-standard shortwave radio station operated by National
XResearch Council Canada (NRC). This software uses signals from radio
Xstation CHU to set and frequency discipline the system clock on a
XLinux (FreeBSD) based system.
X
XWWW: http://www.rossi.com/chu/
X
X- Diane Bruce, VA3DB <db at db.net>
END-of-chu/pkg-descr
exit
--- chu-0.1.29.shar ends here ---

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



More information about the freebsd-ports-bugs mailing list