blob: 1a03a0fce0f084813f781103af36c71db8681609 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "The RPM package management system"
2DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
3package management system capable of installing, uninstalling, \
4verifying, querying, and updating software packages. Each software \
5package consists of an archive of files along with information about \
6the package like its version, a description, etc."
7
8SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
9DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
10development files will simplify the process of writing programs that \
11manipulate RPM packages and databases. These files are intended to \
12simplify the process of creating graphical package managers or any \
13other tools that need an intimate knowledge of RPM packages in order \
14to function."
15
16SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
17DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
18written in the Python programming language to use the interface \
19supplied by the RPM Package Manager libraries."
20
21HOMEPAGE = "http://www.rpm.org"
22
23# libraries are also LGPL - how to express this?
24LICENSE = "GPL-2.0"
25LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
26
27SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
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-Fix-build-with-musl-C-library.patch \
35 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
36 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
37 file://0001-Split-binary-package-building-into-a-separate-functi.patch \
38 file://0002-Run-binary-package-creation-via-thread-pools.patch \
39 file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
40 file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
41 file://0001-perl-disable-auto-reqs.patch \
42 file://0001-configure.ac-add-option-for-dbus.patch \
43 file://0001-Factor-out-and-unify-setting-CLOEXEC.patch \
44 file://0002-Optimize-rpmSetCloseOnExec.patch \
45 file://0003-rpmSetCloseOnExec-use-getrlimit.patch \
46 "
47
48PE = "1"
49SRCREV = "bfee1410af51c1cc9724791fb8d985260a62102b"
50
51S = "${WORKDIR}/git"
52
53DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
54DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
55
56inherit autotools gettext pkgconfig python3native
57export PYTHON_ABI
58
59# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
60EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
61
62EXTRA_OECONF_append = " --without-lua --enable-python"
63EXTRA_OECONF_append_libc-musl = " --disable-nls"
64
65# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
66#
67# --localstatedir prevents rpm from writing its database to native sysroot when building images
68#
69# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
70# Also disable plugins by default for native.
71EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
Brad Bishopd5ae7d92018-06-14 09:52:03 -070072EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
Brad Bishop316dfdd2018-06-25 12:45:53 -040073
74BBCLASSEXTEND = "native nativesdk"
75
76PACKAGECONFIG ??= ""
77PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
78
79# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
80# libmagic also has sysroot path contamination, so override it
Brad Bishop316dfdd2018-06-25 12:45:53 -040081
Brad Bishopd5ae7d92018-06-14 09:52:03 -070082WRAPPER_TOOLS = " \
83 ${bindir}/rpm \
84 ${bindir}/rpm2archive \
85 ${bindir}/rpm2cpio \
86 ${bindir}/rpmbuild \
87 ${bindir}/rpmdb \
88 ${bindir}/rpmgraph \
89 ${bindir}/rpmkeys \
90 ${bindir}/rpmsign \
91 ${bindir}/rpmspec \
92 ${libdir}/rpm/rpmdeps \
93"
94
95do_install_append_class-native() {
96 for tool in ${WRAPPER_TOOLS}; do
Brad Bishop316dfdd2018-06-25 12:45:53 -040097 create_wrapper ${D}$tool \
98 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
99 RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
100 MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
101 RPM_NO_CHROOT_FOR_SCRIPTS=1
102 done
103}
104
Brad Bishopd5ae7d92018-06-14 09:52:03 -0700105do_install_append_class-nativesdk() {
106 for tool in ${WRAPPER_TOOLS}; do
107 create_wrapper ${D}$tool \
108 RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
109 RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/..} \
110 MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/misc/magic.mgc \
111 RPM_NO_CHROOT_FOR_SCRIPTS=1
112 done
113
114 rm -rf ${D}/var
115}
116
Brad Bishop316dfdd2018-06-25 12:45:53 -0400117# Rpm's make install creates var/tmp which clashes with base-files packaging
118do_install_append_class-target() {
119 rm -rf ${D}/var
120}
121
122do_install_append () {
123 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
124 ${D}/${libdir}/rpm/macros
125
126 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
127 ${D}${libdir}/rpm/pythondistdeps.py \
128 ${D}${libdir}/rpm/python-macro-helper
129}
130
131FILES_${PN} += "${libdir}/rpm-plugins/*.so \
132 "
133
134FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
135 "
136
137PACKAGES += "python3-rpm"
138PROVIDES += "python3-rpm"
139FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
140
141# rpm 5.x was packaging the rpm build tools separately
142RPROVIDES_${PN} += "rpm-build"
143
144RDEPENDS_${PN} = "bash perl python3-core"
145
146PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
147
148# Do not specify a sysroot when compiling on a target.
149rpm_package_preprocess () {
150 sed -i -e 's:--sysroot[^ ]*::g' \
151 ${PKGD}/${libdir}/rpm/macros
152}