pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
wip/libsml: new package implementing the Smart Message Language (SML) used in Smart Meters
Module Name: pkgsrc-wip
Committed By: Matthias Petermann <mp%petermann-it.de@localhost>
Pushed By: mp
Date: Sat May 25 10:46:41 2024 +0200
Changeset: 374c0c1fb7c1606e26bc457c386928a849596798
Added Files:
libsml/COMMIT_MSG
libsml/DESCR
libsml/Makefile
libsml/PLIST
libsml/buildlink3.mk
libsml/distinfo
libsml/patches/patch-Makefile
libsml/patches/patch-examples_Makefile
libsml/patches/patch-sml_Makefile
Log Message:
wip/libsml: new package implementing the Smart Message Language (SML) used in Smart Meters
libSML is a library which implements the Smart Message Language (SML) protocol
specified by VDE's Forum Netztechnik/Netzbetrieb (FNN). It can be utilized to
communicate to FNN specified Smart Meters or Smart Meter components (EDL/MUC).
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=374c0c1fb7c1606e26bc457c386928a849596798
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
libsml/COMMIT_MSG | 15 +++++++++++++++
libsml/DESCR | 3 +++
libsml/Makefile | 27 +++++++++++++++++++++++++++
libsml/PLIST | 32 ++++++++++++++++++++++++++++++++
libsml/buildlink3.mk | 13 +++++++++++++
libsml/distinfo | 8 ++++++++
libsml/patches/patch-Makefile | 21 +++++++++++++++++++++
libsml/patches/patch-examples_Makefile | 27 +++++++++++++++++++++++++++
libsml/patches/patch-sml_Makefile | 24 ++++++++++++++++++++++++
9 files changed, 170 insertions(+)
diffs:
diff --git a/libsml/COMMIT_MSG b/libsml/COMMIT_MSG
new file mode 100644
index 0000000000..d387709363
--- /dev/null
+++ b/libsml/COMMIT_MSG
@@ -0,0 +1,15 @@
+libSML is a library which implements the Smart Message Language (SML) protocol
+specified by VDE's Forum Netztechnik/Netzbetrieb (FNN). It can be utilized to
+communicate to FNN specified Smart Meters or Smart Meter components (EDL/MUC).
+
+This pkgsrc package is work in progress. For now, the library builds as well
+as the included example program sml_server. The build time tests are not within
+the initial scope as they appear to not work for cross builds. Limited
+functional testing was performed like this:
+
+ armv7# cu -l /dev/ttyU0 -s 9600 | sml_sever -
+
+(assuming a Smart Meter is connected via a USB-IEC-Interface on /dev/ttyU0).
+
+sml_server is also capable of handling the serial interface directly. This seems
+to be not working on NetBSD now and needs further understanding / patches.
diff --git a/libsml/DESCR b/libsml/DESCR
new file mode 100644
index 0000000000..9e316f4409
--- /dev/null
+++ b/libsml/DESCR
@@ -0,0 +1,3 @@
+libSML is a library which implements the Smart Message Language (SML) protocol
+specified by VDE's Forum Netztechnik/Netzbetrieb (FNN). It can be utilized to
+communicate to FNN specified Smart Meters or Smart Meter components (EDL/MUC).
diff --git a/libsml/Makefile b/libsml/Makefile
new file mode 100644
index 0000000000..6690ed963a
--- /dev/null
+++ b/libsml/Makefile
@@ -0,0 +1,27 @@
+# $NetBSD: $
+
+DISTNAME= libsml-1.1.3
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GITHUB:=volkszaehler/}
+GITHUB_TAG= v${PKGVERSION_NOREV}
+
+MAINTAINER= mp%petermann-it.de@localhost
+HOMEPAGE= https://github.com/volkszaehler/libsml
+COMMENT= Smart Message Language (SML) protocol
+LICENSE= gnu-gpl-v3
+
+USE_LIBTOOL= yes
+USE_LANGUAGES= c
+USE_TOOLS+= gmake
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_MESSAGE.paths= Fixing absolute paths.
+SUBST_FILES.paths= sml/Makefile
+SUBST_FILES.paths+= examples/Makefile
+SUBST_VARS.paths= PREFIX
+
+.include "../../mk/bsd.prefs.mk"
+
+.include "../../devel/libuuid/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libsml/PLIST b/libsml/PLIST
new file mode 100644
index 0000000000..08d146a003
--- /dev/null
+++ b/libsml/PLIST
@@ -0,0 +1,32 @@
+@comment $NetBSD$
+bin/sml_server
+include/sml/sml_attention_response.h
+include/sml/sml_boolean.h
+include/sml/sml_close_request.h
+include/sml/sml_close_response.h
+include/sml/sml_crc16.h
+include/sml/sml_file.h
+include/sml/sml_get_list_request.h
+include/sml/sml_get_list_response.h
+include/sml/sml_get_proc_parameter_request.h
+include/sml/sml_get_proc_parameter_response.h
+include/sml/sml_get_profile_list_request.h
+include/sml/sml_get_profile_list_response.h
+include/sml/sml_get_profile_pack_request.h
+include/sml/sml_get_profile_pack_response.h
+include/sml/sml_list.h
+include/sml/sml_message.h
+include/sml/sml_number.h
+include/sml/sml_octet_string.h
+include/sml/sml_open_request.h
+include/sml/sml_open_response.h
+include/sml/sml_set_proc_parameter_request.h
+include/sml/sml_shared.h
+include/sml/sml_status.h
+include/sml/sml_time.h
+include/sml/sml_transport.h
+include/sml/sml_tree.h
+include/sml/sml_value.h
+lib/libsml.a
+lib/libsml.so
+lib/libsml.so.1
diff --git a/libsml/buildlink3.mk b/libsml/buildlink3.mk
new file mode 100644
index 0000000000..46a5e5771c
--- /dev/null
+++ b/libsml/buildlink3.mk
@@ -0,0 +1,13 @@
+# $NetBSD: $
+
+BUILDLINK_TREE+= libsml
+
+.if !defined(LIBSML_BUILDLINK3_MK)
+LIBSML_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libsml+= libsml>=1.1.3
+BUILDLINK_PKGSRCDIR.libsml?= ../../wip/libsml
+
+.endif # LIBSML_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -libsml
diff --git a/libsml/distinfo b/libsml/distinfo
new file mode 100644
index 0000000000..6f38cd1e7b
--- /dev/null
+++ b/libsml/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.80 2024/02/08 06:18:00 adam Exp $
+
+BLAKE2s (libsml-1.1.3.tar.gz) = 45b2d9247dbbb713afbb4151b982621dc2a2ebe2d67a574578c0d4e4882afad5
+SHA512 (libsml-1.1.3.tar.gz) = 7a91b16af3c17a47baceb7c38e77ccc5506fbdbbe1810acc9d1507344db59ffff67946d2d47d389141a0db60c7ff7a3e9835b314bc7fa5338a17a16c619c3e6a
+Size (libsml-1.1.3.tar.gz) = 87499 bytes
+SHA1 (patch-Makefile) = 993ab7cdbbca3a2a7f9b72ddfc5e92b71f379a89
+SHA1 (patch-examples_Makefile) = b28938f14dae5817eb818b347efab7788724b536
+SHA1 (patch-sml_Makefile) = df5439d194cf3132505114b670864feac502684a
diff --git a/libsml/patches/patch-Makefile b/libsml/patches/patch-Makefile
new file mode 100644
index 0000000000..0d3f19c0c6
--- /dev/null
+++ b/libsml/patches/patch-Makefile
@@ -0,0 +1,21 @@
+$NetBSD$
+
+The tests build a binary test runner which is executed during the build.
+This doesn't work with pkgsrc cross builds. Disable it for now.
+
+--- Makefile.orig 2024-05-25 07:40:58.715033583 +0000
++++ Makefile
+@@ -2,13 +2,11 @@
+ all:
+ @$(MAKE) -C sml
+ @$(MAKE) -C examples
+- @$(MAKE) -C test
+
+ .PHONY: clean install uninstall
+ clean:
+ @$(MAKE) -C sml clean
+ @$(MAKE) -C examples clean
+- @$(MAKE) -C test clean
+
+ install: all
+ @$(MAKE) -C sml install
diff --git a/libsml/patches/patch-examples_Makefile b/libsml/patches/patch-examples_Makefile
new file mode 100644
index 0000000000..7f931cb3a3
--- /dev/null
+++ b/libsml/patches/patch-examples_Makefile
@@ -0,0 +1,27 @@
+$NetBSD$
+
+Adjust prefix and take care of RPATH.
+
+--- examples/Makefile.orig 2024-03-29 17:05:36.000000000 +0000
++++ examples/Makefile
+@@ -1,9 +1,9 @@
+ UNAME := $(shell uname)
+-CFLAGS += -I../sml/include/ -g -std=c99 -Wall -Wextra -pedantic
++CFLAGS += -I../sml/include/ -g -std=c99 -Wall -Wextra -pedantic -Wl,-R@PREFIX@/lib
+ OBJS = sml_server.o
+ LIBSML = ../sml/lib/libsml.so.1
+ INSTALL = /usr/bin/install
+-prefix = /usr/local
++prefix = @PREFIX@
+ exec_prefix = ${prefix}
+ bindir = ${exec_prefix}/bin
+ libdir = ${exec_prefix}/lib
+@@ -17,7 +17,7 @@ endif
+ all: sml_server
+
+ sml_server: $(OBJS) $(LIBSML)
+- $(CC) $(OBJS) $(LIBSML) $(LIBS) -o sml_server
++ $(CC) $(OBJS) $(LIBSML) $(LIBS) -Wl,-R@PREFIX@/lib -L@PREFIX@/lib -o sml_server
+
+ %.o: %.c
+ $(CC) $(CFLAGS) -c $^ -o $@
diff --git a/libsml/patches/patch-sml_Makefile b/libsml/patches/patch-sml_Makefile
new file mode 100644
index 0000000000..627a70e678
--- /dev/null
+++ b/libsml/patches/patch-sml_Makefile
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Adjust prefix and take care of RPATH.
+
+--- sml/Makefile.orig 2024-03-29 17:05:36.000000000 +0000
++++ sml/Makefile
+@@ -16,7 +16,7 @@ else
+ SONAME=$(NAME).so.$(SOVERSION)
+ endif
+
+-LDFLAGS += -Wl,-soname=$(SONAME) -shared
++LDFLAGS += -Wl,-soname=$(SONAME),-R@PREFIX@/lib -shared
+
+ LIB_DIR=./lib
+ INC_DIR=./include
+@@ -25,7 +25,7 @@ DYN_LIB=$(LIB_DIR)/$(SONAME)
+ ST_LIB=$(LIB_DIR)/$(NAME).a
+
+ INSTALL = /usr/bin/install
+-prefix = /usr/local
++prefix = @PREFIX@
+ exec_prefix = ${prefix}
+ bindir = ${exec_prefix}/bin
+ libdir = ${exec_prefix}/lib
Home |
Main Index |
Thread Index |
Old Index