aboutsummaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2006-09-19 20:09:27 +0000
committerMartin Wilke <miwi@FreeBSD.org>2006-09-19 20:09:27 +0000
commit48ad275b3d89f84e7b4b2d6ca98ddaf01bda34da (patch)
tree36af2a97602d56b395501851a0dea0830f344a9d /comms
parentf17fd69e5ec5e5ec35a4c094fe5fb507c5ed4526 (diff)
downloadports-48ad275b3d89f84e7b4b2d6ca98ddaf01bda34da.tar.gz
ports-48ad275b3d89f84e7b4b2d6ca98ddaf01bda34da.zip
Notes
Diffstat (limited to 'comms')
-rw-r--r--comms/Makefile1
-rw-r--r--comms/chu/Makefile56
-rw-r--r--comms/chu/distinfo3
-rw-r--r--comms/chu/files/patch-chu.c76
-rw-r--r--comms/chu/pkg-descr8
-rw-r--r--comms/chu/pkg-plist9
6 files changed, 153 insertions, 0 deletions
diff --git a/comms/Makefile b/comms/Makefile
index 3e2bfd947a11..15968b43420e 100644
--- a/comms/Makefile
+++ b/comms/Makefile
@@ -12,6 +12,7 @@
SUBDIR += birda
SUBDIR += bpl+
SUBDIR += cdr_read
+ SUBDIR += chu
SUBDIR += comserv
SUBDIR += conserver
SUBDIR += conserver-com
diff --git a/comms/chu/Makefile b/comms/chu/Makefile
new file mode 100644
index 000000000000..8460c7cfdedc
--- /dev/null
+++ b/comms/chu/Makefile
@@ -0,0 +1,56 @@
+# New ports collection makefile for: chu
+# Date created: September 16 2006
+# Whom: Diane Bruce <db@db.net>
+#
+# $FreeBSD$
+#
+
+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= db@db.net
+COMMENT= Synchronise computer clock to CHU radio station
+
+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>
diff --git a/comms/chu/distinfo b/comms/chu/distinfo
new file mode 100644
index 000000000000..b388ab45b1d4
--- /dev/null
+++ b/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
diff --git a/comms/chu/files/patch-chu.c b/comms/chu/files/patch-chu.c
new file mode 100644
index 000000000000..ea631aa7b04e
--- /dev/null
+++ b/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 ");
diff --git a/comms/chu/pkg-descr b/comms/chu/pkg-descr
new file mode 100644
index 000000000000..cc1865888f41
--- /dev/null
+++ b/comms/chu/pkg-descr
@@ -0,0 +1,8 @@
+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@db.net>
diff --git a/comms/chu/pkg-plist b/comms/chu/pkg-plist
new file mode 100644
index 000000000000..a1a5a34257b6
--- /dev/null
+++ b/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
+@dirrm %%DATADIR%%
+%%PORTDOCS%%@dirrm %%DOCSDIR%%