<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12057</bug_id>
          
          <creation_ts>2017-09-06 10:39:33 +0000</creation_ts>
          <short_desc>Package license wrong in RPM for ${PN} when ${LICENSE_${PN}} != ${LICENSE}</short_desc>
          <delta_ts>2018-02-05 14:16:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>Backport 2.4.2</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.5 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter Kjellerstedt">peter.kjellerstedt</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>76570</commentid>
    <comment_count>0</comment_count>
    <who name="Peter Kjellerstedt">peter.kjellerstedt</who>
    <bug_when>2017-09-06 10:39:33 +0000</bug_when>
    <thetext>For a recipe with LICENSE containing multiple licenses and then individual packages having their own LICENSE_ settings, the license information in the RPM for ${PN} is ${LICENSE}, not ${LICENSE_${PN}} as it should be. It works correctly for all other packages.

To reproduce:

1) Create &quot;recipes-support/licensetest/licensetest_1.0.bb&quot;:

LICENSE = &quot;GPL-3.0 &amp; LGPL-2.1&quot;
LIC_FILES_CHKSUM = &quot;file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891 \
                    file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780&quot;

inherit allarch

do_install() {
    mkdir -p ${D}${bindir} ${D}${libdir}
    touch ${D}${bindir}/licensetest
    touch ${D}${libdir}/licensetest.so.1.0.0
}


PACKAGE_BEFORE_PN += &quot;${PN}-libs&quot;

LICENSE_${PN} = &quot;GPL-3.0&quot;
LICENSE_${PN}-dbg = &quot;GPL-3.0&quot;
LICENSE_${PN}-dev = &quot;GPL-3.0&quot;
LICENSE_${PN}-libs = &quot;LGPL-2.1&quot;

FILES_${PN}-libs = &quot;${libdir}&quot;

2) Make sure package_rpm is included in PACKAGE_CLASSES, e.g. by adding 

PACKAGE_CLASSES += &quot;package_rpm&quot;

to &quot;conf/local.conf&quot;.

3) Build licensetest: 

bitbake licensetest

4) Extract license information from the built packages:

rpm -qilp tmp/deploy/rpm/*/licensetest*|grep &apos;Name\|License&apos;

This gives:

Name        : licensetest
License     : GPL-3.0 &amp; LGPL-2.1
Name        : licensetest-dbg
License     : GPL-3.0
Name        : licensetest-dev
License     : GPL-3.0
Name        : licensetest-libs
License     : LGPL-2.1

and as can be seen, the licenses are correct for licensetest-dbg, licensetest-dev and licensetest-libs, but wrong for licensetest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79183</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-01-22 14:26:04 +0000</bug_when>
    <thetext>$ dpkg -I licensetest_1.0-r0_all.ipk|grep License
 License: GPL-3.0

$ rpm -qilp licensetest-1.0-r0.noarch.rpm |grep License
License     : GPL-3.0 &amp; LGPL-2.1

So it&apos;s a package_rpm thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79184</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-01-22 15:44:41 +0000</bug_when>
    <thetext>$ rpm -qilp *|grep &apos;Name\|License&apos;
Name        : licensetest
License     : GPL-3.0
Name        : licensetest-dbg
License     : GPL-3.0
Name        : licensetest-dev
License     : GPL-3.0
Name        : licensetest-libs
License     : LGPL-2.1

Patch (package_rpm: correctly handle LICENSE_${PN}) is on the list now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79341</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-02-05 14:16:34 +0000</bug_when>
    <thetext>Fixed in oe-core 42e0de37d18f072dc5dcf5dc45cb441e4c2110d8.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>