From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7340524753523834880 Date: Thu, 7 Mar 2024 23:18:44 -0800 (PST) From: srinu To: isar-users Message-Id: In-Reply-To: <7ee2e99e-7e11-4c15-adf4-1ad3c40761f3@siemens.com> References: <3fbd86d5-a9ee-4d6e-9b5d-1003a54dbc47@siemens.com> <20240307144801.3685495-1-srinuvasan.a@siemens.com> <7ee2e99e-7e11-4c15-adf4-1ad3c40761f3@siemens.com> Subject: Re: [PATCH v2] meta/classes/debianize: Add copyright file to debian folder MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_24404_1546047840.1709882324785" X-TUID: LN4gdTFPdBGn ------=_Part_24404_1546047840.1709882324785 Content-Type: multipart/alternative; boundary="----=_Part_24405_1020079766.1709882324785" ------=_Part_24405_1020079766.1709882324785 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Friday, March 8, 2024 at 12:45:08=E2=80=AFPM UTC+5:30 Jan Kiszka wrote: On 07.03.24 15:48, srinuv...@siemens.com wrote:=20 > From: Srinuvasan A =20 >=20 > In downstream layer we uses copyright files for most of the packages,=20 > this is very important for our OSS clearing.=20 >=20 > User can add the copyright to the required recipe, then the generated=20 > packages from the recipes contains the debian/copyright file.=20 >=20 > Added example copyright file in example-raw recipe.=20 >=20 > Signed-off-by: Srinuvasan A =20 > ---=20 > doc/user_manual.md | 2 ++=20 > .../example-raw/example-raw_0.3.bb | 3 ++-=20 > .../example-raw/files/default-copyright.tmpl | 21 +++++++++++++++++++=20 > meta/classes/debianize.bbclass | 4 ++++=20 > 4 files changed, 29 insertions(+), 1 deletion(-)=20 > create mode 100644=20 meta-isar/recipes-app/example-raw/files/default-copyright.tmpl=20 >=20 > diff --git a/doc/user_manual.md b/doc/user_manual.md=20 > index bc730243..6b851985 100644=20 > --- a/doc/user_manual.md=20 > +++ b/doc/user_manual.md=20 > @@ -940,6 +940,8 @@ Other (optional) customization variables include:=20 > - `DEBIAN_PROVIDES` - declare a virtual package to satisfy dependencies= =20 > - `DEBIAN_REPLACES` - to replace a package with another=20 >=20 > +Added provision to generate copyright file in debian packages, this=20 would be helpful for downstream project's OSS clearing.=20 > +=20 > ### Prebuilt .deb packages from somewhere=20 >=20 > In some cases you might find yourself having a `.deb` that someone else= =20 built,=20 > diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb=20 b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb=20 > index ffa14340..b4dfaa4d 100644=20 > --- a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb=20 > +++ b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb=20 > @@ -9,7 +9,8 @@ DEBIAN_DEPENDS =3D "adduser, apt (>=3D 0.4.2)"=20 >=20 > SRC_URI =3D "file://README \=20 > file://postinst \=20 > - file://rules"=20 > + file://rules \=20 > + file://default-copyright.tmpl"=20 >=20 > inherit dpkg-raw=20 >=20 > diff --git=20 a/meta-isar/recipes-app/example-raw/files/default-copyright.tmpl=20 b/meta-isar/recipes-app/example-raw/files/default-copyright.tmpl=20 > new file mode 100644=20 > index 00000000..8bede266=20 > --- /dev/null=20 > +++ b/meta-isar/recipes-app/example-raw/files/default-copyright.tmpl=20 > @@ -0,0 +1,21 @@=20 > +MIT License=20 > +=20 > +Copyright (c) 2024 srinuvasan=20 We need to be accurate here. You do not have personal copyright on any=20 of these files, rather (according to git):=20 Copyright (c) 2017-2014, Siemens=20 Copyright (c) 2022 ilbers GmbH=20 got it, thanks=20 > +=20 > +Permission is hereby granted, free of charge, to any person obtaining a= =20 copy=20 > +of this software and associated documentation files (the "Software"), to= =20 deal=20 > +in the Software without restriction, including without limitation the=20 rights=20 > +to use, copy, modify, merge, publish, distribute, sublicense, and/or=20 sell=20 > +copies of the Software, and to permit persons to whom the Software is=20 > +furnished to do so, subject to the following conditions:=20 > +=20 > +The above copyright notice and this permission notice shall be included= =20 in all=20 > +copies or substantial portions of the Software.=20 > +=20 > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= =20 OR=20 > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,= =20 > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= =20 THE=20 > +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER= =20 > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= =20 FROM,=20 > +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS= =20 IN THE=20 > +SOFTWARE.=20 > diff --git a/meta/classes/debianize.bbclass=20 b/meta/classes/debianize.bbclass=20 > index f256333d..29898aeb 100644=20 > --- a/meta/classes/debianize.bbclass=20 > +++ b/meta/classes/debianize.bbclass=20 > @@ -120,6 +120,10 @@ deb_debianize() {=20 > else=20 > deb_create_rules=20 > fi=20 > + # Add the copyright if unpacked sources does not contain copyright file= =20 ...do not...=20 > + if [ ! -f ${S}/debian/copyright.tmpl ] && [ -f=20 ${WORKDIR}/default-copyright.tmpl ]; then=20 Why *.tmpl? This file is not processed by the templating class, is it? Yes, will update to normal file.=20 > + install -v -m 644 ${WORKDIR}/default-copyright.tmpl=20 ${S}/debian/copyright=20 > + fi=20 > # prepend a changelog-entry unless an existing changelog file already=20 > # contains an entry with CHANGELOG_V=20 > deb_add_changelog=20 Jan=20 --=20 Siemens AG, Technology=20 Linux Expert Center=20 ------=_Part_24405_1020079766.1709882324785 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On Friday, March 8, 2024 at 12:45:08=E2= =80=AFPM UTC+5:30 Jan Kiszka wrote:
On 07.03.24 15:48, srinuv...@siemens.= com wrote:
> From: Srinuvasan A <srinuv...@s= iemens.com>
>=20
> In downstream layer we uses copyright files for most of the pack= ages,
> this is very important for our OSS clearing.
>=20
> User can add the copyright to the required recipe, then the gene= rated
> packages from the recipes contains the debian/copyright file.
>=20
> Added example copyright file in example-raw recipe.
>=20
> Signed-off-by: Srinuvasan A <sr= inuv...@siemens.com>
> ---
> doc/user_manual.md | 2 ++
> .../example-raw/example-raw_0.3.bb | 3 ++-
> .../example-raw/files/default-copyright.tmpl | 21 ++++++++++++= +++++++
> meta/classes/debianize.bbclass | 4 ++++
> 4 files changed, 29 insertions(+), 1 deletion(-)
> create mode 100644 meta-isar/recipes-app/example-raw/files/defa= ult-copyright.tmpl
>=20
> diff --git a/doc/user_manual.md b/doc/user_manual.md
> index bc730243..6b851985 100644
> --- a/doc/user_manual.md
> +++ b/doc/user_manual.md
> @@ -940,6 +940,8 @@ Other (optional) customization variables inc= lude:
> - `DEBIAN_PROVIDES` - declare a virtual package to satisfy dep= endencies
> - `DEBIAN_REPLACES` - to replace a package with another
> =20
> +Added provision to generate copyright file in debian packages, = this would be helpful for downstream project's OSS clearing.
> +
> ### Prebuilt .deb packages from somewhere
> =20
> In some cases you might find yourself having a `.deb` that some= one else built,
> diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb<= /a> b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb
> index ffa14340..b4dfaa4d 100644
> --- a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb
> +++ b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb
> @@ -9,7 +9,8 @@ DEBIAN_DEPENDS =3D "adduser, apt (>=3D 0.4.2)= "
> =20
> SRC_URI =3D "file://README \
> =09 file://postinst \
> -=09 file://rules"
> +=09 file://rules \
> +=09 file://default-copyright.tmpl"
> =20
> inherit dpkg-raw
> =20
> diff --git a/meta-isar/recipes-app/example-raw/files/default-cop= yright.tmpl b/meta-isar/recipes-app/example-raw/files/default-copyright.tmp= l
> new file mode 100644
> index 00000000..8bede266
> --- /dev/null
> +++ b/meta-isar/recipes-app/example-raw/files/default-copyright.= tmpl
> @@ -0,0 +1,21 @@
> +MIT License
> +
> +Copyright (c) 2024 srinuvasan

We need to be accurate here. You do not have personal copyright on an= y
of these files, rather (according to git):

Copyright (c) 2017-2014, Siemens
Copyright (c) 2022 ilbers GmbH


=C2=A0 =C2=A0 got it, thanks=C2=A0=
> +
> +Permission is hereby granted, free of charge, to any person obt= aining a copy
> +of this software and associated documentation files (the "Softw= are"), to deal
> +in the Software without restriction, including without limitati= on the rights
> +to use, copy, modify, merge, publish, distribute, sublicense, a= nd/or sell
> +copies of the Software, and to permit persons to whom the Softw= are is
> +furnished to do so, subject to the following conditions:
> +
> +The above copyright notice and this permission notice shall be = included in all
> +copies or substantial portions of the Software.
> +
> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,= EXPRESS OR
> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHAN= TABILITY,
> +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVE= NT SHALL THE
> +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES O= R OTHER
> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,= ARISING FROM,
> +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D= EALINGS IN THE
> +SOFTWARE.
> diff --git a/meta/classes/debianize.bbclass b/meta/classes/debia= nize.bbclass
> index f256333d..29898aeb 100644
> --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -120,6 +120,10 @@ deb_debianize() {
> =09else
> =09=09deb_create_rules
> =09fi
> +=09# Add the copyright if unpacked sources does not contain cop= yright file

...do not...

> +=09if [ ! -f ${S}/debian/copyright.tmpl ] && [ -f ${WOR= KDIR}/default-copyright.tmpl ]; then

Why *.tmpl? This file is not processed by the templating class, is it= ?

=C2=A0 =C2=A0 Yes, will update to norma= l file.=C2=A0


> +=09=09install -v -m 644 ${WORKDIR}/default-copyright.tmpl ${S}/= debian/copyright
> +=09fi
> =09# prepend a changelog-entry unless an existing changelog fil= e already
> =09# contains an entry with CHANGELOG_V
> =09deb_add_changelog

Jan

--=20
Siemens AG, Technology
Linux Expert Center

------=_Part_24405_1020079766.1709882324785-- ------=_Part_24404_1546047840.1709882324785--