summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait@windriver.com>2018-05-25 10:48:29 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-05-29 21:07:17 +0100
commit3b0e1e22753065ff18c55d84349538fba808fff0 (patch)
treea86ec76e3e7855ce5e698978716b78215d71d3e2 /meta
parentc9fc9110be33fe0f24bc3a7c242b584a4ca33e04 (diff)
downloadpoky-3b0e1e22753065ff18c55d84349538fba808fff0.tar.gz
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. (From OE-Core rev: 760103cdaed3e820888d8984ec0b76cfc831d534) Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.14.1.bb42
1 files 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 d49530e0b9..cf26c1e8db 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"
67# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled. 67# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
68# Also disable plugins by default for native. 68# Also disable plugins by default for native.
69EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins" 69EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
70EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
70 71
71BBCLASSEXTEND = "native nativesdk" 72BBCLASSEXTEND = "native nativesdk"
72 73
@@ -77,21 +78,22 @@ ASNEEDED = ""
77 78
78# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in 79# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
79# libmagic also has sysroot path contamination, so override it 80# libmagic also has sysroot path contamination, so override it
81
82WRAPPER_TOOLS = " \
83 ${bindir}/rpm \
84 ${bindir}/rpm2archive \
85 ${bindir}/rpm2cpio \
86 ${bindir}/rpmbuild \
87 ${bindir}/rpmdb \
88 ${bindir}/rpmgraph \
89 ${bindir}/rpmkeys \
90 ${bindir}/rpmsign \
91 ${bindir}/rpmspec \
92 ${libdir}/rpm/rpmdeps \
93"
94
80do_install_append_class-native() { 95do_install_append_class-native() {
81 tools="\ 96 for tool in ${WRAPPER_TOOLS}; do
82 ${bindir}/rpm \
83 ${bindir}/rpm2archive \
84 ${bindir}/rpm2cpio \
85 ${bindir}/rpmbuild \
86 ${bindir}/rpmdb \
87 ${bindir}/rpmgraph \
88 ${bindir}/rpmkeys \
89 ${bindir}/rpmsign \
90 ${bindir}/rpmspec \
91 ${libdir}/rpm/rpmdeps \
92 "
93
94 for tool in $tools; do
95 create_wrapper ${D}$tool \ 97 create_wrapper ${D}$tool \
96 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ 98 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
97 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ 99 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
@@ -100,6 +102,18 @@ do_install_append_class-native() {
100 done 102 done
101} 103}
102 104
105do_install_append_class-nativesdk() {
106 for tool in ${WRAPPER_TOOLS}; do
107 create_wrapper ${D}$tool \
108 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
109 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \
110 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \
111 RPM_NO_CHROOT_FOR_SCRIPTS=1
112 done
113
114 rm -rf ${D}/var
115}
116
103# Rpm's make install creates var/tmp which clashes with base-files packaging 117# Rpm's make install creates var/tmp which clashes with base-files packaging
104do_install_append_class-target() { 118do_install_append_class-target() {
105 rm -rf ${D}/var 119 rm -rf ${D}/var