Received: by mail.netbsd.org (Postfix, from userid 605) id 508F484EB3; Tue, 6 Sep 2022 15:56:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 8A7CD84EAB for ; Tue, 6 Sep 2022 15:56:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 0HLAymfT1ci3 for ; Tue, 6 Sep 2022 15:56:53 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id A8D4F84D00 for ; Tue, 6 Sep 2022 15:56:53 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 9C786FA90; Tue, 6 Sep 2022 15:56:53 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_166247981315650" MIME-Version: 1.0 Date: Tue, 6 Sep 2022 15:56:53 +0000 From: "Martin Husemann" Subject: CVS commit: pkgsrc/misc To: pkgsrc-changes@NetBSD.org Reply-To: martin@netbsd.org X-Mailer: log_accum Message-Id: <20220906155653.9C786FA90@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_166247981315650 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: martin Date: Tue Sep 6 15:56:53 UTC 2022 Modified Files: pkgsrc/misc: Makefile pkgsrc/misc/open2300: distinfo pkgsrc/misc/open2300/patches: patch-aa Added Files: pkgsrc/misc/open2300-pgsql: DESCR MESSAGE Makefile PLIST Log Message: Add the Postgres version of the WS2300 logger To generate a diff of this commit: cvs rdiff -u -r1.568 -r1.569 pkgsrc/misc/Makefile cvs rdiff -u -r1.14 -r1.15 pkgsrc/misc/open2300/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/misc/open2300-pgsql/DESCR \ pkgsrc/misc/open2300-pgsql/MESSAGE pkgsrc/misc/open2300-pgsql/Makefile \ pkgsrc/misc/open2300-pgsql/PLIST cvs rdiff -u -r1.7 -r1.8 pkgsrc/misc/open2300/patches/patch-aa Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_166247981315650 Content-Disposition: inline Content-Length: 6658 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/misc/Makefile diff -u pkgsrc/misc/Makefile:1.568 pkgsrc/misc/Makefile:1.569 --- pkgsrc/misc/Makefile:1.568 Mon Aug 15 14:44:58 2022 +++ pkgsrc/misc/Makefile Tue Sep 6 15:56:52 2022 @@ -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-opam-file-format SUBDIR+= ocaml-topkg SUBDIR+= open2300 SUBDIR+= open2300-mysql +SUBDIR+= open2300-pgsql SUBDIR+= orca SUBDIR+= p5-App-MrShell SUBDIR+= p5-Array-PrintCols Index: pkgsrc/misc/open2300/distinfo diff -u pkgsrc/misc/open2300/distinfo:1.14 pkgsrc/misc/open2300/distinfo:1.15 --- pkgsrc/misc/open2300/distinfo:1.14 Tue Oct 26 10:59:17 2021 +++ pkgsrc/misc/open2300/distinfo Tue Sep 6 15:56:52 2022 @@ -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 Index: pkgsrc/misc/open2300/patches/patch-aa diff -u pkgsrc/misc/open2300/patches/patch-aa:1.7 pkgsrc/misc/open2300/patches/patch-aa:1.8 --- pkgsrc/misc/open2300/patches/patch-aa:1.7 Fri Feb 5 19:36:16 2010 +++ pkgsrc/misc/open2300/patches/patch-aa Tue Sep 6 15:56:53 2022 @@ -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 @@ $NetBSD: patch-aa,v 1.7 2010/02/05 19:36 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 @@ $NetBSD: patch-aa,v 1.7 2010/02/05 19:36 +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: Added files: Index: pkgsrc/misc/open2300-pgsql/DESCR diff -u /dev/null pkgsrc/misc/open2300-pgsql/DESCR:1.1 --- /dev/null Tue Sep 6 15:56:53 2022 +++ pkgsrc/misc/open2300-pgsql/DESCR Tue Sep 6 15:56:53 2022 @@ -0,0 +1,2 @@ +Open2300-pgsql reads data from a Weather Station 23xx and inserts +it into a postgres database. Index: pkgsrc/misc/open2300-pgsql/MESSAGE diff -u /dev/null pkgsrc/misc/open2300-pgsql/MESSAGE:1.1 --- /dev/null Tue Sep 6 15:56:53 2022 +++ pkgsrc/misc/open2300-pgsql/MESSAGE Tue Sep 6 15:56:53 2022 @@ -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. + +=========================================================================== Index: pkgsrc/misc/open2300-pgsql/Makefile diff -u /dev/null pkgsrc/misc/open2300-pgsql/Makefile:1.1 --- /dev/null Tue Sep 6 15:56:53 2022 +++ pkgsrc/misc/open2300-pgsql/Makefile Tue Sep 6 15:56:53 2022 @@ -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" Index: pkgsrc/misc/open2300-pgsql/PLIST diff -u /dev/null pkgsrc/misc/open2300-pgsql/PLIST:1.1 --- /dev/null Tue Sep 6 15:56:53 2022 +++ pkgsrc/misc/open2300-pgsql/PLIST Tue Sep 6 15:56:53 2022 @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1 2022/09/06 15:56:53 martin Exp $ +bin/pgsql2300 --_----------=_166247981315650--