2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 #SUMMARY = "The RPM package management system"
17 #DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
18 #package management system capable of installing, uninstalling, \
19 #verifying, querying, and updating software packages. Each software \
20 #package consists of an archive of files along with information about \
21 #the package like its version, a description, etc."
23 #SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
24 #DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
25 #development files will simplify the process of writing programs that \
26 #manipulate RPM packages and databases. These files are intended to \
27 #simplify the process of creating graphical package managers or any \
28 #other tools that need an intimate knowledge of RPM packages in order \
31 SUMMARY_python2-rpm = "Python bindings for apps which will manupulate RPM packages"
32 DESCRIPTION_python2-rpm = "The python2-rpm package contains a module that permits applications \
33 written in the Python programming language to use the interface \
34 supplied by the RPM Package Manager libraries."
36 HOMEPAGE = "http://www.rpm.org"
38 # libraries are also LGPL - how to express this?
40 LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
42 SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
43 file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
44 file://0001-Do-not-read-config-files-from-HOME.patch \
45 file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
46 file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
47 file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
48 file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
49 file://0001-Fix-build-with-musl-C-library.patch \
50 file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
51 file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
52 file://0001-Split-binary-package-building-into-a-separate-functi.patch \
53 file://0002-Run-binary-package-creation-via-thread-pools.patch \
54 file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
55 file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
56 file://0001-perl-disable-auto-reqs.patch \
57 file://0001-rpm-rpmio.c-restrict-virtual-memory-usage-if-limit-s.patch \
61 SRCREV = "753f6941dc32e94047b7cfe713ddd604a810b4db"
65 DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python"
66 DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
68 inherit autotools gettext pkgconfig pythonnative
71 # OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
72 EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
74 EXTRA_OECONF_append = " --without-lua --enable-python"
75 EXTRA_OECONF_append_libc-musl = " --disable-nls"
77 # --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
79 # --localstatedir prevents rpm from writing its database to native sysroot when building images
81 # Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
82 # Also disable plugins by default for native.
83 EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
84 EXTRA_OECONF_append_class-nativesdk = " --sysconfdir=/etc --localstatedir=/var --disable-plugins"
86 BBCLASSEXTEND = "native nativesdk"
89 PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
93 # Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
94 # libmagic also has sysroot path contamination, so override it
98 # ${bindir}/rpm2archive \
99 # ${bindir}/rpm2cpio \
100 # ${bindir}/rpmbuild \
102 # ${bindir}/rpmgraph \
103 # ${bindir}/rpmkeys \
104 # ${bindir}/rpmsign \
105 # ${bindir}/rpmspec \
106 # ${libdir}/rpm/rpmdeps \
109 #do_install_append_class-native() {
110 # for tool in ${WRAPPER_TOOLS}; do
111 # create_wrapper ${D}$tool \
112 # RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
113 # RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
114 # MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
115 # RPM_NO_CHROOT_FOR_SCRIPTS=1
119 #do_install_append_class-nativesdk() {
120 # for tool in ${WRAPPER_TOOLS}; do
121 # create_wrapper ${D}$tool \
122 # RPM_CONFIGDIR='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir'), d.getVar('bindir'))}/rpm \
123 # RPM_ETCCONFIGDIR='$'{RPM_ETCCONFIGDIR-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir'), d.getVar('bindir'))}/..} \
124 # MAGIC='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir'), d.getVar('bindir'))}/misc/magic.mgc \
125 # RPM_NO_CHROOT_FOR_SCRIPTS=1
131 # Rpm's make install creates var/tmp which clashes with base-files packaging
132 #do_install_append_class-target() {
136 do_compile_append () {
138 cp -r ../../git/python/* ./
139 python setup.py build
142 do_install_append () {
143 sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
144 ${D}/${libdir}/rpm/macros
146 sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
147 ${D}${libdir}/rpm/pythondistdeps.py \
148 ${D}${libdir}/rpm/python-macro-helper
150 # remove all contents except python2-rpm
153 rm -r ${D}/usr/include
154 rm -r ${D}/usr/lib/librpm*
155 rm -r ${D}/usr/lib/pkgconfig
157 rm -r ${D}/usr/lib/rpm
158 rm -r ${D}/usr/lib/rpm-plugins
159 # rm -r ${D}/usr/lib/.debug
163 python setup.py install \
164 --root=${D} --prefix=/usr \
165 --install-lib=${PYTHON_SITEPACKAGES_DIR}/ --install-data=${datadir}
168 #FILES_${PN} += "${libdir}/rpm-plugins/*.so \
172 #FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
175 PACKAGES = "python2-rpm rpm2-dbg"
176 PROVIDES = "python2-rpm rpm2-dbg"
177 FILES_python2-rpm = " \
178 ${PYTHON_SITEPACKAGES_DIR}/rpm/ \
179 ${PYTHON_SITEPACKAGES_DIR}/rpm-${PV}-py${PYTHON_BASEVERSION}.egg-info \
182 # rpm 5.x was packaging the rpm build tools separately
183 #RPROVIDES_${PN} += "rpm-build"
185 RDEPENDS_${PN} = "bash perl python-core"
186 RDEPENDS_python2-rpm = "rpm"
187 DEPENDS_python2-rpm = "rpm"
188 # PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
190 # Do not specify a sysroot when compiling on a target.
191 #rpm_package_preprocess () {
192 # sed -i -e 's:--sysroot[^ ]*::g' \
193 # ${PKGD}/${libdir}/rpm/macros