[OE-core] [PATCH] smart/rpm: nativesdk should get RPM_ETCRPM from SDKTARGETSYSROOT not NATIVE_SYSROOT
Bian Naimeng
biannm at cn.fujitsu.com
Fri Oct 23 02:10:36 UTC 2015
The config file of rpm will be installed into SDKTARGETSYSROOT for each architecture,
so RPM_ETCRPM should be set to SDKTARGETSYSROOT/etc/rpm.
Signed-off-by: Bian Naimeng <biannm at cn.fujitsu.com>
---
meta/recipes-devtools/python/python-smartpm_git.bb | 14 ++++++++++----
meta/recipes-devtools/rpm/rpm_5.4+cvs.bb | 22 ++++++++++++++--------
meta/recipes-devtools/rpm/rpm_5.4.14.bb | 22 ++++++++++++++--------
3 files changed, 38 insertions(+), 20 deletions(-)
diff --git a/meta/recipes-devtools/python/python-smartpm_git.bb b/meta/recipes-devtools/python/python-smartpm_git.bb
index d6c378b..21faafe 100644
--- a/meta/recipes-devtools/python/python-smartpm_git.bb
+++ b/meta/recipes-devtools/python/python-smartpm_git.bb
@@ -92,20 +92,26 @@ do_install_append() {
fi
}
-add_native_wrapper() {
+add_native_or_sdk_wrapper() {
+ if [ "$1" = "sdk" ]; then
+ RPM_ETCRPM='$'{RPM_ETCRPM-'$'SDKTARGETSYSROOT/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('base_prefix', True))}/rpm}
+ else
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm}
+ fi
+
create_wrapper ${D}/${bindir}/smart \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
}
do_install_append_class-native() {
sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
- add_native_wrapper
+ add_native_or_sdk_wrapper "native"
}
do_install_append_class-nativesdk() {
- add_native_wrapper
+ add_native_or_sdk_wrapper "sdk"
}
PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
diff --git a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
index 8903f3b..e452445 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -488,41 +488,47 @@ do_install_append() {
}
-add_native_wrapper() {
+add_native_or_sdk_wrapper() {
+ if [ $1 = "sdk" ]; then
+ RPM_ETCRPM='$'{RPM_ETCRPM-'$'SDKTARGETSYSROOT/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('base_prefix', True))}/rpm}
+ else
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm}
+ fi
+
create_wrapper ${D}/${bindir}/rpm \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpm2cpio \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmbuild \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmconstant \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
create_wrapper $rpm_binary \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
done
}
do_install_append_class-native() {
- add_native_wrapper
+ add_native_or_sdk_wrapper "native"
}
do_install_append_class-nativesdk() {
- add_native_wrapper
+ add_native_or_sdk_wrapper "sdk"
}
BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index b450c6f..75a7c3b 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -477,41 +477,47 @@ do_install_append() {
}
-add_native_wrapper() {
+add_native_or_sdk_wrapper() {
+ if [ "$1" = "sdk" ]; then
+ RPM_ETCRPM='$'{RPM_ETCRPM-'$'SDKTARGETSYSROOT/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('base_prefix', True))}/rpm}
+ else
+ RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm}
+ fi
+
create_wrapper ${D}/${bindir}/rpm \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpm2cpio \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmbuild \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
create_wrapper ${D}/${bindir}/rpmconstant \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
create_wrapper $rpm_binary \
RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
- RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+ RPM_ETCRPM=${RPM_ETCRPM} \
RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
done
}
do_install_append_class-native() {
- add_native_wrapper
+ add_native_or_sdk_wrapper "native"
}
do_install_append_class-nativesdk() {
- add_native_wrapper
+ add_native_or_sdk_wrapper "sdk"
}
BBCLASSEXTEND = "native nativesdk"
--
1.9.1
More information about the Openembedded-core
mailing list