Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "The RPM package management system" |
| 2 | DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \ |
| 3 | package management system capable of installing, uninstalling, \ |
| 4 | verifying, querying, and updating software packages. Each software \ |
| 5 | package consists of an archive of files along with information about \ |
| 6 | the package like its version, a description, etc." |
| 7 | |
| 8 | SUMMARY:${PN}-dev = "Development files for manipulating RPM packages" |
| 9 | DESCRIPTION:${PN}-dev = "This package contains the RPM C library and header files. These \ |
| 10 | development files will simplify the process of writing programs that \ |
| 11 | manipulate RPM packages and databases. These files are intended to \ |
| 12 | simplify the process of creating graphical package managers or any \ |
| 13 | other tools that need an intimate knowledge of RPM packages in order \ |
| 14 | to function." |
| 15 | |
| 16 | SUMMARY:python3-rpm = "Python bindings for apps which will manupulate RPM packages" |
| 17 | DESCRIPTION:python3-rpm = "The python3-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." |
| 20 | |
| 21 | HOMEPAGE = "http://www.rpm.org" |
| 22 | |
| 23 | # libraries are also LGPL - how to express this? |
| 24 | LICENSE = "GPL-2.0-only" |
| 25 | LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f" |
| 26 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 27 | SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.18.x;protocol=https \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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-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 Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 38 | file://0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch \ |
| 39 | file://0001-configure.ac-add-linux-gnux32-variant-to-triplet-han.patch \ |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 40 | file://0001-python-Use-Py_hash_t-instead-of-long-in-hdr_hash.patch \ |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 41 | file://fix-declaration.patch \ |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 42 | file://ea3187cfcf9cac87e5bc5e7db79b0338da9e355e.patch \ |
Patrick Williams | 705982a | 2024-01-12 09:51:57 -0600 | [diff] [blame] | 43 | file://0001-Duplicate-filename-before-passing-it-to-basename.patch \ |
| 44 | file://0001-Fix-missing-basename-include-on-macOS.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 45 | " |
| 46 | |
| 47 | PE = "1" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 48 | SRCREV = "4588bc3f994338502d2770ad24cbfcdaa6c335ec" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 49 | |
| 50 | S = "${WORKDIR}/git" |
| 51 | |
| 52 | DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3" |
| 53 | DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native" |
| 54 | |
| 55 | inherit autotools gettext pkgconfig python3native |
| 56 | export PYTHON_ABI |
| 57 | |
| 58 | AUTOTOOLS_AUXDIR = "${S}/build-aux" |
| 59 | |
| 60 | # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe |
| 61 | EXTRA_AUTORECONF:append = " --exclude=gnu-configize" |
| 62 | |
| 63 | # Vendor is detected differently on x86 and aarch64 hosts and can feed into target packages |
| 64 | EXTRA_OECONF:append = " --enable-python --with-crypto=libgcrypt --with-vendor=pc" |
| 65 | EXTRA_OECONF:append:libc-musl = " --disable-nls --disable-openmp" |
| 66 | |
| 67 | # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs |
| 68 | # --localstatedir prevents rpm from writing its database to native sysroot when building images |
| 69 | # Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset |
| 70 | # plugins both behave badly inside builds. |
| 71 | EXTRA_OECONF:append:class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" |
| 72 | EXTRA_OECONF:append:class-nativesdk = " --sysconfdir=/etc --disable-plugins" |
| 73 | |
| 74 | BBCLASSEXTEND = "native nativesdk" |
| 75 | |
| 76 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)} sqlite zstd" |
| 77 | # The inhibit plugin serves no purpose outside of the target |
| 78 | PACKAGECONFIG:remove:class-native = "inhibit" |
| 79 | PACKAGECONFIG:remove:class-nativesdk = "inhibit" |
| 80 | |
| 81 | PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" |
| 82 | PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" |
| 83 | PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" |
| 84 | PACKAGECONFIG[sqlite] = "--enable-sqlite=yes,--enable-sqlite=no,sqlite3" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 85 | PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 86 | PACKAGECONFIG[ndb] = "--enable-ndb,--disable-ndb" |
| 87 | PACKAGECONFIG[bdb-ro] = "--enable-bdb-ro,--disable-bdb-ro" |
| 88 | PACKAGECONFIG[zstd] = "--enable-zstd=yes,--enable-zstd=no,zstd" |
| 89 | |
| 90 | ASNEEDED = "" |
| 91 | |
| 92 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in |
| 93 | # libmagic also has sysroot path contamination, so override it |
| 94 | |
| 95 | WRAPPER_TOOLS = " \ |
| 96 | ${bindir}/rpm \ |
| 97 | ${bindir}/rpm2archive \ |
| 98 | ${bindir}/rpm2cpio \ |
| 99 | ${bindir}/rpmbuild \ |
| 100 | ${bindir}/rpmdb \ |
| 101 | ${bindir}/rpmgraph \ |
| 102 | ${bindir}/rpmkeys \ |
| 103 | ${bindir}/rpmsign \ |
| 104 | ${bindir}/rpmspec \ |
| 105 | ${libdir}/rpm/rpmdeps \ |
| 106 | " |
| 107 | |
| 108 | do_configure:prepend() { |
| 109 | mkdir -p ${S}/build-aux |
| 110 | } |
| 111 | |
| 112 | do_install:append:class-native() { |
| 113 | for tool in ${WRAPPER_TOOLS}; do |
| 114 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
| 115 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ |
| 116 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ |
| 117 | MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ |
| 118 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 119 | done |
| 120 | } |
| 121 | |
| 122 | do_install:append:class-nativesdk() { |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 123 | rm -rf ${D}/var |
| 124 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 125 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 126 | cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 127 | export RPM_CONFIGDIR="${libdir}/rpm" |
| 128 | export RPM_ETCCONFIGDIR="${SDKPATHNATIVE}" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 129 | export RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 130 | EOF |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | # Rpm's make install creates var/tmp which clashes with base-files packaging |
| 134 | do_install:append:class-target() { |
| 135 | rm -rf ${D}/var |
| 136 | } |
| 137 | do_install:append:class-nativesdk() { |
| 138 | rm -rf ${D}${SDKPATHNATIVE}/var |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 139 | # Ensure find-debuginfo is located correctly inside SDK |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 140 | mkdir -p ${D}${libdir}/rpm |
| 141 | echo "%__find_debuginfo ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> ${D}${libdir}/rpm/macros |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | do_install:append () { |
| 145 | sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 146 | ${D}/${libdir}/rpm/macros |
| 147 | |
| 148 | } |
| 149 | |
| 150 | FILES:${PN} += "${libdir}/rpm-plugins/*.so \ |
| 151 | " |
| 152 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" |
| 153 | |
| 154 | FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \ |
| 155 | " |
| 156 | PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive" |
| 157 | |
| 158 | RRECOMMENDS:${PN} += "rpm-sign rpm-archive" |
| 159 | |
| 160 | FILES:${PN}-build = "\ |
| 161 | ${bindir}/rpmbuild \ |
| 162 | ${bindir}/gendiff \ |
| 163 | ${bindir}/rpmspec \ |
| 164 | ${libdir}/librpmbuild.so.* \ |
| 165 | ${libdir}/rpm/brp-* \ |
| 166 | ${libdir}/rpm/check-* \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 167 | ${libdir}/rpm/sepdebugcrcfix \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 168 | ${libdir}/rpm/find-lang.sh \ |
| 169 | ${libdir}/rpm/*provides* \ |
| 170 | ${libdir}/rpm/*requires* \ |
| 171 | ${libdir}/rpm/*deps* \ |
| 172 | ${libdir}/rpm/*.prov \ |
| 173 | ${libdir}/rpm/*.req \ |
| 174 | ${libdir}/rpm/config.* \ |
| 175 | ${libdir}/rpm/mkinstalldirs \ |
| 176 | ${libdir}/rpm/macros.p* \ |
| 177 | ${libdir}/rpm/fileattrs/* \ |
| 178 | " |
| 179 | |
| 180 | FILES:${PN}-sign = "\ |
| 181 | ${bindir}/rpmsign \ |
| 182 | ${libdir}/librpmsign.so.* \ |
| 183 | " |
| 184 | |
| 185 | FILES:${PN}-archive = "\ |
| 186 | ${bindir}/rpm2archive \ |
| 187 | " |
| 188 | |
| 189 | PACKAGES += "python3-rpm" |
| 190 | PROVIDES += "python3-rpm" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 191 | FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/* ${PYTHON_SITEPACKAGES_DIR}/rpm-*.egg-info" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 192 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 193 | RDEPENDS:${PN}-build = "bash perl python3-core debugedit" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 194 | |
| 195 | PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" |
| 196 | |
| 197 | # Do not specify a sysroot when compiling on a target. |
| 198 | rpm_package_preprocess () { |
| 199 | sed -i -e 's:--sysroot[^ ]*::g' \ |
| 200 | ${PKGD}/${libdir}/rpm/macros |
| 201 | } |
| 202 | |
| 203 | SSTATE_HASHEQUIV_FILEMAP = " \ |
| 204 | populate_sysroot:*/rpm/macros:${TMPDIR} \ |
| 205 | populate_sysroot:*/rpm/macros:${COREBASE} \ |
| 206 | " |