diff options
author | Ross Burton <ross.burton@intel.com> | 2018-01-22 15:41:09 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-26 13:09:09 +0000 |
commit | c6459ca4943312b7b00bf97160f29776d2a6a183 (patch) | |
tree | 8e448c6d3235c1a494e4ee64749b3479531516c0 /meta/classes/package_rpm.bbclass | |
parent | 683d44656ea926b49433b0b055ca5dcad965b755 (diff) | |
download | poky-c6459ca4943312b7b00bf97160f29776d2a6a183.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)
(From OE-Core rev: 42e0de37d18f072dc5dcf5dc45cb441e4c2110d8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 9 |
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 () { | |||
382 | 382 | ||
383 | # Gather special src/first package data | 383 | # Gather special src/first package data |
384 | if srcname == splitname: | 384 | if srcname == splitname: |
385 | archiving = d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and \ | ||
386 | bb.data.inherits_class('archiver', d) | ||
387 | if archiving and srclicense != splitlicense: | ||
388 | 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.") | ||
389 | |||
390 | srclicense = splitlicense | ||
385 | srcrdepends = splitrdepends | 391 | srcrdepends = splitrdepends |
386 | srcrrecommends = splitrrecommends | 392 | srcrrecommends = splitrrecommends |
387 | srcrsuggests = splitrsuggests | 393 | srcrsuggests = splitrsuggests |
@@ -421,8 +427,7 @@ python write_specfile () { | |||
421 | spec_preamble_bottom.append('Release: %s' % splitrelease) | 427 | spec_preamble_bottom.append('Release: %s' % splitrelease) |
422 | if srcepoch != splitepoch: | 428 | if srcepoch != splitepoch: |
423 | spec_preamble_bottom.append('Epoch: %s' % splitepoch) | 429 | spec_preamble_bottom.append('Epoch: %s' % splitepoch) |
424 | if srclicense != splitlicense: | 430 | spec_preamble_bottom.append('License: %s' % splitlicense) |
425 | spec_preamble_bottom.append('License: %s' % splitlicense) | ||
426 | spec_preamble_bottom.append('Group: %s' % splitsection) | 431 | spec_preamble_bottom.append('Group: %s' % splitsection) |
427 | 432 | ||
428 | if srccustomtagschunk != splitcustomtagschunk: | 433 | if srccustomtagschunk != splitcustomtagschunk: |