2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 SUMMARY_python2-rpm = "Python bindings for apps which will manupulate RPM packages"
17 DESCRIPTION_python2-rpm = "The python2-rpm package contains a module that permits applications \
18 written in the Python programming language to use the interface \
19 supplied by the RPM Package Manager libraries."
21 HOMEPAGE = "http://www.rpm.org"
23 # libraries are also LGPL - how to express this?
25 LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
27 SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
28 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
29 file://0001-Do-not-read-config-files-from-HOME.patch \
30 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
31 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
32 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
33 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
34 file://0001-Fix-build-with-musl-C-library.patch \
35 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
36 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
37 file://0001-Split-binary-package-building-into-a-separate-functi.patch \
38 file://0002-Run-binary-package-creation-via-thread-pools.patch \
39 file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
40 file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
41 file://0001-perl-disable-auto-reqs.patch \
42 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
46 SRCREV = "753f6941dc32e94047b7cfe713ddd604a810b4db"
50 DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python"
51 DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
53 inherit autotools gettext pkgconfig pythonnative
56 # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
57 EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
59 EXTRA_OECONF_append = " --without-lua --enable-python"
60 EXTRA_OECONF_append_libc-musl = " --disable-nls"
62 # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
64 # --localstatedir prevents rpm from writing its database to native sysroot when building images
66 # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
67 # Also disable plugins by default for native.
68 EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
69 EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
71 BBCLASSEXTEND = "native nativesdk"
74 PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
78 do_compile_append () {
80 cp -r ../../git/python/* ./
84 do_install_append () {
85 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
86 ${D}/${libdir}/rpm/macros
88 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
89 ${D}${libdir}/rpm/pythondistdeps.py \
90 ${D}${libdir}/rpm/python-macro-helper
92 # remove all contents except python2-rpm
95 rm -r ${D}/usr/include
96 rm -r ${D}/usr/lib/librpm*
97 rm -r ${D}/usr/lib/pkgconfig
99 rm -r ${D}/usr/lib/rpm
100 rm -r ${D}/usr/lib/rpm-plugins
101 # rm -r ${D}/usr/lib/.debug
105 python setup.py install \
106 --root=${D} --prefix=/usr \
107 --install-lib=${PYTHON_SITEPACKAGES_DIR}/ --install-data=${datadir}
110 PACKAGES = "python2-rpm rpm2-dbg"
111 PROVIDES = "python2-rpm rpm2-dbg"
112 FILES_python2-rpm = " \
113 ${PYTHON_SITEPACKAGES_DIR}/rpm/ \
114 ${PYTHON_SITEPACKAGES_DIR}/rpm-${PV}-py${PYTHON_BASEVERSION}.egg-info \
117 # rpm 5.x was packaging the rpm build tools separately
118 #RPROVIDES_${PN} += "rpm-build"
120 RDEPENDS_${PN} = "bash perl python-core"
121 RDEPENDS_python2-rpm = "rpm"
122 DEPENDS_python2-rpm = "rpm"