From 81d90fc81c093ecdd99a00382b2c85a3a4c429f2 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 2 Feb 2024 19:57:34 +0100 Subject: package_rpm: add RPMBUILD_EXTRA_PARAMS variable * e.g. for DISTROs which define extra user-defined fields with PACKAGE_ADD_METADATA/PACKAGE_ADD_METADATA_RPM as undefined fields in packagedata are fatal error for rpmbuild: "error: line 9: Unknown tag: Author: Unspecified" as shown in: http://errors.yoctoproject.org/Errors/Details/751706/ with "Author" field added with: PACKAGE_CLASSES = "package_rpm" PACKAGE_ADD_AUTHOR_METADATA = "test-author" PACKAGE_ADD_METADATA = "Author: ${PACKAGE_ADD_AUTHOR_METADATA}" to fix rpm build you can use: RPMBUILD_EXTRA_PARAMS = " --define '_Author Author'" keep in mind that this doesn't cause this Author field to be added in .rpm, it just avoids the BUILDSPEC failure. and for ipk build: OPKG_MAKE_INDEX_EXTRA_PARAMS = "-f" alternatively you can avoid additional packagedata fields ending in the package manager (if you use them only with buildhistory or packagedata) with: PACKAGE_ADD_METADATA_RPM = "" PACKAGE_ADD_METADATA_IPK = "" PACKAGE_ADD_METADATA_DEP = "" (From OE-Core rev: 31030e7a19a27ad424b997fad36ee4f633ce0d63) Signed-off-by: Martin Jansa Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/classes-global/package_rpm.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta/classes-global') diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 3743be8c82..2e3e4e8c79 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass @@ -681,6 +681,7 @@ python do_package_rpm () { # Setup the rpmbuild arguments... rpmbuild = d.getVar('RPMBUILD') rpmbuild_compmode = d.getVar('RPMBUILD_COMPMODE') + rpmbuild_extra_params = d.getVar('RPMBUILD_EXTRA_PARAMS') or "" # Too many places in dnf stack assume that arch-independent packages are "noarch". # Let's not fight against this. @@ -722,6 +723,7 @@ python do_package_rpm () { cmd = cmd + " --define '_use_weak_usergroup_deps 1'" cmd = cmd + " --define '_passwd_path " + "/completely/bogus/path" + "'" cmd = cmd + " --define '_group_path " + "/completely/bogus/path" + "'" + cmd = cmd + rpmbuild_extra_params if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d): cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'" cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_RPMOUTDIR') + "'" -- cgit v1.2.3-54-g00ecf