rpm_4.16.0.bb 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
  8. DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
  9. development files will simplify the process of writing programs that \
  10. manipulate RPM packages and databases. These files are intended to \
  11. simplify the process of creating graphical package managers or any \
  12. other tools that need an intimate knowledge of RPM packages in order \
  13. to function."
  14. SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
  15. DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
  16. written in the Python programming language to use the interface \
  17. supplied by the RPM Package Manager libraries."
  18. HOMEPAGE = "http://www.rpm.org"
  19. # libraries are also LGPL - how to express this?
  20. LICENSE = "GPL-2.0"
  21. LIC_FILES_CHKSUM = "file://COPYING;md5=c4eec0c20c6034b9407a09945b48a43f"
  22. SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.16.x \
  23. file://environment.d-rpm.sh \
  24. file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
  25. file://0001-Do-not-read-config-files-from-HOME.patch \
  26. file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
  27. file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
  28. file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
  29. file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
  30. file://0001-Fix-build-with-musl-C-library.patch \
  31. file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
  32. file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
  33. file://0001-perl-disable-auto-reqs.patch \
  34. file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
  35. file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
  36. file://0001-lib-transaction.c-fix-file-conflicts-for-MIPS64-N32.patch \
  37. file://0001-rpmdb.c-add-a-missing-include.patch \
  38. file://0001-tools-Add-error.h-for-non-glibc-case.patch \
  39. "
  40. PE = "1"
  41. SRCREV = "cd7f9303ef1070f027493cad7d00bc66935af2a0"
  42. S = "${WORKDIR}/git"
  43. DEPENDS = "libgcrypt db file popt xz bzip2 elfutils python3"
  44. DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
  45. inherit autotools gettext pkgconfig python3native
  46. export PYTHON_ABI
  47. AUTOTOOLS_AUXDIR = "${S}/build-aux"
  48. # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
  49. EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
  50. EXTRA_OECONF_append = " --without-lua --enable-python --with-crypto=libgcrypt"
  51. EXTRA_OECONF_append_libc-musl = " --disable-nls --disable-openmp"
  52. # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
  53. # --localstatedir prevents rpm from writing its database to native sysroot when building images
  54. # Forcibly disable plugins for native/nativesdk, as the inhibit and prioreset
  55. # plugins both behave badly inside builds.
  56. EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
  57. EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --disable-plugins"
  58. BBCLASSEXTEND = "native nativesdk"
  59. PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'inhibit', '', d)}"
  60. # The inhibit plugin serves no purpose outside of the target
  61. PACKAGECONFIG_remove_class-native = "inhibit"
  62. PACKAGECONFIG_remove_class-nativesdk = "inhibit"
  63. PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
  64. PACKAGECONFIG[inhibit] = "--enable-inhibit-plugin,--disable-inhibit-plugin,dbus"
  65. PACKAGECONFIG[rpm2archive] = "--with-archive,--without-archive,libarchive"
  66. ASNEEDED = ""
  67. # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
  68. # libmagic also has sysroot path contamination, so override it
  69. WRAPPER_TOOLS = " \
  70. ${bindir}/rpm \
  71. ${bindir}/rpm2archive \
  72. ${bindir}/rpm2cpio \
  73. ${bindir}/rpmbuild \
  74. ${bindir}/rpmdb \
  75. ${bindir}/rpmgraph \
  76. ${bindir}/rpmkeys \
  77. ${bindir}/rpmsign \
  78. ${bindir}/rpmspec \
  79. ${libdir}/rpm/rpmdeps \
  80. "
  81. do_configure_prepend() {
  82. mkdir -p ${S}/build-aux
  83. }
  84. do_install_append_class-native() {
  85. for tool in ${WRAPPER_TOOLS}; do
  86. test -x ${D}$tool && create_wrapper ${D}$tool \
  87. RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
  88. RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
  89. MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
  90. RPM_NO_CHROOT_FOR_SCRIPTS=1
  91. done
  92. }
  93. do_install_append_class-nativesdk() {
  94. for tool in ${WRAPPER_TOOLS}; do
  95. test -x ${D}$tool && create_wrapper ${D}$tool \
  96. RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \
  97. RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
  98. MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \
  99. RPM_NO_CHROOT_FOR_SCRIPTS=1
  100. done
  101. rm -rf ${D}/var
  102. mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
  103. install -m 644 ${WORKDIR}/environment.d-rpm.sh ${D}${SDKPATHNATIVE}/environment-setup.d/rpm.sh
  104. }
  105. # Rpm's make install creates var/tmp which clashes with base-files packaging
  106. do_install_append_class-target() {
  107. rm -rf ${D}/var
  108. }
  109. do_install_append () {
  110. sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
  111. ${D}/${libdir}/rpm/macros
  112. sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
  113. ${D}${libdir}/rpm/pythondistdeps.py
  114. }
  115. FILES_${PN} += "${libdir}/rpm-plugins/*.so \
  116. "
  117. FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/rpm.sh"
  118. FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
  119. "
  120. PACKAGES += "python3-rpm"
  121. PROVIDES += "python3-rpm"
  122. FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
  123. # rpm 5.x was packaging the rpm build tools separately
  124. RPROVIDES_${PN} += "rpm-build"
  125. RDEPENDS_${PN} = "bash perl python3-core"
  126. PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
  127. # Do not specify a sysroot when compiling on a target.
  128. rpm_package_preprocess () {
  129. sed -i -e 's:--sysroot[^ ]*::g' \
  130. ${PKGD}/${libdir}/rpm/macros
  131. }