[oe-commits] [openembedded-core] 61/61: nativesdk-rpm: Add wrappers for nativesdk support
git at git.openembedded.org
git at git.openembedded.org
Tue May 29 10:44:28 UTC 2018
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 05aaa0809c5c5f02987e1da11f749c4edb44e556
Author: Ovidiu Panait <ovidiu.panait at windriver.com>
AuthorDate: Fri May 25 10:48:29 2018 +0800
nativesdk-rpm: Add wrappers for nativesdk support
When installing the SDK to a non-default path, running "rpm --showrc" from the
sdk will produce the following error:
error: Unable to open /opt/windriver/wrlinux-small/10.17.41/sysroots/x86_64-wrlinuxsdk-linux/usr/lib/rpm/rpmrc for reading: No such file or directory.
Fix this by adding wrappers that dynamically export the RPM_CONFIGDIR,
RPM_ETCCONFIGDIR and MAGIC environment variables, pointing to the proper
sdk locations.
Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
Signed-off-by: Yi Zhao <yi.zhao at windriver.com>
Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-devtools/rpm/rpm_4.14.1.bb | 42 ++++++++++++++++++++++-----------
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
index d49530e..cf26c1e 100644
--- a/meta/recipes-devtools/rpm/rpm_4.14.1.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.14.1.bb
@@ -67,6 +67,7 @@ EXTRA_OECONF_append_libc-musl = " --disable-nls"
# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
# Also disable plugins by default for native.
EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
+EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
BBCLASSEXTEND = "native nativesdk"
@@ -77,21 +78,22 @@ ASNEEDED = ""
# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
# libmagic also has sysroot path contamination, so override it
+
+WRAPPER_TOOLS = " \
+ ${bindir}/rpm \
+ ${bindir}/rpm2archive \
+ ${bindir}/rpm2cpio \
+ ${bindir}/rpmbuild \
+ ${bindir}/rpmdb \
+ ${bindir}/rpmgraph \
+ ${bindir}/rpmkeys \
+ ${bindir}/rpmsign \
+ ${bindir}/rpmspec \
+ ${libdir}/rpm/rpmdeps \
+"
+
do_install_append_class-native() {
- tools="\
- ${bindir}/rpm \
- ${bindir}/rpm2archive \
- ${bindir}/rpm2cpio \
- ${bindir}/rpmbuild \
- ${bindir}/rpmdb \
- ${bindir}/rpmgraph \
- ${bindir}/rpmkeys \
- ${bindir}/rpmsign \
- ${bindir}/rpmspec \
- ${libdir}/rpm/rpmdeps \
- "
-
- for tool in $tools; do
+ for tool in ${WRAPPER_TOOLS}; do
create_wrapper ${D}$tool \
RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
@@ -100,6 +102,18 @@ do_install_append_class-native() {
done
}
+do_install_append_class-nativesdk() {
+ for tool in ${WRAPPER_TOOLS}; do
+ create_wrapper ${D}$tool \
+ RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+ RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \
+ MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \
+ RPM_NO_CHROOT_FOR_SCRIPTS=1
+ done
+
+ rm -rf ${D}/var
+}
+
# Rpm's make install creates var/tmp which clashes with base-files packaging
do_install_append_class-target() {
rm -rf ${D}/var
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list