From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0251C48291 for ; Fri, 2 Feb 2024 16:44:59 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by mx.groups.io with SMTP id smtpd.web10.27580.1706892299121710652 for ; Fri, 02 Feb 2024 08:44:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hvOWzCvZ; spf=pass (domain: bootlin.com, ip: 217.70.183.196, mailfrom: alexandre.belloni@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id 69968E000B; Fri, 2 Feb 2024 16:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706892296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eRJbbbkWf1x18em/Xwh/lsPo1elc7sd8q27fU1vxrN4=; b=hvOWzCvZza7s/YxSZDT8sj3Wn1Ga6Lth9WCRG6g71+T1T+ogIo8mDmZMQB+jvf/uBgu322 bL2V1sWGQOgrnHLkbhTl5i0uSUc48lvw4BL8JgNHDXAqNmiBcvCOgpBqC3Z0l/89I1ozH8 bTrnIJq3lGYeX0/jxDxYXHXE9meBPTupoOryQUUrZrf+kClef/Z9nSlAV5jYQFluTEjASU 0lwJWID4bFL3ZQYftlrNogHtEyo3KimOpGKcpi1myuZigg3qW0z91xS+czDqtm4Fte0OMD Gj1v5Sna2rIyBSr0Qeg33iQaWffCYw4H323xK1L11DtivgNIYFiAzvMY7wcUkg== Date: Fri, 2 Feb 2024 17:44:56 +0100 From: Alexandre Belloni To: Martin Jansa Cc: openembedded-core@lists.openembedded.org Subject: Re: [OE-core] [PATCH 2/2] package_rpm: add RPMBUILD_EXTRA_PARAMS variable Message-ID: <202402021644566354a6af@mail.local> References: <20240202132434.1787053-1-martin.jansa@gmail.com> <20240202132434.1787053-2-martin.jansa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240202132434.1787053-2-martin.jansa@gmail.com> X-GND-Sasl: alexandre.belloni@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 02 Feb 2024 16:44:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/194811 On 02/02/2024 14:24:34+0100, Martin Jansa wrote: > * 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 = "" > > Signed-off-by: Martin Jansa > --- > meta/classes-global/package_rpm.bbclass | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass > index 819ee50278..f932d2c928 100644 > --- a/meta/classes-global/package_rpm.bbclass > +++ b/meta/classes-global/package_rpm.bbclass > @@ -683,6 +683,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') > > # Too many places in dnf stack assume that arch-independent packages are "noarch". > # Let's not fight against this. > @@ -724,6 +725,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 File: 'exec_func_python() autogenerated', lineno: 2, function: 0001: *** 0002:do_package_rpm(d) 0003: File: '/home/pokybuild/yocto-worker/meta-aws/build/meta/classes-global/package_rpm.bbclass', lineno: 728, function: do_package_rpm 0724: cmd = cmd + " --define '_tmppath " + workdir + "'" 0725: cmd = cmd + " --define '_use_weak_usergroup_deps 1'" 0726: cmd = cmd + " --define '_passwd_path " + "/completely/bogus/path" + "'" 0727: cmd = cmd + " --define '_group_path " + "/completely/bogus/path" + "'" *** 0728: cmd = cmd + rpmbuild_extra_params 0729: if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d): 0730: cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'" 0731: cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_RPMOUTDIR') + "'" 0732: cmdsrpm = cmdsrpm + " -bs " + outspecfile Exception: TypeError: can only concatenate str (not "NoneType") to str > 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') + "'" > -- > 2.43.0 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#194796): https://lists.openembedded.org/g/openembedded-core/message/194796 > Mute This Topic: https://lists.openembedded.org/mt/104118974/3617179 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com] > -=-=-=-=-=-=-=-=-=-=-=- > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com