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 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 27 | SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.19.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 \ |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 39 | file://0001-CMakeLists.txt-look-for-lua-with-pkg-config-rather-t.patch \ |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 40 | file://0002-rpmio-rpmglob.c-avoid-using-GLOB_BRACE-if-undefined-.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 41 | " |
| 42 | |
| 43 | PE = "1" |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 44 | SRCREV = "13b4521341781293c41ac898aa9c2d2f6bc1f21d" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 45 | |
| 46 | S = "${WORKDIR}/git" |
| 47 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 48 | DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 49 | DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native" |
| 50 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 51 | EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl" |
| 52 | EXTRA_OECMAKE:append:libc-musl = " -DENABLE_NLS=OFF -DENABLE_OPENMP=OFF" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 53 | |
| 54 | # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs |
| 55 | # --localstatedir prevents rpm from writing its database to native sysroot when building images |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 56 | EXTRA_OECMAKE:append:class-native = " -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=/var" |
Patrick Williams | 3965356 | 2024-03-01 08:54:02 -0600 | [diff] [blame] | 57 | EXTRA_OECMAKE:append:class-nativesdk = " -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_INSTALL_FULL_SYSCONFDIR=/etc" |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 58 | |
| 59 | inherit cmake gettext pkgconfig python3targetconfig |
| 60 | OECMAKE_GENERATOR = "Unix Makefiles" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 61 | |
| 62 | BBCLASSEXTEND = "native nativesdk" |
| 63 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 64 | PACKAGECONFIG ??= "internal-openpgp" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 65 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 66 | PACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF" |
| 67 | PACKAGECONFIG[testsuite] = "-DENABLE_TESTSUITE=ON,-DENABLE_TESTSUITE=OFF" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 68 | |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 69 | # Deprecated! https://fedoraproject.org/wiki/Changes/RpmSequoia |
| 70 | PACKAGECONFIG[internal-openpgp] = "-DWITH_INTERNAL_OPENPGP=ON,-DWITH_INTERNAL_OPENPGP=OFF" |
| 71 | |
| 72 | PACKAGECONFIG[cap] = "-DWITH_CAP=ON,-DWITH_CAP=OFF" |
| 73 | PACKAGECONFIG[acl] = "-DWITH_ACL=ON,-DWITH_ACL=OFF" |
| 74 | PACKAGECONFIG[archive] = "-DWITH_ARCHIVE=ON,-DWITH_ARCHIVE=OFF,libarchive" |
| 75 | PACKAGECONFIG[selinux] = "-DWITH_SELINUX=ON,-DWITH_SELINUX=OFF,libselinux" |
| 76 | PACKAGECONFIG[dbus] = "-DWITH_DBUS=ON,-DWITH_DBUS=OFF" |
| 77 | PACKAGECONFIG[audit] = "-DWITH_AUDIT=ON,-DWITH_AUDIT=OFF,audit" |
| 78 | PACKAGECONFIG[fsverity] = "-DWITH_FSVERITY=ON,-DWITH_FSVERITY=OFF" |
| 79 | PACKAGECONFIG[imaevm] = "-DWITH_IMAEVM=ON,-DWITH_IMAEVM=OFF,ima-evm-utils" |
| 80 | PACKAGECONFIG[fapolicyd] = "-DWITH_FAPOLICYD=ON,-DWITH_FAPOLICYD=OFF" |
| 81 | PACKAGECONFIG[readline] = "-DWITH_READLINE=ON,-DWITH_READLINE=OFF,readline" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 82 | |
| 83 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in |
| 84 | # libmagic also has sysroot path contamination, so override it |
| 85 | |
| 86 | WRAPPER_TOOLS = " \ |
| 87 | ${bindir}/rpm \ |
| 88 | ${bindir}/rpm2archive \ |
| 89 | ${bindir}/rpm2cpio \ |
| 90 | ${bindir}/rpmbuild \ |
| 91 | ${bindir}/rpmdb \ |
| 92 | ${bindir}/rpmgraph \ |
| 93 | ${bindir}/rpmkeys \ |
| 94 | ${bindir}/rpmsign \ |
| 95 | ${bindir}/rpmspec \ |
| 96 | ${libdir}/rpm/rpmdeps \ |
| 97 | " |
| 98 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 99 | do_install:append:class-native() { |
| 100 | for tool in ${WRAPPER_TOOLS}; do |
| 101 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
| 102 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ |
| 103 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ |
| 104 | MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ |
| 105 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 106 | done |
| 107 | } |
| 108 | |
| 109 | do_install:append:class-nativesdk() { |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 110 | rm -rf ${D}/var |
| 111 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 112 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 113 | cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 114 | export RPM_CONFIGDIR="${libdir}/rpm" |
| 115 | export RPM_ETCCONFIGDIR="${SDKPATHNATIVE}" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 116 | export RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 117 | EOF |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | # Rpm's make install creates var/tmp which clashes with base-files packaging |
| 121 | do_install:append:class-target() { |
| 122 | rm -rf ${D}/var |
| 123 | } |
| 124 | do_install:append:class-nativesdk() { |
| 125 | rm -rf ${D}${SDKPATHNATIVE}/var |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 126 | # Ensure find-debuginfo is located correctly inside SDK |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 127 | mkdir -p ${D}${libdir}/rpm |
| 128 | echo "%__find_debuginfo ${SDKPATHNATIVE}/usr/bin/find-debuginfo" >> ${D}${libdir}/rpm/macros |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | do_install:append () { |
| 132 | sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 133 | -e 's:${STAGING_DIR_NATIVE}/::g' \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 134 | ${D}/${libdir}/rpm/macros |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 135 | sed -i -e 's:${RECIPE_SYSROOT}/::g' \ |
| 136 | ${D}/${libdir}/cmake/rpm/rpm-targets.cmake |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 137 | |
| 138 | } |
| 139 | |
| 140 | FILES:${PN} += "${libdir}/rpm-plugins/*.so \ |
| 141 | " |
| 142 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" |
| 143 | |
| 144 | FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \ |
| 145 | " |
| 146 | PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive" |
| 147 | |
| 148 | RRECOMMENDS:${PN} += "rpm-sign rpm-archive" |
| 149 | |
| 150 | FILES:${PN}-build = "\ |
| 151 | ${bindir}/rpmbuild \ |
| 152 | ${bindir}/gendiff \ |
| 153 | ${bindir}/rpmspec \ |
| 154 | ${libdir}/librpmbuild.so.* \ |
| 155 | ${libdir}/rpm/brp-* \ |
| 156 | ${libdir}/rpm/check-* \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 157 | ${libdir}/rpm/sepdebugcrcfix \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 158 | ${libdir}/rpm/find-lang.sh \ |
Patrick Williams | 73bd93f | 2024-02-20 08:07:48 -0600 | [diff] [blame] | 159 | ${libdir}/rpm/sysusers.sh \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 160 | ${libdir}/rpm/*provides* \ |
| 161 | ${libdir}/rpm/*requires* \ |
| 162 | ${libdir}/rpm/*deps* \ |
| 163 | ${libdir}/rpm/*.prov \ |
| 164 | ${libdir}/rpm/*.req \ |
| 165 | ${libdir}/rpm/config.* \ |
| 166 | ${libdir}/rpm/mkinstalldirs \ |
| 167 | ${libdir}/rpm/macros.p* \ |
| 168 | ${libdir}/rpm/fileattrs/* \ |
| 169 | " |
| 170 | |
| 171 | FILES:${PN}-sign = "\ |
| 172 | ${bindir}/rpmsign \ |
| 173 | ${libdir}/librpmsign.so.* \ |
| 174 | " |
| 175 | |
| 176 | FILES:${PN}-archive = "\ |
| 177 | ${bindir}/rpm2archive \ |
| 178 | " |
| 179 | |
| 180 | PACKAGES += "python3-rpm" |
| 181 | PROVIDES += "python3-rpm" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 182 | 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] | 183 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 184 | RDEPENDS:${PN}-build = "bash perl python3-core debugedit" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 185 | |
| 186 | PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" |
| 187 | |
| 188 | # Do not specify a sysroot when compiling on a target. |
| 189 | rpm_package_preprocess () { |
| 190 | sed -i -e 's:--sysroot[^ ]*::g' \ |
| 191 | ${PKGD}/${libdir}/rpm/macros |
| 192 | } |
| 193 | |
| 194 | SSTATE_HASHEQUIV_FILEMAP = " \ |
| 195 | populate_sysroot:*/rpm/macros:${TMPDIR} \ |
| 196 | populate_sysroot:*/rpm/macros:${COREBASE} \ |
| 197 | " |