[Midnightbsd-cvs] mports: mports/comms: add chu

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Aug 17 17:45:17 EDT 2008


Log Message:
-----------
add chu

Modified Files:
--------------
    mports/comms:
        Makefile (r1.15 -> r1.16)

Added Files:
-----------
    mports/comms/chu:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-plist (r1.1)
    mports/comms/chu/files:
        patch-chu.c (r1.1)

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/comms/Makefile,v
retrieving revision 1.15
retrieving revision 1.16
diff -L comms/Makefile -L comms/Makefile -u -r1.15 -r1.16
--- comms/Makefile
+++ comms/Makefile
@@ -10,6 +10,7 @@
     SUBDIR += bforce
     SUBDIR += bforce-kst
     SUBDIR += cdr_read
+    SUBDIR += chu
     SUBDIR += efax
     SUBDIR += libirman
     SUBDIR += libticables
--- /dev/null
+++ comms/chu/pkg-descr
@@ -0,0 +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/
--- /dev/null
+++ comms/chu/pkg-plist
@@ -0,0 +1,9 @@
+sbin/chu
+%%DATADIR%%/testsignal
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/chu.html
+%%PORTDOCS%%%%DOCSDIR%%/chuman.html
+%%PORTDOCS%%%%DOCSDIR%%/ntp.html
+%%PORTDOCS%%%%DOCSDIR%%/TESTING
+ at dirrm %%DATADIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
--- /dev/null
+++ comms/chu/Makefile
@@ -0,0 +1,58 @@
+# New ports collection makefile for:	chu
+# Date created:				September 16 2006
+# Whom:					Diane Bruce <db at db.net>
+#
+# $MidnightBSD: mports/comms/chu/Makefile,v 1.1 2008/08/17 21:45:15 laffer1 Exp $
+# $FreeBSD: ports/comms/chu/Makefile,v 1.2 2007/01/19 18:14:16 db Exp $
+#
+
+PORTNAME=	chu
+PORTVERSION=	0.1.29
+CATEGORIES=	comms hamradio
+MASTER_SITES=	${MASTER_SITE_SUNSITE} \
+		http://www.rossi.com/chu/
+MASTER_SITE_SUBDIR=	system/admin/time
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Synchronise computer clock to CHU radio station
+LICENSE=	gpl2
+
+MAN8=	chu.8
+
+do-extract:
+	@${RM} -rf ${WRKDIR}
+	@${MKDIR} ${WRKDIR}
+	@${MKDIR} ${WRKSRC}
+	@for f in ${EXTRACT_ONLY}; do  \
+		if ! (cd ${WRKSRC} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/$$f ${EXTRACT_AFTER_ARGS});\
+		then \
+			exit 1; \
+		fi \
+	done
+	${EXTRACT_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 ${PREFIX}/sbin
+	${MKDIR} ${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/testsignal ${DATADIR}
+	${INSTALL_MAN} ${WRKSRC}/chu.8 ${PREFIX}/man/man8
+.if	!defined(NOPORTDOCS)
+	${MKDIR} ${DOCSDIR}
+.for	d in ${WRKSRC}/COPYING \
+	${WRKSRC}/TESTING \
+	${WRKSRC}/chu.html \
+	${WRKSRC}/chuman.html \
+	${WRKSRC}/ntp.html
+	${INSTALL_DATA} ${WRKSRC}/${d} ${DOCSDIR}
+.endfor
+	@${ECHO} ""
+	@${ECHO} "chu docs installed in ${DOCSDIR}"
+	@${ECHO} ""
+.endif
+
+.include <bsd.port.mk>
--- /dev/null
+++ comms/chu/distinfo
@@ -0,0 +1,3 @@
+MD5 (chu-0.1.29.tar.gz) = d8bc38f64d386240dd445993a1a646e3
+SHA256 (chu-0.1.29.tar.gz) = ac791bb2c9f80ec393f8cc7ddb833974e1f3b03960a73a206011256f4a4e8e72
+SIZE (chu-0.1.29.tar.gz) = 44441
--- /dev/null
+++ comms/chu/files/patch-chu.c
@@ -0,0 +1,76 @@
+--- chu.c.orig	Wed Mar 17 11:42:18 1999
++++ chu.c	Mon Sep 18 17:46:42 2006
+@@ -20,15 +20,21 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <math.h>
++#include <errno.h>
++#include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+ #include <unistd.h>
+ 
+-#define USE_TIMEX
++#define ADJTIME
++#undef USE_TIMEX
++#define USE_ADJTIME
++
++#ifdef ADJTIME
+ #ifdef USE_TIMEX
+ #include <sys/timex.h>
+ #endif
+-
++#endif
+ #define SAMPLE_RATE 8000
+ #define SAMPLES 512
+ #define OVERLAP 50
+@@ -389,6 +395,21 @@
+   }
+ }
+ 
++#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 @@
+   adjtimex(&t);
+   offset = t.offset;
+ #endif
+-
++#ifdef USE_ADJTIME
++#endif
+   return (double) offset; 
+ }
+ 
+@@ -655,12 +677,17 @@
+     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 ");


More information about the Midnightbsd-cvs mailing list