[oe] [meta-networking][PATCH v2] net-snmp: install net-snmp-config script to STAGING_BINDIR_CROSS

2014-05-12 Thread Alexandre Fournier
This recipe was installing net-snmp-config script to STAGING_BINDIR
instead of STAGING_BINDIR_CROSS, during the do_install. It is not
recommended and must be done after staging.

Changes:
* Remove STAGING_BINDIR manipulations from do_install_append
* Add net_snmp_sysroot_preprocess function instead
* Append net_snmp_sysroot_preprocess to SYSROOT_PREPROCESS_FUNCS

Signed-off-by: Alexandre Fournier 
---
 .../recipes-protocols/net-snmp/net-snmp_5.7.2.bb| 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb 
b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
index eb50d0f..f1e3a5d 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
@@ -49,19 +49,26 @@ do_install_append() {
 install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd
 install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/
 install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/
-install -d ${STAGING_BINDIR}
-install -m 0755 ${D}${bindir}/net-snmp-config ${STAGING_BINDIR}/
 sed -e "s@-I/usr/include@@g" \
 -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}@g" \
 -e "s@^exec_prefix=.*@exec_prefix=${STAGING_DIR_HOST}@g" \
 -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \
 -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \
--i ${STAGING_BINDIR}/net-snmp-config
+-i ${D}${bindir}/net-snmp-config
 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
 }
 
+SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess"
+
+net_snmp_sysroot_preprocess () {
+if [ -e ${D}${bindir}/net-snmp-config ]; then
+install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+install -m 755 ${D}${bindir}/net-snmp-config 
${SYSROOT_DESTDIR}${bindir_crossscripts}/
+fi
+}
+
 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static 
${PN}-libs \
 ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd 
${PN}-server-snmptrapd"
 
-- 
1.8.3.2

-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel


[oe] [meta-networking][PATCH v2] net-snmp: install net-snmp-config script to STAGING_BINDIR_CROSS

2014-05-22 Thread Alexandre Fournier
This recipe was installing net-snmp-config script to STAGING_BINDIR
instead of STAGING_BINDIR_CROSS, during the do_install. It is not
recommended and must be done after staging.

Changes:
* Remove STAGING_BINDIR manipulations from do_install_append
* Add net_snmp_sysroot_preprocess function instead
* Append net_snmp_sysroot_preprocess to SYSROOT_PREPROCESS_FUNCS

Signed-off-by: Alexandre Fournier 
---
 .../recipes-protocols/net-snmp/net-snmp_5.7.2.bb| 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb 
b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
index eb50d0f..f1e3a5d 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb
@@ -49,19 +49,26 @@ do_install_append() {
 install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd
 install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/
 install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/
-install -d ${STAGING_BINDIR}
-install -m 0755 ${D}${bindir}/net-snmp-config ${STAGING_BINDIR}/
 sed -e "s@-I/usr/include@@g" \
 -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}@g" \
 -e "s@^exec_prefix=.*@exec_prefix=${STAGING_DIR_HOST}@g" \
 -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \
 -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \
--i ${STAGING_BINDIR}/net-snmp-config
+-i ${D}${bindir}/net-snmp-config
 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
 }
 
+SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess"
+
+net_snmp_sysroot_preprocess () {
+if [ -e ${D}${bindir}/net-snmp-config ]; then
+install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+install -m 755 ${D}${bindir}/net-snmp-config 
${SYSROOT_DESTDIR}${bindir_crossscripts}/
+fi
+}
+
 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static 
${PN}-libs \
 ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd 
${PN}-server-snmptrapd"
 
-- 
1.8.5.5

-- 
___
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel