blob: 8eb0ab207e394dfda63ce47c9aeaf3275b60a0fa [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "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-only"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
26
Andrew Geissler87f5cff2022-09-30 13:13:31 -050027SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protocol=https \
Patrick Williams92b42cb2022-09-03 06:53:57 -050028 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-Add-a-color-setting-for-mips64_n32-binaries.patch \
35 file://0001-perl-disable-auto-reqs.patch \
36 file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
37 file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050038 file://0001-docs-do-not-build-manpages-requires-pandoc.patch \
39 file://0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch \
40 file://0001-configure.ac-add-linux-gnux32-variant-to-triplet-han.patch \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050041 file://fifofix.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050042 "
43
44PE = "1"
Andrew Geissler87f5cff2022-09-30 13:13:31 -050045SRCREV = "ea0d77c52e176e2876fdb1d07ad41e9e2635a93e"
Patrick Williams92b42cb2022-09-03 06:53:57 -050046
47S = "${WORKDIR}/git"
48
49DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3"
50DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
51
52inherit autotools gettext pkgconfig python3native
53export PYTHON_ABI
54
55AUTOTOOLS_AUXDIR = "${S}/build-aux"
56
57# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
58EXTRA_AUTORECONF:append = " --exclude=gnu-configize"
59
60# Vendor is detected differently on x86 and aarch64 hosts and can feed into target packages
61EXTRA_OECONF:append = " --enable-python --with-crypto=libgcrypt --with-vendor=pc"
62EXTRA_OECONF:append:libc-musl = " --disable-nls --disable-openmp"
63
64# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
65# --localstatedir prevents rpm from writing its database to native sysroot when building images
66# Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset
67# plugins both behave badly inside builds.
68EXTRA_OECONF:append:class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
69EXTRA_OECONF:append:class-nativesdk = " --sysconfdir=/etc --disable-plugins"
70
71BBCLASSEXTEND = "native nativesdk"
72
73PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)} sqlite zstd"
74# The inhibit plugin serves no purpose outside of the target
75PACKAGECONFIG:remove:class-native = "inhibit"
76PACKAGECONFIG:remove:class-nativesdk = "inhibit"
77
78PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
79PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
80PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
81PACKAGECONFIG[sqlite] = "--enable-sqlite=yes,--enable-sqlite=no,sqlite3"
Andrew Geissler87f5cff2022-09-30 13:13:31 -050082PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
Patrick Williams92b42cb2022-09-03 06:53:57 -050083PACKAGECONFIG[ndb] = "--enable-ndb,--disable-ndb"
84PACKAGECONFIG[bdb-ro] = "--enable-bdb-ro,--disable-bdb-ro"
85PACKAGECONFIG[zstd] = "--enable-zstd=yes,--enable-zstd=no,zstd"
86
87ASNEEDED = ""
88
89# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
90# libmagic also has sysroot path contamination, so override it
91
92WRAPPER_TOOLS = " \
93 ${bindir}/rpm \
94 ${bindir}/rpm2archive \
95 ${bindir}/rpm2cpio \
96 ${bindir}/rpmbuild \
97 ${bindir}/rpmdb \
98 ${bindir}/rpmgraph \
99 ${bindir}/rpmkeys \
100 ${bindir}/rpmsign \
101 ${bindir}/rpmspec \
102 ${libdir}/rpm/rpmdeps \
103"
104
105do_configure:prepend() {
106 mkdir -p ${S}/build-aux
107}
108
109do_install:append:class-native() {
110 for tool in ${WRAPPER_TOOLS}; do
111 test -x ${D}$tool && create_wrapper ${D}$tool \
112 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
113 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
114 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
115 RPM_NO_CHROOT_FOR_SCRIPTS=1
116 done
117}
118
119do_install:append:class-nativesdk() {
Patrick Williams92b42cb2022-09-03 06:53:57 -0500120 rm -rf ${D}/var
121
Andrew Geissler517393d2023-01-13 08:55:19 -0600122 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
123 cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
124 export RPM_CONFIGDIR="$OECORE_NATIVE_SYSROOT${libdir}/rpm"
125 export RPM_ETCCONFIGDIR="$OECORE_NATIVE_SYSROOT${sysconfdir}"
126 export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
127 export RPM_NO_CHROOT_FOR_SCRIPTS=1
128 EOF
Patrick Williams92b42cb2022-09-03 06:53:57 -0500129}
130
131# Rpm's make install creates var/tmp which clashes with base-files packaging
132do_install:append:class-target() {
133 rm -rf ${D}/var
134}
135do_install:append:class-nativesdk() {
136 rm -rf ${D}${SDKPATHNATIVE}/var
137}
138
139do_install:append () {
140 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
141 ${D}/${libdir}/rpm/macros
142
143}
144
145FILES:${PN} += "${libdir}/rpm-plugins/*.so \
146 "
147FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
148
149FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \
150 "
151PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive"
152
153RRECOMMENDS:${PN} += "rpm-sign rpm-archive"
154
155FILES:${PN}-build = "\
156 ${bindir}/rpmbuild \
157 ${bindir}/gendiff \
158 ${bindir}/rpmspec \
159 ${libdir}/librpmbuild.so.* \
160 ${libdir}/rpm/brp-* \
161 ${libdir}/rpm/check-* \
162 ${libdir}/rpm/debugedit \
163 ${libdir}/rpm/sepdebugcrcfix \
164 ${libdir}/rpm/find-debuginfo.sh \
165 ${libdir}/rpm/find-lang.sh \
166 ${libdir}/rpm/*provides* \
167 ${libdir}/rpm/*requires* \
168 ${libdir}/rpm/*deps* \
169 ${libdir}/rpm/*.prov \
170 ${libdir}/rpm/*.req \
171 ${libdir}/rpm/config.* \
172 ${libdir}/rpm/mkinstalldirs \
173 ${libdir}/rpm/macros.p* \
174 ${libdir}/rpm/fileattrs/* \
175"
176
177FILES:${PN}-sign = "\
178 ${bindir}/rpmsign \
179 ${libdir}/librpmsign.so.* \
180"
181
182FILES:${PN}-archive = "\
183 ${bindir}/rpm2archive \
184"
185
186PACKAGES += "python3-rpm"
187PROVIDES += "python3-rpm"
188FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
189
190RDEPENDS:${PN}-build = "bash perl python3-core"
191
192PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
193
194# Do not specify a sysroot when compiling on a target.
195rpm_package_preprocess () {
196 sed -i -e 's:--sysroot[^ ]*::g' \
197 ${PKGD}/${libdir}/rpm/macros
198}
199
200SSTATE_HASHEQUIV_FILEMAP = " \
201 populate_sysroot:*/rpm/macros:${TMPDIR} \
202 populate_sysroot:*/rpm/macros:${COREBASE} \
203 "