pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/open2300 Import of open2300, a set of utilities t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2873db2d2d5f
branches:  trunk
changeset: 483270:2873db2d2d5f
user:      martin <martin%pkgsrc.org@localhost>
date:      Wed Nov 10 08:19:46 2004 +0000

description:
Import of open2300, a set of utilities to read data from and controll a
weather station WS23xx.

diffstat:

 misc/open2300/DESCR            |   3 +
 misc/open2300/Makefile         |   6 +++
 misc/open2300/Makefile.common  |  13 +++++++
 misc/open2300/PLIST            |  14 +++++++
 misc/open2300/distinfo         |   7 +++
 misc/open2300/patches/patch-aa |  77 ++++++++++++++++++++++++++++++++++++++++++
 misc/open2300/patches/patch-ab |  21 +++++++++++
 misc/open2300/patches/patch-ac |  57 +++++++++++++++++++++++++++++++
 8 files changed, 198 insertions(+), 0 deletions(-)

diffs (230 lines):

diff -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/DESCR       Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/Makefile    Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/Makefile.common
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/Makefile.common     Wed Nov 10 08:19:46 2004 +0000
@@ -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@localhost
+HOMEPAGE=              http://open2300.sourceforge.net/
+
+USE_BUILDLINK3=                yes
+
+.include "../../mk/bsd.pkg.mk"
diff -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/PLIST       Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/distinfo    Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/patches/patch-aa    Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/patches/patch-ab    Wed Nov 10 08:19:46 2004 +0000
@@ -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 -r 5d1355d77e8e -r 2873db2d2d5f misc/open2300/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300/patches/patch-ac    Wed Nov 10 08:19:46 2004 +0000
@@ -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;
+ }
+ 
+ /********************************************************************



Home | Main Index | Thread Index | Old Index