blob: 189da924366d929356245a3b2d8ed2ad6f14bc88 [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
Patrick Williams213cb262021-08-07 19:21:33 -05008SUMMARY:${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION:${PN}-dev = "This package contains the RPM C library and header files. These \
Brad Bishop19323692019-04-05 15:28:33 -040010development 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
Patrick Williams213cb262021-08-07 19:21:33 -050016SUMMARY:python3-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION:python3-rpm = "The python3-rpm package contains a module that permits applications \
Brad Bishop19323692019-04-05 15:28:33 -040018written 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"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060025LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
Brad Bishop19323692019-04-05 15:28:33 -040026
Andrew Geissler6ce62a22020-11-30 19:58:47 -060027SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.16.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 Geisslerc182c622020-05-15 14:13:32 -050041 file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060042 file://0001-tools-Add-error.h-for-non-glibc-case.patch \
Brad Bishop19323692019-04-05 15:28:33 -040043 "
44
45PE = "1"
Andrew Geisslerc926e172021-05-07 16:11:35 -050046SRCREV = "3659b8a04f5b8bacf6535e0124e7fe23f15286bd"
Brad Bishop19323692019-04-05 15:28:33 -040047
48S = "${WORKDIR}/git"
49
William A. Kennington IIIac69b482021-06-02 12:28:27 -070050DEPENDS = "libgcrypt file popt xz bzip2 elfutils python3"
Patrick Williams213cb262021-08-07 19:21:33 -050051DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
Brad Bishop19323692019-04-05 15:28:33 -040052
53inherit autotools gettext pkgconfig python3native
54export PYTHON_ABI
55
Andrew Geissler6ce62a22020-11-30 19:58:47 -060056AUTOTOOLS_AUXDIR = "${S}/build-aux"
57
Brad Bishop19323692019-04-05 15:28:33 -040058# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
Patrick Williams213cb262021-08-07 19:21:33 -050059EXTRA_AUTORECONF:append = " --exclude=gnu-configize"
Brad Bishop19323692019-04-05 15:28:33 -040060
Patrick Williams213cb262021-08-07 19:21:33 -050061EXTRA_OECONF:append = " --without-lua --enable-python --with-crypto=libgcrypt"
62EXTRA_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
Brad Bishop19323692019-04-05 15:28:33 -040065# --localstatedir prevents rpm from writing its database to native sysroot when building images
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050066# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset
67# plugins both behave badly inside builds.
Patrick Williams213cb262021-08-07 19:21:33 -050068EXTRA_OECONF:append:class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
69EXTRA_OECONF:append:class-nativesdk = " --sysconfdir=/etc --disable-plugins"
Brad Bishop19323692019-04-05 15:28:33 -040070
71BBCLASSEXTEND = "native nativesdk"
72
William A. Kennington IIIac69b482021-06-02 12:28:27 -070073PACKAGECONFIG ??= "bdb ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050074# The inhibit plugin serves no purpose outside of the target
Patrick Williams213cb262021-08-07 19:21:33 -050075PACKAGECONFIG:remove:class-native = "inhibit"
76PACKAGECONFIG:remove:class-nativesdk = "inhibit"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050077
William A. Kennington IIIac69b482021-06-02 12:28:27 -070078PACKAGECONFIG[bdb] = "--enable-bdb,--disable-bdb,db"
Brad Bishop19323692019-04-05 15:28:33 -040079PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -050080PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
81PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
Brad Bishop19323692019-04-05 15:28:33 -040082
83ASNEEDED = ""
84
85# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
86# libmagic also has sysroot path contamination, so override it
87
88WRAPPER_TOOLS = " \
89 ${bindir}/rpm \
90 ${bindir}/rpm2archive \
91 ${bindir}/rpm2cpio \
92 ${bindir}/rpmbuild \
93 ${bindir}/rpmdb \
94 ${bindir}/rpmgraph \
95 ${bindir}/rpmkeys \
96 ${bindir}/rpmsign \
97 ${bindir}/rpmspec \
98 ${libdir}/rpm/rpmdeps \
99"
100
Patrick Williams213cb262021-08-07 19:21:33 -0500101do_configure:prepend() {
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600102 mkdir -p ${S}/build-aux
103}
104
Patrick Williams213cb262021-08-07 19:21:33 -0500105do_install:append:class-native() {
Brad Bishop19323692019-04-05 15:28:33 -0400106 for tool in ${WRAPPER_TOOLS}; do
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500107 test -x ${D}$tool && create_wrapper ${D}$tool \
Brad Bishop19323692019-04-05 15:28:33 -0400108 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
109 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
110 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
111 RPM_NO_CHROOT_FOR_SCRIPTS=1
112 done
113}
114
Patrick Williams213cb262021-08-07 19:21:33 -0500115do_install:append:class-nativesdk() {
Brad Bishop19323692019-04-05 15:28:33 -0400116 for tool in ${WRAPPER_TOOLS}; do
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500117 test -x ${D}$tool && create_wrapper ${D}$tool \
Brad Bishop19323692019-04-05 15:28:33 -0400118 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \
119 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
120 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \
121 RPM_NO_CHROOT_FOR_SCRIPTS=1
122 done
123
124 rm -rf ${D}/var
Andrew Geissler635e0e42020-08-21 15:58:33 -0500125
126 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
127 install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
Brad Bishop19323692019-04-05 15:28:33 -0400128}
129
130# Rpm's make install creates var/tmp which clashes with base-files packaging
Patrick Williams213cb262021-08-07 19:21:33 -0500131do_install:append:class-target() {
Brad Bishop19323692019-04-05 15:28:33 -0400132 rm -rf ${D}/var
133}
134
Patrick Williams213cb262021-08-07 19:21:33 -0500135do_install:append () {
Brad Bishop19323692019-04-05 15:28:33 -0400136 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
137 ${D}/${libdir}/rpm/macros
138
139 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
Andrew Geissler4b740dc2020-05-05 08:54:39 -0500140 ${D}${libdir}/rpm/pythondistdeps.py
Brad Bishop19323692019-04-05 15:28:33 -0400141}
142
Patrick Williams213cb262021-08-07 19:21:33 -0500143FILES:${PN} += "${libdir}/rpm-plugins/*.so \
Brad Bishop19323692019-04-05 15:28:33 -0400144 "
Patrick Williams213cb262021-08-07 19:21:33 -0500145FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
Brad Bishop19323692019-04-05 15:28:33 -0400146
Patrick Williams213cb262021-08-07 19:21:33 -0500147FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \
Brad Bishop19323692019-04-05 15:28:33 -0400148 "
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500149PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive"
150
Patrick Williams213cb262021-08-07 19:21:33 -0500151RRECOMMENDS:${PN} += "rpm-sign rpm-archive"
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500152
Patrick Williams213cb262021-08-07 19:21:33 -0500153FILES:${PN}-build = "\
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500154 ${bindir}/rpmbuild \
155 ${bindir}/gendiff \
156 ${bindir}/rpmspec \
157 ${libdir}/librpmbuild.so.* \
158 ${libdir}/rpm/brp-* \
159 ${libdir}/rpm/check-* \
160 ${libdir}/rpm/debugedit \
161 ${libdir}/rpm/sepdebugcrcfix \
162 ${libdir}/rpm/find-debuginfo.sh \
163 ${libdir}/rpm/find-lang.sh \
164 ${libdir}/rpm/*provides* \
165 ${libdir}/rpm/*requires* \
166 ${libdir}/rpm/*deps* \
167 ${libdir}/rpm/*.prov \
168 ${libdir}/rpm/*.req \
169 ${libdir}/rpm/config.* \
170 ${libdir}/rpm/mkinstalldirs \
171 ${libdir}/rpm/macros.p* \
172 ${libdir}/rpm/fileattrs/* \
173"
174
Patrick Williams213cb262021-08-07 19:21:33 -0500175FILES:${PN}-sign = "\
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500176 ${bindir}/rpmsign \
177 ${libdir}/librpmsign.so.* \
178"
179
Patrick Williams213cb262021-08-07 19:21:33 -0500180FILES:${PN}-archive = "\
Andrew Geissler95ac1b82021-03-31 14:34:31 -0500181 ${bindir}/rpm2archive \
182"
Brad Bishop19323692019-04-05 15:28:33 -0400183
184PACKAGES += "python3-rpm"
185PROVIDES += "python3-rpm"
Patrick Williams213cb262021-08-07 19:21:33 -0500186FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
Brad Bishop19323692019-04-05 15:28:33 -0400187
Patrick Williams213cb262021-08-07 19:21:33 -0500188RDEPENDS:${PN}-build = "bash perl python3-core"
Brad Bishop19323692019-04-05 15:28:33 -0400189
190PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
191
192# Do not specify a sysroot when compiling on a target.
193rpm_package_preprocess () {
194 sed -i -e 's:--sysroot[^ ]*::g' \
195 ${PKGD}/${libdir}/rpm/macros
196}