mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] libtahu: new package
@ 2023-02-16 12:09 Ian Abbott
  2023-02-17  6:19 ` Michael Olbrich
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Abbott @ 2023-02-16 12:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

Includes the C library from the Eclipse Tahu project that provides an
implementation of the Sparkplug specification.  This package does not
include the implementations from the Tahu project for other programming
languages other than C.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 rules/libtahu.in   | 11 ++++++
 rules/libtahu.make | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 99 insertions(+)
 create mode 100644 rules/libtahu.in
 create mode 100644 rules/libtahu.make

diff --git a/rules/libtahu.in b/rules/libtahu.in
new file mode 100644
index 000000000..451d40957
--- /dev/null
+++ b/rules/libtahu.in
@@ -0,0 +1,11 @@
+## SECTION=system_libraries
+
+config LIBTAHU
+	tristate
+	prompt "libtahu"
+	help
+	  Eclipse Tahu C library for encoding and decoding Sparkplug B
+	  messages.
+
+	  A typical application will also require an MQTT library such
+	  as "mosquitto".
diff --git a/rules/libtahu.make b/rules/libtahu.make
new file mode 100644
index 000000000..c4e62cc61
--- /dev/null
+++ b/rules/libtahu.make
@@ -0,0 +1,88 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2023 by Ian Abbott <abbotti@mev.co.uk>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBTAHU) += libtahu
+
+#
+# Paths and names
+#
+LIBTAHU_VERSION	:= 1.0.1
+LIBTAHU_MD5	:= 7e980ed17e34a78d6d61c000e4957292
+LIBTAHU		:= libtahu-$(LIBTAHU_VERSION)
+LIBTAHU_SUFFIX	:= tar.gz
+LIBTAHU_URL	:= https://github.com/eclipse/tahu/archive/refs/tags/v$(LIBTAHU_VERSION).$(LIBTAHU_SUFFIX)
+LIBTAHU_SOURCE	:= $(SRCDIR)/$(LIBTAHU).$(LIBTAHU_SUFFIX)
+LIBTAHU_DIR	:= $(BUILDDIR)/$(LIBTAHU)
+LIBTAHU_SUBDIR	:= c/core
+LIBTAHU_LICENSE	:= EPL-2.0
+LIBTAHU_LICENSE_FILES	:= \
+	file://LICENSE;md5=c7cc8aa73fb5717f8291fcec5ce9ed6c \
+	file://epl-v20.html;md5=84283fa8859daf213bdda5a9f8d1be1d
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBTAHU_CONF_TOOL	:= NO
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+#LIBTAHU_MAKE_ENV	:= $(CROSS_ENV)
+
+# Default target builds tests that depend on libmosquitto, so just build
+# the library files.
+LIBTAHU_MAKE_OPT	:= \
+	$(CROSS_ENV_CC) \
+	$(CROSS_ENV_AR) \
+	$(CROSS_ENV_LD) \
+	lib/libtahu.so \
+	lib/libtahu.a
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libtahu.install:
+	@$(call targetinfo)
+	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/lib" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.so" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.a"
+	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/include" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb.h" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_common.h" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_decode.h" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_encode.h" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.h" \
+		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.pb.h"
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libtahu.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libtahu)
+	@$(call install_fixup, libtahu,PRIORITY,optional)
+	@$(call install_fixup, libtahu,SECTION,base)
+	@$(call install_fixup, libtahu,AUTHOR,"Ian Abbott <abbotti@mev.co.uk>")
+	@$(call install_fixup, libtahu,DESCRIPTION,missing)
+
+	@$(call install_lib, libtahu, 0, 0, 0644, libtahu)
+
+	@$(call install_finish, libtahu)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.39.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] libtahu: new package
  2023-02-16 12:09 [ptxdist] [PATCH] libtahu: new package Ian Abbott
@ 2023-02-17  6:19 ` Michael Olbrich
  2023-02-17 10:18   ` Ian Abbott
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Olbrich @ 2023-02-17  6:19 UTC (permalink / raw)
  To: Ian Abbott; +Cc: ptxdist

On Thu, Feb 16, 2023 at 12:09:44PM +0000, Ian Abbott wrote:
> Includes the C library from the Eclipse Tahu project that provides an
> implementation of the Sparkplug specification.  This package does not
> include the implementations from the Tahu project for other programming
> languages other than C.
> 
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  rules/libtahu.in   | 11 ++++++
>  rules/libtahu.make | 88 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 99 insertions(+)
>  create mode 100644 rules/libtahu.in
>  create mode 100644 rules/libtahu.make
> 
> diff --git a/rules/libtahu.in b/rules/libtahu.in
> new file mode 100644
> index 000000000..451d40957
> --- /dev/null
> +++ b/rules/libtahu.in
> @@ -0,0 +1,11 @@
> +## SECTION=system_libraries
> +
> +config LIBTAHU
> +	tristate
> +	prompt "libtahu"
> +	help
> +	  Eclipse Tahu C library for encoding and decoding Sparkplug B
> +	  messages.
> +
> +	  A typical application will also require an MQTT library such
> +	  as "mosquitto".
> diff --git a/rules/libtahu.make b/rules/libtahu.make
> new file mode 100644
> index 000000000..c4e62cc61
> --- /dev/null
> +++ b/rules/libtahu.make
> @@ -0,0 +1,88 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2023 by Ian Abbott <abbotti@mev.co.uk>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBTAHU) += libtahu
> +
> +#
> +# Paths and names
> +#
> +LIBTAHU_VERSION	:= 1.0.1
> +LIBTAHU_MD5	:= 7e980ed17e34a78d6d61c000e4957292
> +LIBTAHU		:= libtahu-$(LIBTAHU_VERSION)
> +LIBTAHU_SUFFIX	:= tar.gz
> +LIBTAHU_URL	:= https://github.com/eclipse/tahu/archive/refs/tags/v$(LIBTAHU_VERSION).$(LIBTAHU_SUFFIX)
> +LIBTAHU_SOURCE	:= $(SRCDIR)/$(LIBTAHU).$(LIBTAHU_SUFFIX)
> +LIBTAHU_DIR	:= $(BUILDDIR)/$(LIBTAHU)
> +LIBTAHU_SUBDIR	:= c/core
> +LIBTAHU_LICENSE	:= EPL-2.0
> +LIBTAHU_LICENSE_FILES	:= \
> +	file://LICENSE;md5=c7cc8aa73fb5717f8291fcec5ce9ed6c \

The filename is spelled LICENCE ...

> +	file://epl-v20.html;md5=84283fa8859daf213bdda5a9f8d1be1d

That's the same text just in html, so this is not needed.

But I would add notice.html because many files have no license header and
this file contains: "... Unless otherwise indicated, all Content made
available by the Eclipse Foundation is provided to you under the terms and
conditions of the Eclipse Public License Version 2.0 ..."
So this clarifies what the correct license is.

> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +LIBTAHU_CONF_TOOL	:= NO
> +
> +# ----------------------------------------------------------------------------
> +# Compile
> +# ----------------------------------------------------------------------------
> +
> +#LIBTAHU_MAKE_ENV	:= $(CROSS_ENV)
> +
> +# Default target builds tests that depend on libmosquitto, so just build
> +# the library files.
> +LIBTAHU_MAKE_OPT	:= \
> +	$(CROSS_ENV_CC) \
> +	$(CROSS_ENV_AR) \
> +	$(CROSS_ENV_LD) \

Replace all 3 lines with $(CROSS_ENV_PROGS)

> +	lib/libtahu.so \

> +	lib/libtahu.a

Why the static library as well? We usually don't build it in ptxdist.

> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libtahu.install:
> +	@$(call targetinfo)
> +	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/lib" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.so" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.a"
> +	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/include" \

add '-v' (for both) so we can see what is installed in the log.

Michael

> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb.h" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_common.h" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_decode.h" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/pb_encode.h" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.h" \
> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/include/tahu.pb.h"
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libtahu.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, libtahu)
> +	@$(call install_fixup, libtahu,PRIORITY,optional)
> +	@$(call install_fixup, libtahu,SECTION,base)
> +	@$(call install_fixup, libtahu,AUTHOR,"Ian Abbott <abbotti@mev.co.uk>")
> +	@$(call install_fixup, libtahu,DESCRIPTION,missing)
> +
> +	@$(call install_lib, libtahu, 0, 0, 0644, libtahu)
> +
> +	@$(call install_finish, libtahu)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.39.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ptxdist] [PATCH] libtahu: new package
  2023-02-17  6:19 ` Michael Olbrich
@ 2023-02-17 10:18   ` Ian Abbott
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Abbott @ 2023-02-17 10:18 UTC (permalink / raw)
  To: ptxdist

On 17/02/2023 06:19, Michael Olbrich wrote:
> On Thu, Feb 16, 2023 at 12:09:44PM +0000, Ian Abbott wrote:
>> Includes the C library from the Eclipse Tahu project that provides an
>> implementation of the Sparkplug specification.  This package does not
>> include the implementations from the Tahu project for other programming
>> languages other than C.
>>
>> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
>> ---
>>   rules/libtahu.in   | 11 ++++++
>>   rules/libtahu.make | 88 ++++++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 99 insertions(+)
>>   create mode 100644 rules/libtahu.in
>>   create mode 100644 rules/libtahu.make
[...]
>> diff --git a/rules/libtahu.make b/rules/libtahu.make
>> new file mode 100644
>> index 000000000..c4e62cc61
>> --- /dev/null
>> +++ b/rules/libtahu.make
[...]
>> +LIBTAHU_LICENSE	:= EPL-2.0
>> +LIBTAHU_LICENSE_FILES	:= \
>> +	file://LICENSE;md5=c7cc8aa73fb5717f8291fcec5ce9ed6c \
> 
> The filename is spelled LICENCE ...

OK.

> 
>> +	file://epl-v20.html;md5=84283fa8859daf213bdda5a9f8d1be1d
> 
> That's the same text just in html, so this is not needed.
> 
> But I would add notice.html because many files have no license header and
> this file contains: "... Unless otherwise indicated, all Content made
> available by the Eclipse Foundation is provided to you under the terms and
> conditions of the Eclipse Public License Version 2.0 ..."
> So this clarifies what the correct license is.

OK.

[...]
>> +# Default target builds tests that depend on libmosquitto, so just build
>> +# the library files.
>> +LIBTAHU_MAKE_OPT	:= \
>> +	$(CROSS_ENV_CC) \
>> +	$(CROSS_ENV_AR) \
>> +	$(CROSS_ENV_LD) \
> 
> Replace all 3 lines with $(CROSS_ENV_PROGS)
> 
>> +	lib/libtahu.so \
>> +	lib/libtahu.a
> 
> Why the static library as well? We usually don't build it in ptxdist.

Fair enough.  I'll remove it.

> 
>> +
>> +# ----------------------------------------------------------------------------
>> +# Install
>> +# ----------------------------------------------------------------------------
>> +
>> +$(STATEDIR)/libtahu.install:
>> +	@$(call targetinfo)
>> +	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/lib" \
>> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.so" \
>> +		"$(LIBTAHU_DIR)/$(LIBTAHU_SUBDIR)/lib/libtahu.a"
>> +	@install -m 644 -D -t "$(LIBTAHU_PKGDIR)/usr/include" \
> 
> add '-v' (for both) so we can see what is installed in the log.

OK.

Thanks for the review.  I'll send a v2 patch shortly.

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-17 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 12:09 [ptxdist] [PATCH] libtahu: new package Ian Abbott
2023-02-17  6:19 ` Michael Olbrich
2023-02-17 10:18   ` Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox