summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-networking/recipes-protocols/net-snmp')
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch168
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch10
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch62
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch42
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch15
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch15
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch19
-rw-r--r--external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb66
8 files changed, 320 insertions, 77 deletions
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch
new file mode 100644
index 00000000..dd159b9c
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-pkg-config-support-for-building-applications-and.patch
@@ -0,0 +1,168 @@
+From 4bf83597379523032663c8e95b3786a217c9a849 Mon Sep 17 00:00:00 2001
+From: Hugh McMaster <hugh.mcmaster@outlook.com>
+Date: Wed, 3 Apr 2019 21:36:03 +1100
+Subject: [PATCH] Add pkg-config support for building applications and
+ sub-agents
+
+The netsnmp package should be used when building Net-SNMP applications.
+The netsnmp-agent package should be used when building Net-SNMP subagents.
+
+Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
+[ bvanassche: edited makefile code and .pc files; added ./configure changes ]
+
+Upstream-Status: Backport
+https://sourceforge.net/p/net-snmp/patches/_discuss/thread/a0d66e91dd/f940/attachment/0001-Add-pkg-config-support-for-building-applications-and.patch
+---
+ Makefile.in | 2 ++
+ Makefile.rules | 30 ++++++++++++++++++++++++++----
+ configure | 4 ++++
+ configure.ac | 1 +
+ netsnmp-agent.pc.in | 12 ++++++++++++
+ netsnmp.pc.in | 12 ++++++++++++
+ 6 files changed, 57 insertions(+), 4 deletions(-)
+ create mode 100644 netsnmp-agent.pc.in
+ create mode 100644 netsnmp.pc.in
+
+diff --git a/Makefile.in b/Makefile.in
+index 9dbdde1353..ec972636c2 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -35,6 +35,7 @@ INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h
+ INSTALLBUILTINCLUDEHEADERS=@FEATUREHEADERS@
+ INSTALLBINSCRIPTS=net-snmp-config net-snmp-create-v3-user
+ INSTALLUCDHEADERS=ucd-snmp-config.h version.h mib_module_config.h
++INSTALL_PKGCONFIG=netsnmp.pc netsnmp-agent.pc
+
+ #
+ # other install rules.
+@@ -275,6 +276,7 @@ configclean: makefileclean
+ libtool include/net-snmp/net-snmp-config.h \
+ net-snmp-config net-snmp-config-x configure-summary \
+ net-snmp-create-v3-user net-snmp-create-v3-user-x
++ rm -f *.pc
+ rm -f mibs/.index
+ rm -f include/net-snmp/agent/mib_module_config.h \
+ include/net-snmp/agent/agent_module_config.h \
+diff --git a/Makefile.rules b/Makefile.rules
+index 9e9e9009e5..e714f91e72 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -85,12 +85,14 @@ subdirs:
+ # installlibs handles local, ucd and subdir libs. need to do subdir libs
+ # before bins, sinze those libs may be needed for successful linking
+ install: installlocalheaders @installucdheaders@ \
+- installlibs \
+- installlocalbin installlocalsbin \
++ installlibs install_pkgconfig \
++ installlocalbin installlocalsbin \
+ installsubdirs $(OTHERINSTALL)
+
+-uninstall: uninstalllibs uninstallbin uninstallsbin uninstallheaders \
+- uninstallsubdirs $(OTHERUNINSTALL)
++uninstall: uninstalllibs uninstall_pkgconfig \
++ uninstallbin uninstallsbin \
++ uninstallheaders \
++ uninstallsubdirs $(OTHERUNINSTALL)
+
+ installprogs: installbin installsbin
+
+@@ -287,6 +289,26 @@ uninstalllibs:
+ done \
+ fi
+
++#
++# pkg-config files
++#
++install_pkgconfig: $(INSTALL_PKGCONFIG)
++ @if test "x$(INSTALL_PKGCONFIG)" != x; then \
++ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir)/pkgconfig; \
++ for i in $(INSTALL_PKGCONFIG); do \
++ echo "installing $$i in $(INSTALL_PREFIX)$(libdir)/pkgconfig"; \
++ done; \
++ $(INSTALL) $(INSTALL_PKGCONFIG) $(INSTALL_PREFIX)$(libdir)/pkgconfig; \
++ fi
++
++uninstall_pkgconfig:
++ @if test "x$(INSTALL_PKGCONFIG)" != x; then \
++ for i in $(INSTALL_PKGCONFIG); do \
++ echo "removing $$i from $(INSTALL_PREFIX)$(libdir)/pkgconfig"; \
++ $(UNINSTALL) $(INSTALL_PREFIX)$(libdir)/pkgconfig/$$i;\
++ done; \
++ fi
++
+ #
+ # normal bin binaries
+ #
+diff --git a/configure b/configure
+index cad6b74486..8909bffe05 100755
+--- a/configure
++++ b/configure
+@@ -31717,6 +31717,8 @@ ac_config_files="$ac_config_files net-snmp-config:net-snmp-config.in"
+
+ ac_config_files="$ac_config_files net-snmp-create-v3-user:net-snmp-create-v3-user.in"
+
++ac_config_files="$ac_config_files netsnmp.pc:netsnmp.pc.in netsnmp-agent.pc:netsnmp-agent.pc.in"
++
+ ac_config_files="$ac_config_files dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in"
+
+ ac_config_files="$ac_config_files local/snmpconf"
+@@ -32740,6 +32742,8 @@ do
+ "mibs/Makefile") CONFIG_FILES="$CONFIG_FILES mibs/Makefile:Makefile.top:mibs/Makefile.in:Makefile.rules" ;;
+ "net-snmp-config") CONFIG_FILES="$CONFIG_FILES net-snmp-config:net-snmp-config.in" ;;
+ "net-snmp-create-v3-user") CONFIG_FILES="$CONFIG_FILES net-snmp-create-v3-user:net-snmp-create-v3-user.in" ;;
++ "netsnmp.pc") CONFIG_FILES="$CONFIG_FILES netsnmp.pc:netsnmp.pc.in" ;;
++ "netsnmp-agent.pc") CONFIG_FILES="$CONFIG_FILES netsnmp-agent.pc:netsnmp-agent.pc.in" ;;
+ "dist/generation-scripts/gen-variables") CONFIG_FILES="$CONFIG_FILES dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in" ;;
+ "local/snmpconf") CONFIG_FILES="$CONFIG_FILES local/snmpconf" ;;
+ "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+diff --git a/configure.ac b/configure.ac
+index 1622b7c051..898b50f368 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -118,6 +118,7 @@ AC_CONFIG_FILES([net-snmp-config:net-snmp-config.in],
+ [chmod +x net-snmp-config])
+ AC_CONFIG_FILES([net-snmp-create-v3-user:net-snmp-create-v3-user.in],
+ [chmod +x net-snmp-create-v3-user])
++AC_CONFIG_FILES([netsnmp.pc:netsnmp.pc.in netsnmp-agent.pc:netsnmp-agent.pc.in])
+ AC_CONFIG_FILES([dist/generation-scripts/gen-variables:dist/generation-scripts/gen-variables.in])
+ AC_CONFIG_FILES([local/snmpconf])
+
+diff --git a/netsnmp-agent.pc.in b/netsnmp-agent.pc.in
+new file mode 100644
+index 0000000000..3a1c77bbf8
+--- /dev/null
++++ b/netsnmp-agent.pc.in
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++includedir=@includedir@
++libdir=@libdir@
++
++Name: netsnmp-agent (@PACKAGE_NAME@)
++Description: SNMP (Simple Network Management Protocol) sub-agent SDK.
++URL: http://www.net-snmp.org
++Version: @PACKAGE_VERSION@
++Cflags: -I${includedir}
++Libs: -L${libdir} -lnetsnmpmibs -lnetsnmpagent -lnetsnmp
++Libs.private: @LDFLAGS@ @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@
+diff --git a/netsnmp.pc.in b/netsnmp.pc.in
+new file mode 100644
+index 0000000000..0a1f5785a4
+--- /dev/null
++++ b/netsnmp.pc.in
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++includedir=@includedir@
++libdir=@libdir@
++
++Name: netsnmp (@PACKAGE_NAME@)
++Description: SNMP (Simple Network Management Protocol) daemon and applications.
++URL: http://www.net-snmp.org
++Version: @PACKAGE_VERSION@
++Cflags: -I${includedir}
++Libs: -L${libdir} -lnetsnmp
++Libs.private: @LDFLAGS@ @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@
+--
+2.26.2
+
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch
index bfc55a08..5ad7470c 100644
--- a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch
@@ -1,4 +1,4 @@
-From 7ae2ce8dbf1c54d4e2db4a5f49397a239baadc49 Mon Sep 17 00:00:00 2001
+From 2ad4df6d503be72a8910c3087611adb33d77ffde Mon Sep 17 00:00:00 2001
From: Li xin <lixin.fnst@cn.fujitsu.com>
Date: Fri, 21 Aug 2015 18:23:13 +0900
Subject: [PATCH] config_os_headers: Error Fix
@@ -13,16 +13,15 @@ conftest.c:168:17: fatal error: pkg.h: No such file or directory
Upstream-Status: pending
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
-
---
configure.d/config_os_headers | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
-index af99746..83b2e31 100644
+index 2fdb5a35d6..0272f02c8e 100644
--- a/configure.d/config_os_headers
+++ b/configure.d/config_os_headers
-@@ -489,8 +489,8 @@ then
+@@ -487,8 +487,8 @@ then
unset ac_cv_header_pkg_h
netsnmp_save_CPPFLAGS="$CPPFLAGS"
netsnmp_save_LDFLAGS="$LDFLAGS"
@@ -33,3 +32,6 @@ index af99746..83b2e31 100644
AC_CHECK_HEADERS(pkg.h,
NETSNMP_SEARCH_LIBS(pkg_init, pkg,
AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng])))
+--
+2.26.2
+
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch
new file mode 100644
index 00000000..33a1e745
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch
@@ -0,0 +1,62 @@
+From 383e67e359b89abe0440597ce414297892ade511 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Tue, 26 Feb 2019 14:26:07 +0800
+Subject: [PATCH] net-snmp: fix compile error with --disable-des
+
+| scapi.c: In function 'sc_encrypt':
+| scapi.c:1256:5: error: 'pad_size' undeclared (first use in this function); did you mean 'dysize'?
+| pad_size = pai->pad_size;
+| ^~~~~~~~
+| dysize
+
+pad_size is defined only without --disable-des
+[snip]
+#ifndef NETSNMP_DISABLE_DES
+ int pad, plast, pad_size = 0;
+
+but used when disable-des,
+[snip]
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+ pad_size = pai->pad_size;
+
+ memset(my_iv, 0, sizeof(my_iv));
+
+#ifndef NETSNMP_DISABLE_DES
+ if (USM_CREATE_USER_PRIV_DES == (pai->type & USM_PRIV_MASK_ALG)) {
+
+ /*
+
+fix by move it into #ifndef NETSNMP_DISABLE_DES
+
+Upstream-Status: Submitted [https://sourceforge.net/p/net-snmp/bugs/2927/]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ snmplib/scapi.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/snmplib/scapi.c b/snmplib/scapi.c
+index 8ad1d70d90..8c6882d9ab 100644
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -1251,7 +1251,6 @@ sc_encrypt(const oid * privtype, size_t privtypelen,
+
+ QUITFUN(SNMPERR_GENERR, sc_encrypt_quit);
+ }
+- pad_size = pai->pad_size;
+
+ memset(my_iv, 0, sizeof(my_iv));
+
+@@ -1261,6 +1260,8 @@ sc_encrypt(const oid * privtype, size_t privtypelen,
+ /*
+ * now calculate the padding needed
+ */
++
++ pad_size = pai->pad_size;
+ pad = pad_size - (ptlen % pad_size);
+ plast = (int) ptlen - (pad_size - pad);
+ if (pad == pad_size)
+--
+2.26.2
+
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch
deleted file mode 100644
index 2d540967..00000000
--- a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From f592398b1c659f84168f5c84f63af3b71454b8f5 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 28 Sep 2018 22:59:23 +0800
-Subject: [PATCH] remove configure options from versioninfo
-
-Configure options contains host build paths which breaks
-binary reproducibility.
-
-It is no harm to remove it from version info.
-
-Upstream-Status: Inappropriate [cross compile specific]
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- agent/mibgroup/ucd-snmp/versioninfo.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/agent/mibgroup/ucd-snmp/versioninfo.c b/agent/mibgroup/ucd-snmp/versioninfo.c
-index a5151c1..1160382 100644
---- a/agent/mibgroup/ucd-snmp/versioninfo.c
-+++ b/agent/mibgroup/ucd-snmp/versioninfo.c
-@@ -92,7 +92,7 @@ var_extensible_version(struct variable *vp,
- static char errmsg[300];
- char *cptr;
- time_t curtime;
--#ifdef NETSNMP_CONFIGURE_OPTIONS
-+#if 0
- static char config_opts[] = NETSNMP_CONFIGURE_OPTIONS;
- #endif
-
-@@ -126,7 +126,7 @@ var_extensible_version(struct variable *vp,
- *var_len = strlen(errmsg);
- return ((u_char *) errmsg);
- case VERCONFIG:
--#ifdef NETSNMP_CONFIGURE_OPTIONS
-+#if 0
- *var_len = strlen(config_opts);
- if (*var_len > 1024)
- *var_len = 1024; /* mib imposed restriction */
---
-2.7.4
-
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch
index 74b0c12e..fb773e63 100644
--- a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch
@@ -1,4 +1,7 @@
-net-snmp: add knob whether nlist.h are checked
+From a1134a31d417cc05a1fdb094f613a00a7a5e7ac5 Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Thu, 28 May 2020 09:46:34 -0500
+Subject: [PATCH] net-snmp: add knob whether nlist.h are checked
Previously, it still was checked when there was no nlish.h in sysroots directory.
Add knob to decide whether nlist.h are checked or not.
@@ -7,14 +10,14 @@ Upstream-status: Pending
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
- configure.d/config_os_headers | 2 ++
+ configure.d/config_os_headers | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
-index d903f58..a05d30e 100644
+index 2fdb5a35d6..af997461d5 100644
--- a/configure.d/config_os_headers
+++ b/configure.d/config_os_headers
-@@ -31,6 +31,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl
+@@ -32,6 +32,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl
[sys/un.h ])
# Library and Agent:
@@ -22,7 +25,7 @@ index d903f58..a05d30e 100644
AC_CHECK_HEADERS([nlist.h],,,[
AC_INCLUDES_DEFAULT
[
-@@ -38,6 +39,7 @@ AC_INCLUDES_DEFAULT
+@@ -39,6 +40,7 @@ AC_INCLUDES_DEFAULT
#define LIBBSD_DISABLE_DEPRECATED 1
#endif
]])
@@ -31,5 +34,5 @@ index d903f58..a05d30e 100644
# Library:
AC_CHECK_HEADERS([fcntl.h io.h kstat.h ] dnl
--
-1.7.9.5
+2.26.2
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch
new file mode 100644
index 00000000..b0dbf5ad
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch
@@ -0,0 +1,15 @@
+Reproducible build: To avoid build host paths being written into binaries,
+accept NETSNMP_CONFIGURE_OPTIONS from the environment.
+NETSNMP_CONFIGURE_OPTIONS can be set either null or to a fixed value.
+
+--- net-snmp-5.8.original/configure.ac 2018-11-20 17:41:39.926529072 +1300
++++ net-snmp-5.8/configure.ac 2018-11-20 17:54:44.488180224 +1300
+@@ -28,7 +28,7 @@
+ #
+ # save the configure arguments
+ #
+-AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"$ac_configure_args",
++AC_DEFINE_UNQUOTED(NETSNMP_CONFIGURE_OPTIONS,"${NETSNMP_CONFIGURE_OPTIONS-$ac_configure_args}",
+ [configure options specified])
+ CONFIGURE_OPTIONS="\"$ac_configure_args\""
+ AC_SUBST(CONFIGURE_OPTIONS)
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch
new file mode 100644
index 00000000..4316c7a7
--- /dev/null
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch
@@ -0,0 +1,19 @@
+Reproducible build: Don't check for /etc/printcap on the build machine when
+cross-compiling. Use AC_CHECK_FILE to set the cached variable
+ac_cv_file__etc_printcap instead. When cross-compiling, this variable should be
+set in the environment to "yes" or "no" as appropriate for the target platform.
+
+--- net-snmp-5.8.original/configure.d/config_os_misc4 2018-11-20 17:05:03.986274522 +1300
++++ net-snmp-5.8/configure.d/config_os_misc4 2018-11-20 17:08:32.250700448 +1300
+@@ -116,9 +116,9 @@
+ [Path to the lpstat command])
+ AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available])
+ fi
+-if test -r /etc/printcap; then
++AC_CHECK_FILE([/etc/printcap],
+ AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists])
+-fi
++)
+
+
+ # Check ps args
diff --git a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
index 757c1dbf..5466649a 100644
--- a/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
+++ b/external/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
@@ -1,13 +1,13 @@
SUMMARY = "Various tools relating to the Simple Network Management Protocol"
HOMEPAGE = "http://www.net-snmp.org/"
SECTION = "net"
-LICENSE = "BSD"
+LICENSE = "BSD & MIT"
-LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687"
DEPENDS = "openssl libnl pciutils"
-SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
+SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
file://init \
file://snmpd.conf \
file://snmptrapd.conf \
@@ -24,15 +24,18 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
file://0004-configure-fix-incorrect-variable.patch \
file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
file://net-snmp-fix-for-disable-des.patch \
- file://0001-remove-configure-options-from-versioninfo.patch \
+ file://reproducibility-have-printcap.patch \
+ file://reproducibility-accept-configure-options-from-env.patch \
+ file://0001-net-snmp-fix-compile-error-disable-des.patch \
+ file://0001-Add-pkg-config-support-for-building-applications-and.patch \
"
-SRC_URI[md5sum] = "6aae5948df7efde626613d6a4b3cd9d4"
-SRC_URI[sha256sum] = "c6291385b8ed84f05890fe4197005daf7e7ee7b082c2e390fa114a9477a56042"
+SRC_URI[md5sum] = "63bfc65fbb86cdb616598df1aff6458a"
+SRC_URI[sha256sum] = "b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/"
UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/"
-inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest
+inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest multilib_script multilib_header
EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
@@ -41,15 +44,15 @@ CCACHE = ""
TARGET_CC_ARCH += "${LDFLAGS}"
-PACKAGECONFIG ??= ""
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} des"
PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils"
PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl"
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\
- perl, perl perl-lib"
+ perl,"
+PACKAGECONFIG[des] = "--enable-des,--disable-des"
EXTRA_OECONF = "--enable-shared \
--disable-manuals \
@@ -68,12 +71,17 @@ CACHED_CONFIGUREVARS = " \
ac_cv_header_valgrind_memcheck_h=no \
ac_cv_ETC_MNTTAB=/etc/mtab \
lt_cv_shlibpath_overrides_runpath=yes \
+ ac_cv_path_UNAMEPROG=${base_bindir}/uname \
+ ac_cv_file__etc_printcap=no \
+ NETSNMP_CONFIGURE_OPTIONS= \
"
export PERLPROG="${bindir}/env perl"
PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}"
HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}"
+PTEST_BUILD_HOST_FILES += "net-snmp-config gen-variables"
+
do_configure_prepend() {
sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \
"${S}"/configure \
@@ -81,8 +89,8 @@ do_configure_prepend() {
if [ "${HAS_PERL}" = "1" ]; then
# this may need to be changed when package perl has any change.
- cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config.pm ${WORKDIR}/
- cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config_heavy.pl ${WORKDIR}/
+ cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/Config.pm ${WORKDIR}/
+ cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/*/Config_heavy.pl ${WORKDIR}/
sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \
-e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \
-e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \
@@ -114,11 +122,16 @@ do_install_append() {
install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
-i ${D}${bindir}/net-snmp-create-v3-user
- sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
- -e "s@\([^ ]*-fdebug-prefix-map=[^ ]*\)\1*@@g" \
- -e "s@\([^ ]*--sysroot=[^ ]*\)\1*@@g" \
- -e "s@\([^ ]*--with-libtool-sysroot=[^ ]*\)\1*@@g" \
- -e "s@\([^ ]*--with-install-prefix=[^ ]*\)\1*@@g" \
+ sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \
+ -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
+ -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
+ -e 's@[^ ]*--sysroot=[^ "]*@@g' \
+ -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
+ -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
+ -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
+ -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
+ -e 's@-L${STAGING_DIR_HOST}${libdir}@@g' \
+ -e 's@-I${STAGING_DIR_HOST}${includedir}@@g' \
-i ${D}${bindir}/net-snmp-config
if [ "${HAS_PERL}" = "1" ]; then
@@ -126,6 +139,8 @@ do_install_append() {
-e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
-i ${D}${bindir}/net-snmp-config
fi
+
+ oe_multilib_header net-snmp/net-snmp-config.h
}
do_install_ptest() {
@@ -169,12 +184,6 @@ net_snmp_sysroot_preprocess () {
fi
}
-PACKAGE_PREPROCESS_FUNCS += "net_snmp_package_preprocess"
-net_snmp_package_preprocess () {
- sed -e 's@${RECIPE_SYSROOT}@@g' \
- -i ${PKGD}${bindir}/net-snmp-config
-}
-
PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \
${PN}-server-snmpd ${PN}-server-snmptrapd \
${PN}-lib-netsnmp ${PN}-lib-agent ${PN}-lib-helpers \
@@ -187,7 +196,8 @@ ALLOW_EMPTY_${PN} = "1"
ALLOW_EMPTY_${PN}-server = "1"
ALLOW_EMPTY_${PN}-libs = "1"
-FILES_${PN}-perl-modules = "${libdir}/perl/*"
+FILES_${PN}-perl-modules = "${libdir}/perl?/*"
+RDEPENDS_${PN}-perl-modules = "perl"
FILES_${PN}-libs = ""
FILES_${PN}-mibs = "${datadir}/snmp/mibs"
@@ -211,7 +221,11 @@ FILES_${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}"
FILES_${PN} = ""
FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/"
FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/"
-FILES_${PN}-dev += "${bindir}/mib2c ${bindir}/mib2c-update"
+FILES_${PN}-dev += "${bindir}/mib2c \
+ ${bindir}/mib2c-update \
+ ${bindir}/net-snmp-config \
+ ${bindir}/net-snmp-create-v3-user \
+"
CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf"
CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf"
@@ -259,3 +273,5 @@ RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
LEAD_SONAME = "libnetsnmp.so"
+
+MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config"