blob: c9258632d212e7ebd0911f238ea18807a3445c5c [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
10development files will simplify the process of writing programs that \
11manipulate RPM packages and databases. These files are intended to \
12simplify the process of creating graphical package managers or any \
13other tools that need an intimate knowledge of RPM packages in order \
14to function."
15
16SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
18written in the Python programming language to use the interface \
19supplied by the RPM Package Manager libraries."
20
21HOMEPAGE = "http://www.rpm.org"
22
23# libraries are also LGPL - how to express this?
24LICENSE = "GPL-2.0"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
26
Andrew Geissler4b740dc2020-05-05 08:54:39 -050027SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.x \
Andrew Geissler635e0e42020-08-21 15:58:33 -050028 file://environment.d-rpm.sh \
Brad Bishop19323692019-04-05 15:28:33 -040029 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
30 file://0001-Do-not-read-config-files-from-HOME.patch \
31 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
32 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
33 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
34 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
35 file://0001-Fix-build-with-musl-C-library.patch \
36 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
37 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
Brad Bishop19323692019-04-05 15:28:33 -040038 file://0001-perl-disable-auto-reqs.patch \
39 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
40 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \
Andrew Geissler4b740dc2020-05-05 08:54:39 -050042 file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \
Andrew Geisslerc182c622020-05-15 14:13:32 -050043 file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050044 file://0001-Bump-up-the-limit-of-signature-header-to-64MB.patch \
Brad Bishop19323692019-04-05 15:28:33 -040045 "
46
47PE = "1"
Andrew Geissler4b740dc2020-05-05 08:54:39 -050048SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3"
Brad Bishop19323692019-04-05 15:28:33 -040049
50S = "${WORKDIR}/git"
51
Andrew Geissler82c905d2020-04-13 13:39:40 -050052DEPENDS = "openssl libarchive db file popt xz bzip2 dbus elfutils python3"
Brad Bishop19323692019-04-05 15:28:33 -040053DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
54
55inherit autotools gettext pkgconfig python3native
56export PYTHON_ABI
57
58# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
59EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
60
Andrew Geissler82c905d2020-04-13 13:39:40 -050061EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl"
Andrew Geissler4b740dc2020-05-05 08:54:39 -050062EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp"
Brad Bishop19323692019-04-05 15:28:33 -040063
64# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
65#
66# --localstatedir prevents rpm from writing its database to native sysroot when building images
67#
68# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
69# Also disable plugins by default for native.
70EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
Andrew Geisslerb7d28612020-07-24 16:15:54 -050071EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins"
Brad Bishop19323692019-04-05 15:28:33 -040072
73BBCLASSEXTEND = "native nativesdk"
74
75PACKAGECONFIG ??= ""
76PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
77
78ASNEEDED = ""
79
80# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
81# libmagic also has sysroot path contamination, so override it
82
83WRAPPER_TOOLS = " \
84 ${bindir}/rpm \
85 ${bindir}/rpm2archive \
86 ${bindir}/rpm2cpio \
87 ${bindir}/rpmbuild \
88 ${bindir}/rpmdb \
89 ${bindir}/rpmgraph \
90 ${bindir}/rpmkeys \
91 ${bindir}/rpmsign \
92 ${bindir}/rpmspec \
93 ${libdir}/rpm/rpmdeps \
94"
95
96do_install_append_class-native() {
97 for tool in ${WRAPPER_TOOLS}; do
98 create_wrapper ${D}$tool \
99 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
100 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
101 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
102 RPM_NO_CHROOT_FOR_SCRIPTS=1
103 done
104}
105
106do_install_append_class-nativesdk() {
107 for tool in ${WRAPPER_TOOLS}; do
108 create_wrapper ${D}$tool \
109 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \
110 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
111 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \
112 RPM_NO_CHROOT_FOR_SCRIPTS=1
113 done
114
115 rm -rf ${D}/var
Andrew Geissler635e0e42020-08-21 15:58:33 -0500116
117 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
118 install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
Brad Bishop19323692019-04-05 15:28:33 -0400119}
120
121# Rpm's make install creates var/tmp which clashes with base-files packaging
122do_install_append_class-target() {
123 rm -rf ${D}/var
124}
125
126do_install_append () {
127 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
128 ${D}/${libdir}/rpm/macros
129
130 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
Andrew Geissler4b740dc2020-05-05 08:54:39 -0500131 ${D}${libdir}/rpm/pythondistdeps.py
Brad Bishop19323692019-04-05 15:28:33 -0400132}
133
134FILES_${PN} += "${libdir}/rpm-plugins/*.so \
135 "
Andrew Geissler635e0e42020-08-21 15:58:33 -0500136FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
Brad Bishop19323692019-04-05 15:28:33 -0400137
138FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
139 "
140
141PACKAGES += "python3-rpm"
142PROVIDES += "python3-rpm"
143FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
144
145# rpm 5.x was packaging the rpm build tools separately
146RPROVIDES_${PN} += "rpm-build"
147
148RDEPENDS_${PN} = "bash perl python3-core"
149
150PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
151
152# Do not specify a sysroot when compiling on a target.
153rpm_package_preprocess () {
154 sed -i -e 's:--sysroot[^ ]*::g' \
155 ${PKGD}/${libdir}/rpm/macros
156}