* [meta-networking][hardknott][PATCH 1/2] net-snmp: A little clean up
@ 2021-06-23 16:38 Peter Kjellerstedt
2021-06-23 16:38 ` [meta-networking][hardknott][PATCH 2/2] net-snmp: Support building for native Peter Kjellerstedt
0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2021-06-23 16:38 UTC (permalink / raw)
To: openembedded-devel
* Remove the explicit dependency on libnl as the libnl PACKAGECONFIG
depends on it as necessary.
* Add a PACKAGECONFIG for systemd to replace modifying EXTRA_OECONF
directly.
* Sort the PACKAGECONFIGs.
* Some whitespace clean up.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
.../net-snmp/net-snmp_5.9.bb | 35 +++++++++----------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
index d9040c164..f577fd1c1 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
@@ -5,7 +5,7 @@ LICENSE = "BSD & MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687"
-DEPENDS = "openssl libnl pciutils"
+DEPENDS = "openssl pciutils"
SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
file://init \
@@ -41,24 +41,23 @@ CCACHE = ""
TARGET_CC_ARCH += "${LDFLAGS}"
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} des smux"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} des smux"
+PACKAGECONFIG[des] = "--enable-des, --disable-des"
PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils"
+PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl"
-
-PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
-
-PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\
- perl,"
-PACKAGECONFIG[des] = "--enable-des,--disable-des"
+PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no, perl"
PACKAGECONFIG[smux] = ""
-
-EXTRA_OECONF = "--enable-shared \
- --disable-manuals \
- --with-defaults \
- --with-install-prefix=${D} \
- --with-persistent-directory=${localstatedir}/lib/net-snmp \
- ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
- --with-mib-modules='${MIB_MODULES}' \
+PACKAGECONFIG[systemd] = "--with-systemd, --without-systemd"
+
+EXTRA_OECONF = " \
+ --enable-shared \
+ --disable-manuals \
+ --with-defaults \
+ --with-install-prefix=${D} \
+ --with-persistent-directory=${localstatedir}/lib/net-snmp \
+ --with-endianness=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \
+ --with-mib-modules='${MIB_MODULES}' \
"
MIB_MODULES = ""
@@ -117,7 +116,7 @@ do_install_append() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
- sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+ 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=[^ "]*@@g' \
@@ -232,8 +231,6 @@ INITSCRIPT_PACKAGES = "${PN}-server-snmpd"
INITSCRIPT_NAME_${PN}-server-snmpd = "snmpd"
INITSCRIPT_PARAMS_${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ."
-EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}"
-
SYSTEMD_PACKAGES = "${PN}-server-snmpd \
${PN}-server-snmptrapd"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [meta-networking][hardknott][PATCH 2/2] net-snmp: Support building for native
2021-06-23 16:38 [meta-networking][hardknott][PATCH 1/2] net-snmp: A little clean up Peter Kjellerstedt
@ 2021-06-23 16:38 ` Peter Kjellerstedt
0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2021-06-23 16:38 UTC (permalink / raw)
To: openembedded-devel
Due to the sed commands in do_install_append() that removed
${STAGING_DIR_HOST} and it being empty when building for native, it was
impossible to add support for building this as native using a bbappend.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
.../recipes-protocols/net-snmp/net-snmp_5.9.bb | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
index f577fd1c1..2159342fc 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.bb
@@ -5,7 +5,8 @@ LICENSE = "BSD & MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687"
-DEPENDS = "openssl pciutils"
+DEPENDS = "openssl"
+DEPENDS_append_class-target = " pciutils"
SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
file://init \
@@ -72,8 +73,10 @@ CACHED_CONFIGUREVARS = " \
ac_cv_file__etc_printcap=no \
NETSNMP_CONFIGURE_OPTIONS= \
"
-export PERLPROG="${bindir}/env perl"
+PERLPROG = "${bindir}/env perl"
+PERLPROG_class-native = "${bindir_native}/env perl"
PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}"
+export PERLPROG
HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}"
@@ -126,11 +129,14 @@ do_install_append() {
-e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
-e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
-e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
- -e 's@${STAGING_DIR_HOST}@@g' \
-i ${D}${bindir}/net-snmp-config
- sed -e 's@${STAGING_DIR_HOST}@@g' \
- -i ${D}${libdir}/pkgconfig/netsnmp*.pc
+ # ${STAGING_DIR_HOST} is empty for native builds, and the sed command below
+ # will result in errors if run for native.
+ if [ "${STAGING_DIR_HOST}" ]; then
+ sed -e 's@${STAGING_DIR_HOST}@@g' \
+ -i ${D}${bindir}/net-snmp-config ${D}${libdir}/pkgconfig/netsnmp*.pc
+ fi
sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
-e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
@@ -270,3 +276,5 @@ RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
LEAD_SONAME = "libnetsnmp.so"
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config"
+
+BBCLASSEXTEND = "native"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-23 16:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 16:38 [meta-networking][hardknott][PATCH 1/2] net-snmp: A little clean up Peter Kjellerstedt
2021-06-23 16:38 ` [meta-networking][hardknott][PATCH 2/2] net-snmp: Support building for native Peter Kjellerstedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.