Index: head/comms/chu/Makefile =================================================================== --- head/comms/chu/Makefile (revision 506612) +++ head/comms/chu/Makefile (revision 506613) @@ -1,36 +1,39 @@ # Created by: Diane Bruce # $FreeBSD$ PORTNAME= chu PORTVERSION= 0.1.29 CATEGORIES= comms hamradio MASTER_SITES= SUNSITE/system/admin/time MAINTAINER= hamradio@FreeBSD.org COMMENT= Synchronise computer clock to CHU radio station -LICENSE= GPLv1 +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING NO_WRKSUBDIR= yes OPTIONS_DEFINE= DOCS post-extract: @${GZIP_CMD} -d ${WRKSRC}/testsignal.gz post-patch: @${REINPLACE_CMD} -e 's|/etc/chu|${PREFIX}/etc/chu|g' ${WRKSRC}/chu.c ${WRKSRC}/chu.8 @${REINPLACE_CMD} -e 's|/sbin/chu|${PREFIX}/sbin/chu|g' ${WRKSRC}/chu.8 @${REINPLACE_CMD} -e 's|gcc -O2|${CC} ${CFLAGS}|g' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/chu ${STAGEDIR}${PREFIX}/sbin - ${MKDIR} ${STAGEDIR}${DATADIR} + @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/testsignal ${STAGEDIR}${DATADIR} ${INSTALL_MAN} ${WRKSRC}/chu.8 ${STAGEDIR}${PREFIX}/man/man8 - ${MKDIR} ${STAGEDIR}${DOCSDIR} -.for d in COPYING TESTING chu.html chuman.html ntp.html + +do-install-DOCS-on: + @${MKDIR} ${STAGEDIR}${DOCSDIR} +.for d in TESTING chu.html chuman.html ntp.html ${INSTALL_DATA} ${WRKSRC}/${d} ${STAGEDIR}${DOCSDIR} .endfor .include Index: head/comms/chu/files/patch-chu.c =================================================================== --- head/comms/chu/files/patch-chu.c (revision 506612) +++ head/comms/chu/files/patch-chu.c (revision 506613) @@ -1,104 +1,104 @@ ---- chu.c.orig 1999-03-17 11:42:18.000000000 -0500 -+++ chu.c 2011-07-01 08:42:06.000000000 -0400 +--- chu.c.orig 1999-03-17 16:42:18 UTC ++++ chu.c @@ -20,15 +20,21 @@ #include #include #include +#include +#include #include #include #include -#define USE_TIMEX +#define ADJTIME +#undef USE_TIMEX +#define USE_ADJTIME + +#ifdef ADJTIME #ifdef USE_TIMEX #include #endif - +#endif #define SAMPLE_RATE 8000 #define SAMPLES 512 #define OVERLAP 50 -@@ -389,6 +395,21 @@ +@@ -389,6 +395,21 @@ void saveAdjTime() } } +#ifdef USE_ADJTIME +void +do_adjtime(int microsec) +{ + struct timeval delta; + int status; + + printf("do_adjtime adjustment: %d\n", microsec); + delta.tv_sec = 0; + delta.tv_usec = microsec; + status = adjtime(&delta, NULL); + printf("do_adjtime status: %d\n", status); +} +#endif + #ifdef USE_TIMEX void timex_adjustment(int microsec) { -@@ -462,7 +483,8 @@ +@@ -462,7 +483,8 @@ double gettimexoffset() adjtimex(&t); offset = t.offset; #endif - +#ifdef USE_ADJTIME +#endif return (double) offset; } -@@ -655,13 +677,18 @@ +@@ -655,13 +677,18 @@ void adj_time(double d) tv.tv_usec += 1000000; } +#ifdef ADJTIME #ifdef USE_TIMEX if (fabs(d) < ((double)MAXPHASE)) { timex_adjustment((int)-d); } +#else + if (fabs(d) < ((double)1000000)) + do_adjtime((int)-d); else #endif +#endif { printf("standard adjustment "); -@@ -1267,7 +1294,7 @@ +@@ -1267,7 +1294,7 @@ char *parseArgs(int argc, char **argv) return fname; } -void main(int argc, char **argv) +int main(int argc, char **argv) { FILE *fp; signed char buf[8192]; -@@ -1278,7 +1305,7 @@ +@@ -1278,7 +1305,7 @@ void main(int argc, char **argv) fname = parseArgs(argc, argv); if (fname == NULL) - return; + return 0; /* Set priority to maximum -- just long enough for us to open the audio device and timestamp it. This should -@@ -1293,7 +1320,7 @@ +@@ -1293,7 +1320,7 @@ void main(int argc, char **argv) if (fp == NULL) { printf("fopen(): Unable to open file: %s %s\n", fname, strerror(errno)); - return; + return 0; } gettimeofday(&starttime, &tz); Index: head/comms/chu/pkg-descr =================================================================== --- head/comms/chu/pkg-descr (revision 506612) +++ head/comms/chu/pkg-descr (revision 506613) @@ -1,6 +1,6 @@ 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/ +WWW: https://www.rossi.com/chu/ Index: head/comms/chu/pkg-plist =================================================================== --- head/comms/chu/pkg-plist (revision 506612) +++ head/comms/chu/pkg-plist (revision 506613) @@ -1,8 +1,7 @@ sbin/chu %%DATADIR%%/testsignal -%%PORTDOCS%%%%DOCSDIR%%/COPYING %%PORTDOCS%%%%DOCSDIR%%/chu.html %%PORTDOCS%%%%DOCSDIR%%/chuman.html %%PORTDOCS%%%%DOCSDIR%%/ntp.html %%PORTDOCS%%%%DOCSDIR%%/TESTING man/man8/chu.8.gz