summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking/recipes-protocols
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-protocols')
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb35
5 files changed, 115 insertions, 58 deletions
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch
new file mode 100644
index 000000000..7e686ce7f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-fix-compile-error-disable-des.patch
@@ -0,0 +1,62 @@
+From e38c508ef401593b1d4fe42b62e42a49cfec82af 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 43caddf..c09deb0 100644
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -1253,7 +1253,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));
+
+@@ -1263,6 +1262,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.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-remove-configure-options-from-versioninfo.patch
deleted file mode 100644
index 2d540967e..000000000
--- a/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/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-accept-configure-options-from-env.patch
new file mode 100644
index 000000000..b0dbf5ad3
--- /dev/null
+++ b/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/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch
new file mode 100644
index 000000000..4316c7a71
--- /dev/null
+++ b/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/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
index 757c1dbf6..673142b4a 100644
--- a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb
@@ -1,9 +1,9 @@
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"
@@ -24,7 +24,9 @@ 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 \
"
SRC_URI[md5sum] = "6aae5948df7efde626613d6a4b3cd9d4"
SRC_URI[sha256sum] = "c6291385b8ed84f05890fe4197005daf7e7ee7b082c2e390fa114a9477a56042"
@@ -41,15 +43,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"
+PACKAGECONFIG[des] = "--enable-des,--disable-des"
EXTRA_OECONF = "--enable-shared \
--disable-manuals \
@@ -68,12 +70,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 \
@@ -114,11 +121,13 @@ 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@[^ ]*--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' \
-i ${D}${bindir}/net-snmp-config
if [ "${HAS_PERL}" = "1" ]; then
@@ -169,12 +178,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 \
OpenPOWER on IntegriCloud