summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2022-12-29 17:21:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-31 17:08:29 +0000
commit0174379afce8fe2e291a41a75bc6f4aa6304b695 (patch)
tree55f499eca2832f03d41a533513a830271ea1de26 /meta/recipes-devtools/rpm
parent40ad83204fa2b9128930a587ce48c593eaaa423b (diff)
downloadpoky-0174379afce8fe2e291a41a75bc6f4aa6304b695.tar.gz
nativesdk-rpm: export RPM_ETCCONFIGDIR and MAGIC in environment like RPM_CONFIGDIR
* the paths in wrapper don't work for rpmdeps which is installed in ${libdir}/rpm unlike other wrapped bins from ${bindir} these relative paths don't work there * replace environment.d-rpm.sh with here-doc so that we can use OE variables * in the end it might be better to just get rid of the wrappers at this point and depend on environment.d to always set right values * the wrappers were added in: commit 760103cdaed3e820888d8984ec0b76cfc831d534 Author: Ovidiu Panait <ovidiu.panait@windriver.com> Date: 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. * the rpm.sh in environment.d a bit later: commit 5f16fd0bf774314c79572daf4ba7e4a8ae209ba1 Author: hongxu <hongxu.jia@windriver.com> Date: Wed Jul 29 01:22:06 2020 -0700 nativesdk-rpm: adjust RPM_CONFIGDIR paths dynamically While installing/extracting SDK to a non-default dir(not /opt), run rpm failed: $ python3 -c "import rpm" |error: Unable to open /opt/windriver/wrlinux-graphics/20.31/sysroots/ x86_64-wrlinuxsdk-linux/usr/lib/rpm/rpmrc for reading: No such file or directory. This patch adds a flexible way to configure RPM_CONFIGDIR in SDK. (From OE-Core rev: f40a2658f5be6739c5dddab7f9f11e1f85a17102) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r--meta/recipes-devtools/rpm/files/environment.d-rpm.sh1
-rw-r--r--meta/recipes-devtools/rpm/rpm_4.18.0.bb14
2 files changed, 9 insertions, 6 deletions
diff --git a/meta/recipes-devtools/rpm/files/environment.d-rpm.sh b/meta/recipes-devtools/rpm/files/environment.d-rpm.sh
deleted file mode 100644
index 9b669a18d1..0000000000
--- a/meta/recipes-devtools/rpm/files/environment.d-rpm.sh
+++ /dev/null
@@ -1 +0,0 @@
1export RPM_CONFIGDIR="$OECORE_NATIVE_SYSROOT/usr/lib/rpm"
diff --git a/meta/recipes-devtools/rpm/rpm_4.18.0.bb b/meta/recipes-devtools/rpm/rpm_4.18.0.bb
index 5f3986d8a3..152cab490d 100644
--- a/meta/recipes-devtools/rpm/rpm_4.18.0.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.18.0.bb
@@ -25,7 +25,6 @@ LICENSE = "GPL-2.0-only"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f" 25LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
26 26
27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protocol=https \ 27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protocol=https \
28 file://environment.d-rpm.sh \
29 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \ 28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
30 file://0001-Do-not-read-config-files-from-HOME.patch \ 29 file://0001-Do-not-read-config-files-from-HOME.patch \
31 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \ 30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
@@ -120,16 +119,21 @@ do_install:append:class-native() {
120do_install:append:class-nativesdk() { 119do_install:append:class-nativesdk() {
121 for tool in ${WRAPPER_TOOLS}; do 120 for tool in ${WRAPPER_TOOLS}; do
122 test -x ${D}$tool && create_wrapper ${D}$tool \ 121 test -x ${D}$tool && create_wrapper ${D}$tool \
123 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ 122 RPM_CONFIGDIR='$'{RPM_CONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm} \
124 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ 123 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
125 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ 124 MAGIC=''{MAGIC-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc} \
126 RPM_NO_CHROOT_FOR_SCRIPTS=1 125 RPM_NO_CHROOT_FOR_SCRIPTS=1
127 done 126 done
128 127
129 rm -rf ${D}/var 128 rm -rf ${D}/var
130 129
131 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d 130 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
132 install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh 131 cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
132 export RPM_CONFIGDIR="$OECORE_NATIVE_SYSROOT${libdir}/rpm"
133 export RPM_ETCCONFIGDIR="$OECORE_NATIVE_SYSROOT${sysconfdir}"
134 export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
135 export RPM_NO_CHROOT_FOR_SCRIPTS=1
136 EOF
133} 137}
134 138
135# Rpm's make install creates var/tmp which clashes with base-files packaging 139# Rpm's make install creates var/tmp which clashes with base-files packaging