Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-integ / recipes-devtools / rpm / rpm2_4.14.2.bb
1 SUMMARY_python2-rpm = "Python bindings for apps which will manupulate RPM packages"
2 DESCRIPTION_python2-rpm = "The python2-rpm package contains a module that permits applications \
3 written in the Python programming language to use the interface \
4 supplied by the RPM Package Manager libraries."
5
6 HOMEPAGE = "http://www.rpm.org"
7
8 # libraries are also LGPL - how to express this?
9 LICENSE = "GPL-2.0"
10 LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
11
12 SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
13            file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
14            file://0001-Do-not-read-config-files-from-HOME.patch \
15            file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
16            file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
17            file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
18            file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
19            file://0001-Fix-build-with-musl-C-library.patch \
20            file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
21            file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
22            file://0001-Split-binary-package-building-into-a-separate-functi.patch \
23            file://0002-Run-binary-package-creation-via-thread-pools.patch \
24            file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
25            file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
26            file://0001-perl-disable-auto-reqs.patch \
27            file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
28            "
29
30 PE = "1"
31 SRCREV = "753f6941dc32e94047b7cfe713ddd604a810b4db"
32
33 S = "${WORKDIR}/git"
34
35 DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python"
36 DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
37
38 inherit autotools gettext pkgconfig pythonnative
39 export PYTHON_ABI
40
41 # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
42 EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
43
44 EXTRA_OECONF_append = " --without-lua --enable-python"
45 EXTRA_OECONF_append_libc-musl = " --disable-nls"
46
47 # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
48 #
49 # --localstatedir prevents rpm from writing its database to native sysroot when building images
50 #
51 # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
52 # Also disable plugins by default for native.
53 EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
54 EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
55
56 BBCLASSEXTEND = "native nativesdk"
57
58 PACKAGECONFIG ??= ""
59 PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
60
61 ASNEEDED = ""
62
63 do_compile_append () {
64         cd python
65         cp -r ../../git/python/* ./
66         python setup.py build
67 }
68
69 do_install_append () {
70         sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
71             ${D}/${libdir}/rpm/macros
72
73         sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
74             ${D}${libdir}/rpm/pythondistdeps.py \
75             ${D}${libdir}/rpm/python-macro-helper
76
77         # remove all contents except python2-rpm
78         rm -r ${D}/var
79         rm -r ${D}/usr/share
80         rm -r ${D}/usr/include
81         rm -r ${D}/usr/lib/librpm*
82         rm -r ${D}/usr/lib/pkgconfig
83         # rm -r ${D}/usr/src
84         rm -r ${D}/usr/lib/rpm
85         rm -r ${D}/usr/lib/rpm-plugins
86         # rm -r ${D}/usr/lib/.debug
87         rm -r ${D}/usr/bin
88
89         cd python
90         python setup.py install \
91                 --root=${D} --prefix=/usr \
92                 --install-lib=${PYTHON_SITEPACKAGES_DIR}/ --install-data=${datadir}
93 }
94
95 PACKAGES = "python2-rpm rpm2-dbg"
96 PROVIDES = "python2-rpm rpm2-dbg"
97 FILES_python2-rpm = " \
98         ${PYTHON_SITEPACKAGES_DIR}/rpm/ \
99         ${PYTHON_SITEPACKAGES_DIR}/rpm-${PV}-py${PYTHON_BASEVERSION}.egg-info \
100         "
101
102 # rpm 5.x was packaging the rpm build tools separately
103 #RPROVIDES_${PN} += "rpm-build"
104
105 RDEPENDS_${PN} = "bash perl python-core"
106 RDEPENDS_python2-rpm = "rpm"
107 DEPENDS_python2-rpm = "rpm"