Patchwork [1/1] libmodbus: Added recipe for libmodbus stable version 3.0.4

login
register
mail settings
Submitter christian.braunersorensen@prevas.dk
Date Sept. 12, 2013, 6:18 a.m.
Message ID <c0c33cf2f2db8cb3d6349c8db5c272cfe5dbde41.1378966601.git.christian.braunersorensen@prevas.dk>
Download mbox | patch
Permalink /patch/274440/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

christian.braunersorensen@prevas.dk - Sept. 12, 2013, 6:18 a.m.
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 recipes/libmodbus/libmodbus.inc          | 25 +++++++++++++++++++++++++
 recipes/libmodbus/libmodbus_3.0.4.oe     |  3 +++
 recipes/libmodbus/libmodbus_3.0.4.oe.sig |  1 +
 3 files changed, 29 insertions(+)
 create mode 100644 recipes/libmodbus/libmodbus.inc
 create mode 100644 recipes/libmodbus/libmodbus_3.0.4.oe
 create mode 100644 recipes/libmodbus/libmodbus_3.0.4.oe.sig
Esben Haabendal - Sept. 12, 2013, 1:21 p.m.
<christian.braunersorensen@prevas.dk> writes:

> From: Christian Sørensen <christian.braunersorensen@prevas.dk>
>
> Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
> ---
>  recipes/libmodbus/libmodbus.inc          | 25 +++++++++++++++++++++++++
>  recipes/libmodbus/libmodbus_3.0.4.oe     |  3 +++
>  recipes/libmodbus/libmodbus_3.0.4.oe.sig |  1 +
>  3 files changed, 29 insertions(+)
>  create mode 100644 recipes/libmodbus/libmodbus.inc
>  create mode 100644 recipes/libmodbus/libmodbus_3.0.4.oe
>  create mode 100644 recipes/libmodbus/libmodbus_3.0.4.oe.sig
>
> diff --git a/recipes/libmodbus/libmodbus.inc b/recipes/libmodbus/libmodbus.inc
> new file mode 100644
> index 0000000..33b4965
> --- /dev/null
> +++ b/recipes/libmodbus/libmodbus.inc
> @@ -0,0 +1,25 @@
> +DESCRIPTION = "A Modbus library for Linux, Mac OS X, FreeBSD, QNX and Win32"
> +HOMEPAGE = "http://www.libmodbus.org/"
> +LICENSE = "LGPL"
> +
> +inherit autotools-autoreconf pkgconfig library
> +
> +LIBMODBUS_TEST_APPS="\
> +    bandwidth-client bandwidth-server-many-up bandwidth-server-one \
> +    random-test-client random-test-server \
> +    unit-test-client unit-test-server \
> +    version"
> +
> +do_install[postfuncs] += "do_install_modbus_tests"
> +do_install_modbus_tests () {
> +    mkdir -p ${D}${bindir}
> +    for testapp in ${LIBMODBUS_TEST_APPS}; do
> +        if [ ! -e ${S}/tests/.libs/$testapp ]; then
> +		mv ${S}/tests/$testapp ${S}/tests/.libs/
> +	fi
> +	install -m 0755 ${S}/tests/.libs/$testapp ${D}${bindir}
> +    done
> +}

You really should not modify ${S} in do_install.  I know, there are most
likely other places where this is done, but they are wrong also.

In which cases are the test apps ending up in .libs and when are they
not?

When in .libs, I assume they are there as uninstalled libtool files, and
just copying them is not "right", you should libtool install them
instead.

Perhaps you could patch the "noinst_PROGRAMS =" line to be "PROGRAMS ="
instead, and I think you will get the test programs nicely installed
with the normal do_install.

> +
> +PACKAGES =+ "${PN}-tests"
> +FILES_${PN}-tests = "${bindir}"
> diff --git a/recipes/libmodbus/libmodbus_3.0.4.oe b/recipes/libmodbus/libmodbus_3.0.4.oe
> new file mode 100644
> index 0000000..326e3a4
> --- /dev/null
> +++ b/recipes/libmodbus/libmodbus_3.0.4.oe
> @@ -0,0 +1,3 @@
> +require libmodbus.inc
> +
> +SRC_URI = "https://github.com/stephane/libmodbus/archive/v${PV}.tar.gz"
> diff --git a/recipes/libmodbus/libmodbus_3.0.4.oe.sig b/recipes/libmodbus/libmodbus_3.0.4.oe.sig
> new file mode 100644
> index 0000000..c8d31e7
> --- /dev/null
> +++ b/recipes/libmodbus/libmodbus_3.0.4.oe.sig
> @@ -0,0 +1 @@
> +f808b5aa53b8fb3fe271fa3c655728abc7915487  v3.0.4.tar.gz

Patch

diff --git a/recipes/libmodbus/libmodbus.inc b/recipes/libmodbus/libmodbus.inc
new file mode 100644
index 0000000..33b4965
--- /dev/null
+++ b/recipes/libmodbus/libmodbus.inc
@@ -0,0 +1,25 @@ 
+DESCRIPTION = "A Modbus library for Linux, Mac OS X, FreeBSD, QNX and Win32"
+HOMEPAGE = "http://www.libmodbus.org/"
+LICENSE = "LGPL"
+
+inherit autotools-autoreconf pkgconfig library
+
+LIBMODBUS_TEST_APPS="\
+    bandwidth-client bandwidth-server-many-up bandwidth-server-one \
+    random-test-client random-test-server \
+    unit-test-client unit-test-server \
+    version"
+
+do_install[postfuncs] += "do_install_modbus_tests"
+do_install_modbus_tests () {
+    mkdir -p ${D}${bindir}
+    for testapp in ${LIBMODBUS_TEST_APPS}; do
+        if [ ! -e ${S}/tests/.libs/$testapp ]; then
+		mv ${S}/tests/$testapp ${S}/tests/.libs/
+	fi
+	install -m 0755 ${S}/tests/.libs/$testapp ${D}${bindir}
+    done
+}
+
+PACKAGES =+ "${PN}-tests"
+FILES_${PN}-tests = "${bindir}"
diff --git a/recipes/libmodbus/libmodbus_3.0.4.oe b/recipes/libmodbus/libmodbus_3.0.4.oe
new file mode 100644
index 0000000..326e3a4
--- /dev/null
+++ b/recipes/libmodbus/libmodbus_3.0.4.oe
@@ -0,0 +1,3 @@ 
+require libmodbus.inc
+
+SRC_URI = "https://github.com/stephane/libmodbus/archive/v${PV}.tar.gz"
diff --git a/recipes/libmodbus/libmodbus_3.0.4.oe.sig b/recipes/libmodbus/libmodbus_3.0.4.oe.sig
new file mode 100644
index 0000000..c8d31e7
--- /dev/null
+++ b/recipes/libmodbus/libmodbus_3.0.4.oe.sig
@@ -0,0 +1 @@ 
+f808b5aa53b8fb3fe271fa3c655728abc7915487  v3.0.4.tar.gz