summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-01-22 15:41:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-26 13:07:20 +0000
commit42e0de37d18f072dc5dcf5dc45cb441e4c2110d8 (patch)
tree8747b480ba1501aca693d8622260836cd03bf517 /meta/classes
parent7703c74ea08ceddc7641f3cbdf1df5d0993ebf0f (diff)
downloadopenembedded-core-42e0de37d18f072dc5dcf5dc45cb441e4c2110d8.tar.gz
package_rpm: correctly handle LICENSE_${PN}
RPM spec files don't distinguish between spec-level license and the primary package license, so always output the License for every package (defaulting to the recipe-wide license) and use LICENSE_${PN} if set for the primary package. As the primary use of package_rpm is to generate built packages, this fixes the license fields in the generated packages. [ YOCTO #12057 ] (From OE-Core rev: 8c333e592fa7a3a887c792ac14e5cde2141b5d35) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package_rpm.bbclass9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index b08608c846..bcaf8a30a5 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -382,6 +382,12 @@ python write_specfile () {
# Gather special src/first package data
if srcname == splitname:
+ archiving = d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and \
+ bb.data.inherits_class('archiver', d)
+ if archiving and srclicense != splitlicense:
+ bb.warn("The SRPM produced may not have the correct overall source license in the License tag. This is due to the LICENSE for the primary package and SRPM conflicting.")
+
+ srclicense = splitlicense
srcrdepends = splitrdepends
srcrrecommends = splitrrecommends
srcrsuggests = splitrsuggests
@@ -421,8 +427,7 @@ python write_specfile () {
spec_preamble_bottom.append('Release: %s' % splitrelease)
if srcepoch != splitepoch:
spec_preamble_bottom.append('Epoch: %s' % splitepoch)
- if srclicense != splitlicense:
- spec_preamble_bottom.append('License: %s' % splitlicense)
+ spec_preamble_bottom.append('License: %s' % splitlicense)
spec_preamble_bottom.append('Group: %s' % splitsection)
if srccustomtagschunk != splitcustomtagschunk: