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 | |
| 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" |
| 25 | LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a" |
| 26 | |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 27 | SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.15.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 | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | file://0001-rpmplugins.c-call-dlerror-prior-to-dlsym.patch \ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 42 | file://0001-rpmfc.c-do-not-run-file-classification-in-parallel.patch \ |
Andrew Geissler | c182c62 | 2020-05-15 14:13:32 -0500 | [diff] [blame] | 43 | file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 44 | file://0001-Bump-up-the-limit-of-signature-header-to-64MB.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | " |
| 46 | |
| 47 | PE = "1" |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 48 | SRCREV = "ab2179452c5be276a6b96c591afded485c7e58c3" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | |
| 50 | S = "${WORKDIR}/git" |
| 51 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame^] | 52 | DEPENDS = "openssl db file popt xz bzip2 elfutils python3" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 53 | DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native" |
| 54 | |
| 55 | inherit autotools gettext pkgconfig python3native |
| 56 | export PYTHON_ABI |
| 57 | |
| 58 | # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe |
| 59 | EXTRA_AUTORECONF_append = " --exclude=gnu-configize" |
| 60 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 61 | EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=openssl" |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 62 | EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 63 | |
| 64 | # --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] | 65 | # --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^] | 66 | # Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset |
| 67 | # plugins both behave badly inside builds. |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 68 | EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins" |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame] | 69 | EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 70 | |
| 71 | BBCLASSEXTEND = "native nativesdk" |
| 72 | |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame^] | 73 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}" |
| 74 | # The inhibit plugin serves no purpose outside of the target |
| 75 | PACKAGECONFIG_remove_class-native = "inhibit" |
| 76 | PACKAGECONFIG_remove_class-nativesdk = "inhibit" |
| 77 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 78 | PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils" |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame^] | 79 | PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus" |
| 80 | PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 81 | |
| 82 | ASNEEDED = "" |
| 83 | |
| 84 | # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in |
| 85 | # libmagic also has sysroot path contamination, so override it |
| 86 | |
| 87 | WRAPPER_TOOLS = " \ |
| 88 | ${bindir}/rpm \ |
| 89 | ${bindir}/rpm2archive \ |
| 90 | ${bindir}/rpm2cpio \ |
| 91 | ${bindir}/rpmbuild \ |
| 92 | ${bindir}/rpmdb \ |
| 93 | ${bindir}/rpmgraph \ |
| 94 | ${bindir}/rpmkeys \ |
| 95 | ${bindir}/rpmsign \ |
| 96 | ${bindir}/rpmspec \ |
| 97 | ${libdir}/rpm/rpmdeps \ |
| 98 | " |
| 99 | |
| 100 | do_install_append_class-native() { |
| 101 | for tool in ${WRAPPER_TOOLS}; do |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame^] | 102 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 103 | RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \ |
| 104 | RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \ |
| 105 | MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \ |
| 106 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 107 | done |
| 108 | } |
| 109 | |
| 110 | do_install_append_class-nativesdk() { |
| 111 | for tool in ${WRAPPER_TOOLS}; do |
Andrew Geissler | c3d88e4 | 2020-10-02 09:45:00 -0500 | [diff] [blame^] | 112 | test -x ${D}$tool && create_wrapper ${D}$tool \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 113 | RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \ |
| 114 | RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \ |
| 115 | MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \ |
| 116 | RPM_NO_CHROOT_FOR_SCRIPTS=1 |
| 117 | done |
| 118 | |
| 119 | rm -rf ${D}/var |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 120 | |
| 121 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 122 | 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] | 123 | } |
| 124 | |
| 125 | # Rpm's make install creates var/tmp which clashes with base-files packaging |
| 126 | do_install_append_class-target() { |
| 127 | rm -rf ${D}/var |
| 128 | } |
| 129 | |
| 130 | do_install_append () { |
| 131 | sed -i -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 132 | ${D}/${libdir}/rpm/macros |
| 133 | |
| 134 | sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 135 | ${D}${libdir}/rpm/pythondistdeps.py |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | FILES_${PN} += "${libdir}/rpm-plugins/*.so \ |
| 139 | " |
Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 140 | FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 141 | |
| 142 | FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \ |
| 143 | " |
| 144 | |
| 145 | PACKAGES += "python3-rpm" |
| 146 | PROVIDES += "python3-rpm" |
| 147 | FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*" |
| 148 | |
| 149 | # rpm 5.x was packaging the rpm build tools separately |
| 150 | RPROVIDES_${PN} += "rpm-build" |
| 151 | |
| 152 | RDEPENDS_${PN} = "bash perl python3-core" |
| 153 | |
| 154 | PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess" |
| 155 | |
| 156 | # Do not specify a sysroot when compiling on a target. |
| 157 | rpm_package_preprocess () { |
| 158 | sed -i -e 's:--sysroot[^ ]*::g' \ |
| 159 | ${PKGD}/${libdir}/rpm/macros |
| 160 | } |