diff options
author | martin <martin@pkgsrc.org> | 2004-11-10 08:19:46 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2004-11-10 08:19:46 +0000 |
commit | 03a4c7b0f18fe62deefefc33c69d1ad1ea8c7630 (patch) | |
tree | b868de8450f75f1af67c40a07f384bf48b58ca3e /misc | |
parent | 63b403e80609f83ecf518bb36f14f60c66cdd5a8 (diff) | |
download | pkgsrc-03a4c7b0f18fe62deefefc33c69d1ad1ea8c7630.tar.gz |
Import of open2300, a set of utilities to read data from and controll a
weather station WS23xx.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/open2300/DESCR | 3 | ||||
-rw-r--r-- | misc/open2300/Makefile | 6 | ||||
-rw-r--r-- | misc/open2300/Makefile.common | 13 | ||||
-rw-r--r-- | misc/open2300/PLIST | 14 | ||||
-rw-r--r-- | misc/open2300/distinfo | 7 | ||||
-rw-r--r-- | misc/open2300/patches/patch-aa | 77 | ||||
-rw-r--r-- | misc/open2300/patches/patch-ab | 21 | ||||
-rw-r--r-- | misc/open2300/patches/patch-ac | 57 |
8 files changed, 198 insertions, 0 deletions
diff --git a/misc/open2300/DESCR b/misc/open2300/DESCR new file mode 100644 index 00000000000..4ce2d1b8263 --- /dev/null +++ b/misc/open2300/DESCR @@ -0,0 +1,3 @@ +Open2300 reads data and controls a Weather Station 23xx. +It contains tools to sample data and write it as XML, a MySQL +database, or embed it dynamically into a web page. diff --git a/misc/open2300/Makefile b/misc/open2300/Makefile new file mode 100644 index 00000000000..75b2915740e --- /dev/null +++ b/misc/open2300/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ +# + +COMMENT= WS 23xx weather station support software + +.include "Makefile.common" diff --git a/misc/open2300/Makefile.common b/misc/open2300/Makefile.common new file mode 100644 index 00000000000..cf98b2ebdf6 --- /dev/null +++ b/misc/open2300/Makefile.common @@ -0,0 +1,13 @@ +# $NetBSD: Makefile.common,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ +# + +DISTNAME= open2300-1.6 +CATEGORIES= misc +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=open2300/} + +MAINTAINER= martin@NetBSD.org +HOMEPAGE= http://open2300.sourceforge.net/ + +USE_BUILDLINK3= yes + +.include "../../mk/bsd.pkg.mk" diff --git a/misc/open2300/PLIST b/misc/open2300/PLIST new file mode 100644 index 00000000000..96ab192e072 --- /dev/null +++ b/misc/open2300/PLIST @@ -0,0 +1,14 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ +bin/cw2300 +bin/dump2300 +bin/fetch2300 +bin/histlog2300 +bin/interval2300 +bin/light2300 +bin/log2300 +bin/minmax2300 +bin/open2300 +bin/wu2300 +bin/xml2300 +share/examples/open2300/open2300.conf +@dirrm share/examples/open2300 diff --git a/misc/open2300/distinfo b/misc/open2300/distinfo new file mode 100644 index 00000000000..3231f186389 --- /dev/null +++ b/misc/open2300/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ + +SHA1 (open2300-1.6.tar.gz) = e6483c57126b85e3a8189d023cffe88902e928ed +Size (open2300-1.6.tar.gz) = 327045 bytes +SHA1 (patch-aa) = cc3948b297357939a23b55ea6dcd4505d5381d15 +SHA1 (patch-ab) = 0db92f0ab78ed6b5cd949123cee26b01e7d10ba8 +SHA1 (patch-ac) = 5ddd6e4c0ce2df718c4fcb7efed1d9553c415684 diff --git a/misc/open2300/patches/patch-aa b/misc/open2300/patches/patch-aa new file mode 100644 index 00000000000..9b859a3d743 --- /dev/null +++ b/misc/open2300/patches/patch-aa @@ -0,0 +1,77 @@ +$NetBSD: patch-aa,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ + +--- Makefile.orig 2004-04-23 17:35:30.000000000 +0200 ++++ Makefile 2004-11-04 09:28:14.000000000 +0100 +@@ -4,7 +4,7 @@ + # Default locations are + # 1. Path to config file including filename given as parameter + # 2. ./open2300.conf +-# 3. /usr/local/etc/open2300.conf ++# 3. ${SYSCONFDIR}/open2300.conf + # 4. /etc/open2300.conf + # + # This makefile is made for Linux. +@@ -12,7 +12,7 @@ + # + # You may want to adjust the 3 directories below + +-prefix = /usr/local ++prefix = ${PREFIX} + exec_prefix = ${prefix} + bindir = ${exec_prefix}/bin + +@@ -37,7 +37,7 @@ + + VERSION = 1.6 + +-CFLAGS = -Wall -O3 -DVERSION=\"$(VERSION)\" ++CFLAGS += -DVERSION=\"$(VERSION)\" -DSYSCONFDIR=\"$(PKG_SYSCONFDIR)\" -I /usr/pkg/include/mysql + CC_LDFLAGS = -lm + CC_WINFLAG = + # For Windows - comment the two line above and un-comment the two lines below. +@@ -80,7 +80,7 @@ + $(CC) $(CFLAGS) -o $@ $(XMLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) + + mysql2300: $(MYSQLOBJ) +- $(CC) $(CFLAGS) -o $@ $(MYSQLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient ++ $(CC) $(CFLAGS) -o $@ $(MYSQLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) -L/usr/pkg/lib/mysql -Wl,-R/usr/pkg/lib/mysql -lmysqlclient + + light2300: $(LIGHTOBJ) + $(CC) $(CFLAGS) -o $@ $(LIGHTOBJ) $(CC_LDFLAGS) +@@ -92,19 +92,23 @@ + $(CC) $(CFLAGS) -o $@ $(MINMAXOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) + + install: +- mkdir -p $(bindir) +- $(INSTALL) open2300 $(bindir) +- $(INSTALL) dump2300 $(bindir) +- $(INSTALL) log2300 $(bindir) +- $(INSTALL) fetch2300 $(bindir) +- $(INSTALL) wu2300 $(bindir) +- $(INSTALL) cw2300 $(bindir) +- $(INSTALL) histlog2300 $(bindir) +- $(INSTALL) xml2300 $(bindir) +- $(INSTALL) light2300 $(bindir) +- $(INSTALL) interval2300 $(bindir) +- $(INSTALL) minmax2300 $(bindir) +- ++ ${BSD_INSTALL_PROGRAM} open2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} dump2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} log2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} fetch2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} wu2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} cw2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} histlog2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} xml2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} light2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} interval2300 $(bindir) ++ ${BSD_INSTALL_PROGRAM} minmax2300 $(bindir) ++ ${BSD_INSTALL_DATA_DIR} ${PREFIX}/share/examples/open2300 ++ ${BSD_INSTALL_DATA} open2300-dist.conf ${PREFIX}/share/examples/open2300/open2300.conf ++ ++install-mysql: ++ ${BSD_INSTALL_PROGRAM} mysql2300 $(bindir) ++ + uninstall: + rm -f $(bindir)/open2300 $(bindir)/dump2300 $(bindir)/log2300 $(bindir)/fetch2300 $(bindir)/wu2300 $(bindir)/cw2300 $(bindir)/xml2300 $(bindir)/light2300 $(bindir)/interval2300 $(bindir)/minmax2300 + diff --git a/misc/open2300/patches/patch-ab b/misc/open2300/patches/patch-ab new file mode 100644 index 00000000000..5c5e393265a --- /dev/null +++ b/misc/open2300/patches/patch-ab @@ -0,0 +1,21 @@ +$NetBSD: patch-ab,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ + +--- rw2300.c.orig 2004-04-18 09:51:14.000000000 +0200 ++++ rw2300.c 2004-11-09 09:49:09.000000000 +0100 +@@ -2423,7 +2423,7 @@ + { + if ((fptr = fopen("open2300.conf", "r")) == NULL) + { +- if ((fptr = fopen("/usr/local/etc/open2300.conf", "r")) == NULL) ++ if ((fptr = fopen(SYSCONFDIR "/open2300.conf", "r")) == NULL) + { + if ((fptr = fopen("/etc/open2300.conf", "r")) == NULL) + { +@@ -2912,6 +2912,7 @@ + + for (j = 0; j < MAXRETRIES; j++) + { ++ if (j) sleep_long(2); + reset_06(ws2300); + + // Read the data. If expected number of bytes read break out of loop. diff --git a/misc/open2300/patches/patch-ac b/misc/open2300/patches/patch-ac new file mode 100644 index 00000000000..02d70d07cd4 --- /dev/null +++ b/misc/open2300/patches/patch-ac @@ -0,0 +1,57 @@ +$NetBSD: patch-ac,v 1.1.1.1 2004/11/10 08:19:46 martin Exp $ + +--- linux2300.c.orig 2004-04-23 17:36:58.000000000 +0200 ++++ linux2300.c 2004-11-08 09:33:56.000000000 +0100 +@@ -13,6 +13,7 @@ + #ifndef WIN32 + #define DEBUG 0 + ++#include <errno.h> + #include "rw2300.h" + + /******************************************************************** +@@ -84,7 +85,7 @@ + exit(0); + } + +- tcflush(ws2300, TCIFLUSH); ++ tcflush(ws2300, TCIOFLUSH); + + // Set DTR low and RTS high and leave other ctrl lines untouched + +@@ -149,7 +150,7 @@ + + usleep(50000 * i); //we sleep longer and longer for each retry + } +- printf("\nCould not reset\n"); ++ fprintf(stderr, "\nCould not reset\n"); + exit(0); + } + +@@ -168,7 +169,14 @@ + ********************************************************************/ + int read_device(WEATHERSTATION serdevice, unsigned char *buffer, int size) + { +- return read(serdevice, buffer, size); ++ int ret; ++ ++ for (;;) { ++ ret = read(serdevice, buffer, size); ++ if (ret == 0 && errno == EINTR) ++ continue; ++ return ret; ++ } + } + + /******************************************************************** +@@ -184,7 +192,9 @@ + ********************************************************************/ + int write_device(WEATHERSTATION serdevice, unsigned char *buffer, int size) + { +- return write(serdevice, buffer, size); ++ int ret = write(serdevice, buffer, size); ++ tcdrain(serdevice); // wait for all output written ++ return ret; + } + + /******************************************************************** |