summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch26
-rw-r--r--meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch29
-rw-r--r--meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch57
-rw-r--r--meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb33
4 files changed, 145 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch b/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch
new file mode 100644
index 000000000..40b082e77
--- /dev/null
+++ b/meta-networking/recipes-protocols/openlldp/files/0001-Fix-musl-libc-build-issue.patch
@@ -0,0 +1,26 @@
1From a64e52f9b58519aa2b8a1073fa6c04da04933428 Mon Sep 17 00:00:00 2001
2From: Jonathan Richardson <jonathan.richardson@broadcom.com>
3Date: Wed, 26 Feb 2020 12:16:38 -0800
4Subject: [PATCH] Fix musl libc build issue
5
6clif.h should include sys/types.h for the definition of pid_t. It fails
7to compile when using musl libc.
8
9Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
10
11---
12 include/clif.h | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/include/clif.h b/include/clif.h
16index 648eedf..92f4fd8 100644
17--- a/include/clif.h
18+++ b/include/clif.h
19@@ -32,6 +32,7 @@
20 #ifndef CLIF_H
21 #define CLIF_H
22
23+#include <sys/types.h>
24 #include <sys/un.h>
25 #include "clif_sock.h"
26
diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch
new file mode 100644
index 000000000..b58fc104d
--- /dev/null
+++ b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-include-path-to-generated-version.h.patch
@@ -0,0 +1,29 @@
1From eb14aa66dc0384071af401cced8c02993b55502e Mon Sep 17 00:00:00 2001
2From: Jonathan Richardson <jonathan.richardson@broadcom.com>
3Date: Wed, 26 Feb 2020 15:54:51 -0800
4Subject: [PATCH] autotools: Add include path to generated version.h
5
6When the build dir isn't the same as source dir it fails to compile
7because the generated version.h from AC_CONFIG_FILES is always in build
8dir. Include the path to it in AM_CPPFLAGS.
9
10Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
11
12---
13 Makefile.am | 3 +++
14 1 file changed, 3 insertions(+)
15
16diff --git a/Makefile.am b/Makefile.am
17index 0fb9bb0..2952019 100644
18--- a/Makefile.am
19+++ b/Makefile.am
20@@ -14,6 +14,9 @@ endif
21 AM_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR="\"${sysconfdir}\"" \
22 -D_FORTIFY_SOURCE=2
23
24+# Required for the generated version.h when build dir is not the same as srcdir.
25+AM_CPPFLAGS += -I${top_builddir}/include
26+
27 ACLOCAL_AMFLAGS = -I m4
28
29 parse_cli.o: CFLAGS+=-U_FORTIFY_SOURCE -Wno-error
diff --git a/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch
new file mode 100644
index 000000000..a26a5299a
--- /dev/null
+++ b/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch
@@ -0,0 +1,57 @@
1From dc3f2250908587710f109c80ddf8a94f0bc40b82 Mon Sep 17 00:00:00 2001
2From: Jonathan Richardson <jonathan.richardson@broadcom.com>
3Date: Fri, 6 Apr 2018 10:49:04 -0700
4Subject: [PATCH] autotools: Add option to disable installation of systemd conf
5 files
6
7Add option to configure.ac to enable or disable install of systemd conf
8files. If --with-systemdsystemunitdir is passed to configure then the
9files will be installed to the provided directory. If the option isn't
10provided then the value is determined from the systemd pkgconfig file,
11if found in PKG_CONFIG_PATH.
12
13This change is required because Makefile.am always installed the files
14to a hard coded path that couldn't be changed.
15
16
17Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
18---
19 Makefile.am | 3 ++-
20 configure.ac | 9 +++++++++
21 2 files changed, 11 insertions(+), 1 deletion(-)
22
23diff --git a/Makefile.am b/Makefile.am
24index 292c0fd..0fb9bb0 100644
25--- a/Makefile.am
26+++ b/Makefile.am
27@@ -138,8 +138,9 @@ install-data-hook: installdirs-local
28 pkgconfigdir = ${libdir}/pkgconfig
29 pkgconfig_DATA = lldpad.pc liblldp_clif.pc
30
31-systemdsystemunitdir = $(prefix)/lib/systemd/system
32+if HAVE_SYSTEMD
33 dist_systemdsystemunit_DATA = lldpad.service lldpad.socket
34+endif
35
36 bashcompletiondir = $(sysconfdir)/bash_completion.d
37 dist_bashcompletion_DATA = contrib/bash_completion/lldpad contrib/bash_completion/lldptool
38diff --git a/configure.ac b/configure.ac
39index 0667446..f75f433 100644
40--- a/configure.ac
41+++ b/configure.ac
42@@ -95,6 +95,15 @@ AC_TYPE_UINT16_T
43 AC_TYPE_UINT32_T
44 AC_TYPE_UINT8_T
45
46+# Support for systemd unit files.
47+AC_ARG_WITH([systemdsystemunitdir],
48+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
49+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
50+if test "x$with_systemdsystemunitdir" != xno; then
51+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
52+fi
53+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
54+
55 AC_CONFIG_FILES([Makefile include/version.h lldpad.spec lldpad.pc liblldp_clif.pc])
56 AC_CONFIG_MACRO_DIR([m4])
57 AC_OUTPUT
diff --git a/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb b/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb
new file mode 100644
index 000000000..5fbf0645e
--- /dev/null
+++ b/meta-networking/recipes-protocols/openlldp/openlldp_1.0.1.bb
@@ -0,0 +1,33 @@
1SUMMARY = "Open-LLDP"
2DESCRIPTION = "Link Layer Discovery Protocol for Linux that includes support for DCBX"
3HOMEPAGE = "http://open-lldp.org/start"
4
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8c2bc283e65df398ced5f5b747e78162"
7
8S = "${WORKDIR}/git"
9
10inherit pkgconfig autotools
11inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}
12
13DEPENDS = "libnl libconfig readline"
14
15SRCREV = "36d729de7ce5b56cf061d94d610cf0510154820c"
16SRC_URI = "git://github.com/intel/openlldp.git;protocol=https;branch=master \
17 file://0001-Fix-musl-libc-build-issue.patch \
18 file://0001-autotools-Add-include-path-to-generated-version.h.patch \
19 file://0001-autotools-Add-option-to-disable-installation-of-syst.patch \
20 "
21
22# Makefile.am adds -Werror to AM_CFLAGS. There are warnings so disable it.
23TARGET_CFLAGS += "-Wno-error"
24
25# Enable install of systemd conf files.
26EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_system_unitdir}', '', d)}"
27
28SYSTEMD_SERVICE_${PN} = "lldpad.service lldpad.socket"
29
30# To enable service at boot set to enable in local.conf.
31SYSTEMD_AUTO_ENABLE ?= "disable"
32
33RRECOMMENDS_${PN} = "iproute2-tc"