pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/misc Add the Postgres version of the WS2300 logger



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ab6ed29df9dc
branches:  trunk
changeset: 384862:ab6ed29df9dc
user:      martin <martin%pkgsrc.org@localhost>
date:      Tue Sep 06 15:56:52 2022 +0000

description:
Add the Postgres version of the WS2300 logger

diffstat:

 misc/Makefile                  |   3 +-
 misc/open2300-pgsql/DESCR      |   2 +
 misc/open2300-pgsql/MESSAGE    |  48 ++++++++++++++++++++++++++++++++++++++++++
 misc/open2300-pgsql/Makefile   |  17 ++++++++++++++
 misc/open2300-pgsql/PLIST      |   2 +
 misc/open2300/distinfo         |   4 +-
 misc/open2300/patches/patch-aa |  11 ++++++---
 7 files changed, 80 insertions(+), 7 deletions(-)

diffs (154 lines):

diff -r b153a8761cde -r ab6ed29df9dc misc/Makefile
--- a/misc/Makefile     Tue Sep 06 15:42:28 2022 +0000
+++ b/misc/Makefile     Tue Sep 06 15:56:52 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.568 2022/08/15 14:44:58 wiz Exp $
+# $NetBSD: Makefile,v 1.569 2022/09/06 15:56:52 martin Exp $
 #
 
 COMMENT=       Miscellaneous utilities
@@ -213,6 +213,7 @@
 SUBDIR+=       ocaml-topkg
 SUBDIR+=       open2300
 SUBDIR+=       open2300-mysql
+SUBDIR+=       open2300-pgsql
 SUBDIR+=       orca
 SUBDIR+=       p5-App-MrShell
 SUBDIR+=       p5-Array-PrintCols
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300-pgsql/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300-pgsql/DESCR Tue Sep 06 15:56:52 2022 +0000
@@ -0,0 +1,2 @@
+Open2300-pgsql reads data from a Weather Station 23xx and inserts
+it into a postgres database.
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300-pgsql/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300-pgsql/MESSAGE       Tue Sep 06 15:56:52 2022 +0000
@@ -0,0 +1,48 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2022/09/06 15:56:53 martin Exp $
+
+Before you can use this program, you need to configure the PostgresSQL
+connection in the open2300.conf file. The sql user used by the
+program only needs "insert" priviledges.
+
+You need to create a table as named in the config file in the configured
+database. Here is a working sequence of commands:
+
+CREATE TYPE wind_direction AS
+     enum('N','NNE','NE','ENE','E','ESE','SE','SSE','S',
+          'SSW','SW','WSW','W','WNW','NW','NNW');
+CREATE TYPE tendency AS
+     enum('Steady','Rising','Falling');
+CREATE TYPE forecast AS
+     enum('Rainy','Cloudy','Sunny');
+CREATE TABLE weather (
+     station varchar(24) NOT NULL default '',
+     timestamp timestamp NOT NULL default '1970-01-01 00:00:00',
+     rec_date date NOT NULL default '1970-01-01',
+     rec_time time NOT NULL default '00:00:00',
+     temp_in float NOT NULL default '0',
+     temp_out float NOT NULL default '0',
+     dewpoint float NOT NULL default '0',
+     rel_hum_in integer NOT NULL default '0',
+     rel_hum_out integer NOT NULL default '0',
+     windspeed float NOT NULL default '0',
+     wind_angle float NOT NULL default '0',
+     wind_direction wind_direction NOT NULL default 'N',
+     wind_chill float NOT NULL default '0',
+     rain_1h float NOT NULL default '0',
+     rain_24h float NOT NULL default '0',
+     rain_total float NOT NULL default '0',
+     rel_pressure float NOT NULL default '0',
+     tendency tendency NOT NULL default 'Steady',
+     forecast forecast NOT NULL default 'Rainy',
+     PRIMARY KEY  (timestamp)
+   );
+GRANT INSERT ON TABLE weather TO open2300;
+
+Note that the actual field names are not used, but the structure
+needs to be compatible.
+
+The program will not output anything, unless errors occur. This
+makes it easy to use it in cron jobs.
+
+===========================================================================
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300-pgsql/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300-pgsql/Makefile      Tue Sep 06 15:56:52 2022 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2022/09/06 15:56:53 martin Exp $
+#
+
+PKGNAME=       ${DISTNAME:S/-/-pgsql-/}
+COMMENT=       WS 23xx weather station PostgesSQL support
+LICENSE=       gnu-gpl-v2
+
+BUILD_TARGET=          pgsql2300
+INSTALL_TARGET=                install-pgsql
+INSTALLATION_DIRS+=    bin
+
+#LIBS+=                -lmysqlclient
+#LIBS.SunOS+=  -lnsl -lsocket
+#MAKE_ENV+=    LIBS=${LIBS:M*:Q}
+
+.include "../../mk/pgsql.buildlink3.mk"
+.include "../../misc/open2300/Makefile.common"
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300-pgsql/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/open2300-pgsql/PLIST Tue Sep 06 15:56:52 2022 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2022/09/06 15:56:53 martin Exp $
+bin/pgsql2300
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300/distinfo
--- a/misc/open2300/distinfo    Tue Sep 06 15:42:28 2022 +0000
+++ b/misc/open2300/distinfo    Tue Sep 06 15:56:52 2022 +0000
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.14 2021/10/26 10:59:17 nia Exp $
+$NetBSD: distinfo,v 1.15 2022/09/06 15:56:52 martin Exp $
 
 BLAKE2s (open2300-1.10.tar.gz) = 98f48bb76a73a113d97347cd23e23c5644b0a6204b1930d67b640e3d149a15ce
 SHA512 (open2300-1.10.tar.gz) = 4c00cdcdde676a2973c42485cbe084667b1a5967fffb23b17d25e290067cab8f821bd67a741262996b9521a2f630b2cd8443776d2c1094c8b989a9e3bb2e11fe
 Size (open2300-1.10.tar.gz) = 337926 bytes
-SHA1 (patch-aa) = 06dbd4a01ee378bf068ef4e8a55327e36fdc3416
+SHA1 (patch-aa) = d90e6062fa591df703602e9b42c0230806839f98
 SHA1 (patch-ab) = 9437137a36e434fcabde6acc5373be04523357e9
 SHA1 (patch-ac) = 48762f4c60ca475031659cad94701a1bc83b6795
 SHA1 (patch-linux2300.c) = 25184ec0d41e00eb16cec43fc359a450777546fe
diff -r b153a8761cde -r ab6ed29df9dc misc/open2300/patches/patch-aa
--- a/misc/open2300/patches/patch-aa    Tue Sep 06 15:42:28 2022 +0000
+++ b/misc/open2300/patches/patch-aa    Tue Sep 06 15:56:52 2022 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.7 2010/02/05 19:36:16 martin Exp $
+$NetBSD: patch-aa,v 1.8 2022/09/06 15:56:53 martin Exp $
 
 --- Makefile.orig      2005-03-15 08:14:48.000000000 +0100
-+++ Makefile   2010-02-04 18:52:12.000000000 +0100
++++ Makefile   2022-09-03 14:59:32.476411369 +0200
 @@ -14,11 +14,11 @@
  
  prefix = /usr/local
@@ -36,7 +36,7 @@
  
  pgsql2300: $(PGSQLOBJ)
        $(CC) $(CFLAGS) -o $@ $(PGSQLOBJ) $(CC_LDFLAGS) $(CC_WINFLAG) -I/usr/include/pgsql -L/usr/lib/pgsql -lpq
-@@ -94,19 +94,23 @@
+@@ -94,19 +94,26 @@
        $(CC) $(CFLAGS) -o $@ $(MINMAXOBJ) $(CC_LDFLAGS) $(CC_WINFLAG)
  
  install:
@@ -70,10 +70,13 @@
 +install-mysql:
 +      ${BSD_INSTALL_PROGRAM} mysql2300 $(DESTDIR)$(bindir)
 +
++install-pgsql:
++      ${BSD_INSTALL_PROGRAM} pgsql2300 $(DESTDIR)$(bindir)
++
  uninstall:
        rm -f $(bindir)/open2300 $(bindir)/dump2300 $(bindir)/log2300 $(bindir)/fetch2300 $(bindir)/wu2300 $(bindir)/cw2300 $(bindir)/xml2300 $(bindir)/light2300 $(bindir)/interval2300 
$(bindir)/minmax2300
  
-@@ -114,4 +118,4 @@
+@@ -114,4 +121,4 @@
        rm -f *~ *.o open2300 dump2300 log2300 fetch2300 wu2300 cw2300 history2300 histlog2300 bin2300 xml2300 mysql2300 pgsql2300 light2300 interval2300 minmax2300
  
  cleanexe:



Home | Main Index | Thread Index | Old Index