rpm_4.14.2.1.bb 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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=c0bf017c0fd1920e6158a333acabfd4a"
  22. SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
  23. file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
  24. file://0001-Do-not-read-config-files-from-HOME.patch \
  25. file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
  26. file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
  27. file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
  28. file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
  29. file://0001-Fix-build-with-musl-C-library.patch \
  30. file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
  31. file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
  32. file://0001-Split-binary-package-building-into-a-separate-functi.patch \
  33. file://0002-Run-binary-package-creation-via-thread-pools.patch \
  34. file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
  35. file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
  36. file://0001-perl-disable-auto-reqs.patch \
  37. file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
  38. file://0016-rpmscript.c-change-logging-level-around-scriptlets-t.patch \
  39. "
  40. PE = "1"
  41. SRCREV = "4a9440006398646583f0d9ae1837dad2875013aa"
  42. S = "${WORKDIR}/git"
  43. DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
  44. DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
  45. inherit autotools gettext pkgconfig python3native
  46. export PYTHON_ABI
  47. # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
  48. EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
  49. EXTRA_OECONF_append = " --without-lua --enable-python"
  50. EXTRA_OECONF_append_libc-musl = " --disable-nls"
  51. # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
  52. #
  53. # --localstatedir prevents rpm from writing its database to native sysroot when building images
  54. #
  55. # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
  56. # Also disable plugins by default for native.
  57. EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
  58. EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
  59. BBCLASSEXTEND = "native nativesdk"
  60. PACKAGECONFIG ??= ""
  61. PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
  62. ASNEEDED = ""
  63. # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
  64. # libmagic also has sysroot path contamination, so override it
  65. WRAPPER_TOOLS = " \
  66. ${bindir}/rpm \
  67. ${bindir}/rpm2archive \
  68. ${bindir}/rpm2cpio \
  69. ${bindir}/rpmbuild \
  70. ${bindir}/rpmdb \
  71. ${bindir}/rpmgraph \
  72. ${bindir}/rpmkeys \
  73. ${bindir}/rpmsign \
  74. ${bindir}/rpmspec \
  75. ${libdir}/rpm/rpmdeps \
  76. "
  77. do_install_append_class-native() {
  78. for tool in ${WRAPPER_TOOLS}; do
  79. create_wrapper ${D}$tool \
  80. RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
  81. RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
  82. MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
  83. RPM_NO_CHROOT_FOR_SCRIPTS=1
  84. done
  85. }
  86. do_install_append_class-nativesdk() {
  87. for tool in ${WRAPPER_TOOLS}; do
  88. create_wrapper ${D}$tool \
  89. RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
  90. RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \
  91. MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \
  92. RPM_NO_CHROOT_FOR_SCRIPTS=1
  93. done
  94. rm -rf ${D}/var
  95. }
  96. # Rpm's make install creates var/tmp which clashes with base-files packaging
  97. do_install_append_class-target() {
  98. rm -rf ${D}/var
  99. }
  100. do_install_append () {
  101. sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
  102. ${D}/${libdir}/rpm/macros
  103. sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
  104. ${D}${libdir}/rpm/pythondistdeps.py \
  105. ${D}${libdir}/rpm/python-macro-helper
  106. }
  107. FILES_${PN} += "${libdir}/rpm-plugins/*.so \
  108. "
  109. FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
  110. "
  111. PACKAGES += "python3-rpm"
  112. PROVIDES += "python3-rpm"
  113. FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
  114. # rpm 5.x was packaging the rpm build tools separately
  115. RPROVIDES_${PN} += "rpm-build"
  116. RDEPENDS_${PN} = "bash perl python3-core"
  117. PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
  118. # Do not specify a sysroot when compiling on a target.
  119. rpm_package_preprocess () {
  120. sed -i -e 's:--sysroot[^ ]*::g' \
  121. ${PKGD}/${libdir}/rpm/macros
  122. }