Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [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 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 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 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 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 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 25 | LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 27 | SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.16.x \ |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 28 | file://environment.d-rpm.sh \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 29 | 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | 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 Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 41 | file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 42 | file://0001-tools-Add-error.h-for-non-glibc-case.patch \ |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 43 | file://0001-build-pack.c-do-not-insert-payloadflags-into-.rpm-me.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 44 | " |
| 45 | |
| 46 | PE = "1" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 47 | SRCREV = "3659b8a04f5b8bacf6535e0124e7fe23f15286bd" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | |
| 49 | S = "${WORKDIR}/git" |
| 50 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 51 | DEPENDS = "libgcrypt file popt xz bzip2 elfutils python3" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 52 | DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 53 | |
| 54 | inherit autotools gettext pkgconfig python3native |
| 55 | export PYTHON_ABI |
| 56 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 57 | AUTOTOOLS_AUXDIR = "${S}/build-aux" |
| 58 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 59 | # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | EXTRA_AUTORECONF:append = " --exclude=gnu-configize" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 61 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 62 | EXTRA_OECONF:append = " --without-lua --enable-python --with-crypto=libgcrypt" |
| 63 | EXTRA_OECONF:append:libc-musl = " --disable-nls --disable-openmp" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 64 | |
| 65 | # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 66 | # --localstatedir prevents rpm from writing its database to native sysroot when building images |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 67 | # Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset |
| 68 | # plugins both behave badly inside builds. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | EXTRA_OECONF:append:class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" |
| 70 | EXTRA_OECONF:append:class-nativesdk = " --sysconfdir=/etc --disable-plugins" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | |
| 72 | BBCLASSEXTEND = "native nativesdk" |
| 73 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 74 | PACKAGECONFIG ??= "bdb ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}" |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 75 | # The inhibit plugin serves no purpose outside of the target |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | PACKAGECONFIG:remove:class-native = "inhibit" |
| 77 | PACKAGECONFIG:remove:class-nativesdk = "inhibit" |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 78 | |
William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 79 | PACKAGECONFIG[bdb] = "--enable-bdb,--disable-bdb,db" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 80 | PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 81 | PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" |
| 82 | PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 83 | |
| 84 | ASNEEDED = "" |
| 85 | |
| 86 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in |
| 87 | # libmagic also has sysroot path contamination, so override it |
| 88 | |
| 89 | WRAPPER_TOOLS = " \ |
| 90 | ${bindir}/rpm \ |
| 91 | ${bindir}/rpm2archive \ |
| 92 | ${bindir}/rpm2cpio \ |
| 93 | ${bindir}/rpmbuild \ |
| 94 | ${bindir}/rpmdb \ |
| 95 | ${bindir}/rpmgraph \ |
| 96 | ${bindir}/rpmkeys \ |
| 97 | ${bindir}/rpmsign \ |
| 98 | ${bindir}/rpmspec \ |
| 99 | ${libdir}/rpm/rpmdeps \ |
| 100 | " |
| 101 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 102 | do_configure:prepend() { |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 103 | mkdir -p ${S}/build-aux |
| 104 | } |
| 105 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 106 | do_install:append:class-native() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 107 | for tool in ${WRAPPER_TOOLS}; do |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 108 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 109 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ |
| 110 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ |
| 111 | MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ |
| 112 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 113 | done |
| 114 | } |
| 115 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 116 | do_install:append:class-nativesdk() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 117 | for tool in ${WRAPPER_TOOLS}; do |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame] | 118 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 119 | RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ |
| 120 | RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ |
| 121 | MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ |
| 122 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 123 | done |
| 124 | |
| 125 | rm -rf ${D}/var |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 126 | |
| 127 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 128 | install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | # Rpm's make install creates var/tmp which clashes with base-files packaging |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 132 | do_install:append:class-target() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 133 | rm -rf ${D}/var |
| 134 | } |
| 135 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 136 | do_install:append () { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 137 | sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 138 | ${D}/${libdir}/rpm/macros |
| 139 | |
| 140 | sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 141 | ${D}${libdir}/rpm/pythondistdeps.py |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 142 | } |
| 143 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 144 | FILES:${PN} += "${libdir}/rpm-plugins/*.so \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 145 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 146 | FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 147 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 148 | FILES:${PN}-dev += "${libdir}/rpm-plugins/*.la \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 149 | " |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 150 | PACKAGE_BEFORE_PN += "${PN}-build ${PN}-sign ${PN}-archive" |
| 151 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 152 | RRECOMMENDS:${PN} += "rpm-sign rpm-archive" |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 153 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 154 | FILES:${PN}-build = "\ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 155 | ${bindir}/rpmbuild \ |
| 156 | ${bindir}/gendiff \ |
| 157 | ${bindir}/rpmspec \ |
| 158 | ${libdir}/librpmbuild.so.* \ |
| 159 | ${libdir}/rpm/brp-* \ |
| 160 | ${libdir}/rpm/check-* \ |
| 161 | ${libdir}/rpm/debugedit \ |
| 162 | ${libdir}/rpm/sepdebugcrcfix \ |
| 163 | ${libdir}/rpm/find-debuginfo.sh \ |
| 164 | ${libdir}/rpm/find-lang.sh \ |
| 165 | ${libdir}/rpm/*provides* \ |
| 166 | ${libdir}/rpm/*requires* \ |
| 167 | ${libdir}/rpm/*deps* \ |
| 168 | ${libdir}/rpm/*.prov \ |
| 169 | ${libdir}/rpm/*.req \ |
| 170 | ${libdir}/rpm/config.* \ |
| 171 | ${libdir}/rpm/mkinstalldirs \ |
| 172 | ${libdir}/rpm/macros.p* \ |
| 173 | ${libdir}/rpm/fileattrs/* \ |
| 174 | " |
| 175 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 176 | FILES:${PN}-sign = "\ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 177 | ${bindir}/rpmsign \ |
| 178 | ${libdir}/librpmsign.so.* \ |
| 179 | " |
| 180 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 181 | FILES:${PN}-archive = "\ |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 182 | ${bindir}/rpm2archive \ |
| 183 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 184 | |
| 185 | PACKAGES += "python3-rpm" |
| 186 | PROVIDES += "python3-rpm" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 187 | FILES:python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 188 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 189 | RDEPENDS:${PN}-build = "bash perl python3-core" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 190 | |
| 191 | PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" |
| 192 | |
| 193 | # Do not specify a sysroot when compiling on a target. |
| 194 | rpm_package_preprocess () { |
| 195 | sed -i -e 's:--sysroot[^ ]*::g' \ |
| 196 | ${PKGD}/${libdir}/rpm/macros |
| 197 | } |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 198 | |
| 199 | SSTATE_HASHEQUIV_FILEMAP = " \ |
| 200 | populate_sysroot:*/rpm/macros:${TMPDIR} \ |
| 201 | populate_sysroot:*/rpm/macros:${COREBASE} \ |
| 202 | " |