From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7366159435478073344 X-Received: by 2002:a2e:610a:0:b0:2e3:1991:ec1b with SMTP id v10-20020a2e610a000000b002e31991ec1bmr3839188ljb.4.1715067642573; Tue, 07 May 2024 00:40:42 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:4fc7:b0:418:fa47:e914 with SMTP id 5b1f17b1804b1-41dc64b477fls22781665e9.0.-pod-prod-09-eu; Tue, 07 May 2024 00:40:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVBvDvmr1SWden//7t00zMeqrEe2CsSqYvdS81eOUUodiNxhsvba1Tfmgl57VoYeg6v4IF X-Received: by 2002:a05:600c:4e47:b0:41c:73d:62fe with SMTP id e7-20020a05600c4e4700b0041c073d62femr7376028wmq.41.1715067640533; Tue, 07 May 2024 00:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715067640; cv=none; d=google.com; s=arc-20160816; b=ubRoDG9AGkf5WXCDQuIceoZ99cuyQFhE6dZTTUY8+IMe7b9kox56PkgAGDDU80wpBm 3mclfsT73lp8bCZNOa0ZqpJplOHBodnP3OHFyQufThZM2vYckkGX2EeekteuHHsbUr02 0rrzfbSCwZDzwOr8MUQmSzja4uUf4RUm7mlCslBtNhGcc028MS5Ozz597d7tlnzTqsNw rnORJYAAqtpOh2UU51jxUenNgZticm1+tHCXNhRdYXwmukZXa3Vs8MZMQIhnvBwWqHGs el5gGcKRl8gbfWeUKdK38TK0S7ilJ9JosJFSETjF5qx7mJRwXn1/4MLHL9A0JQOngOVg mn5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=gDHi2YCK55FrYWtVcBZIDDvy0fiW2ieIjS2cBQqr3Ys=; fh=WVMeai9loJiEap2ByklCyhZmqtNmEGYqHW7Xl46Np9U=; b=mjwdka3pcICmP8nbapV1OtMLGyRPEkmA31M3EmY7i1aaah1Adc6WYJN8dtoWmMhAQG NRSNNctZXVSgT/TaInHTR/bQo4i3c+0e2LoXc40+y3sWrsjbrY5dHAxdqwLUg3EnqAgQ pyz9W48PbOsZqTSPwOB3/RyWQPjWX6+p1RPKYsV1TMLbraH4Ta0UxbL+tZUevdoFusj8 DlDKQrOSbWOmL5cU6PaCKDpHyU3uwVRTtjEbiD044TA15O4ochnK4SAsqnvCG6lIj6uX cxjAOFcJNfKuLZ70JO8jTHRX9hsKdKKzWav2CG99UQhSoNvwXGNMx02NPOr/Ke9iYhEa xirw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=qXXGLzUD; spf=pass (google.com: domain of fm-1324425-2024050707403931894a13735b1f7456-1canzj@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-1324425-2024050707403931894a13735b1f7456-1cAnzj@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net. [185.136.65.228]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-41f4d07597csi160675e9.1.2024.05.07.00.40.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2024 00:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-2024050707403931894a13735b1f7456-1canzj@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) client-ip=185.136.65.228; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=qXXGLzUD; spf=pass (google.com: domain of fm-1324425-2024050707403931894a13735b1f7456-1canzj@rts-flowmailer.siemens.com designates 185.136.65.228 as permitted sender) smtp.mailfrom=fm-1324425-2024050707403931894a13735b1f7456-1cAnzj@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 2024050707403931894a13735b1f7456 for ; Tue, 07 May 2024 09:40:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=srinuvasan.a@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=gDHi2YCK55FrYWtVcBZIDDvy0fiW2ieIjS2cBQqr3Ys=; b=qXXGLzUDV/z8mwF2FUE2Q4xaLAJHp01jd7JUCZuWL17qesMqE29lyQEZzbKlo1XG+7TVp9 ZWhh5uA9X47Q3bDPhP3jT8UhG6u3MZMq/e7uYZQDBcAXpsJ4LnMaNvkH0QM3iWyxVGs9dcdP +HwmAviMhVLtfpR78v/m/QaX0OHpU=; From: srinuvasan.a@siemens.com To: isar-users@googlegroups.com Cc: cedric.hombourger@siemens.com, jan.kiszka@siemens.com, Srinuvasan A Subject: [PATCH] meta/classes/debianize: install appropriate copyright file Date: Tue, 7 May 2024 13:11:02 +0530 Message-Id: <20240507074102.1147439-1-srinuvasan.a@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1324425:519-21489:flowmailer X-TUID: myYOdj66FH5P From: Srinuvasan A Presently we have an example to install the copyright file in the debian package, now we improved little bit to install the appropriate copyright file based on the configured variable "LICENSE" in the recipe. Added the example for example-raw recipe. Signed-off-by: Srinuvasan A --- .../example-raw/example-raw_0.3.bb | 7 +++-- .../example-raw/files/default-copyright | 22 --------------- meta/classes/debianize.bbclass | 6 ++--- meta/classes/dpkg-helper-license.bbclass | 27 +++++++++++++++++++ .../debian/GPL-2.0+/default-copyright.tmpl | 24 +++++++++++++++++ .../debian/GPL-2.0/default-copyright.tmpl | 23 ++++++++++++++++ .../debian/GPL-3.0/default-copyright.tmpl | 22 +++++++++++++++ .../debian/MIT/default-copyright.tmpl | 26 ++++++++++++++++++ 8 files changed, 130 insertions(+), 27 deletions(-) delete mode 100644 meta-isar/recipes-app/example-raw/files/default-copyright create mode 100644 meta/classes/dpkg-helper-license.bbclass create mode 100644 meta/licenses/debian/GPL-2.0+/default-copyright.tmpl create mode 100644 meta/licenses/debian/GPL-2.0/default-copyright.tmpl create mode 100644 meta/licenses/debian/GPL-3.0/default-copyright.tmpl create mode 100644 meta/licenses/debian/MIT/default-copyright.tmpl diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.3.bb b/meta-isar/recipes-app/example-raw/example-raw_0.3.bb index 35f4b3d9..1730431e 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 @@ -6,13 +6,16 @@ DESCRIPTION = "Sample application for ISAR" MAINTAINER = "Your name here " DEBIAN_DEPENDS = "adduser, apt (>= 0.4.2)" +HOMEPAGE = "" + +LICENSE = "MIT" SRC_URI = "file://README \ file://postinst \ - file://rules \ - file://default-copyright" + file://rules" inherit dpkg-raw +inherit dpkg-helper-license do_install() { bbnote "Creating ${PN} binary" diff --git a/meta-isar/recipes-app/example-raw/files/default-copyright b/meta-isar/recipes-app/example-raw/files/default-copyright deleted file mode 100644 index 3511cb51..00000000 --- a/meta-isar/recipes-app/example-raw/files/default-copyright +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2017-2024, Siemens -Copyright (c) 2024 ilbers GmbH - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software 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 MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 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 DEALINGS IN THE -SOFTWARE. diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index adb6cf2b..54a16260 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -120,9 +120,9 @@ deb_debianize() { else deb_create_rules fi - # Add the copyright if unpacked sources does not contain copyright file - if [ ! -f ${S}/debian/copyright ] && [ -f ${WORKDIR}/default-copyright ]; then - install -v -m 644 ${WORKDIR}/default-copyright ${S}/debian/copyright + # Add the copyright if unpacked sources does not contain copyright file as well as the recipes configured the LICENSE + if [ ! -f ${S}/debian/copyright ] && [ -f ${WORKDIR}/${LICENSE}/default-copyright ]; then + install -v -m 644 ${WORKDIR}/${LICENSE}/default-copyright ${S}/debian/copyright fi # prepend a changelog-entry unless an existing changelog file already # contains an entry with CHANGELOG_V diff --git a/meta/classes/dpkg-helper-license.bbclass b/meta/classes/dpkg-helper-license.bbclass new file mode 100644 index 00000000..81e6d4e6 --- /dev/null +++ b/meta/classes/dpkg-helper-license.bbclass @@ -0,0 +1,27 @@ +# This software is a part of ISAR. +# Copyright (C) 2024 Siemens AG +# +# SPDX-License-Identifier: MIT + +LICENSE ??= "" + +inherit template + +# Path to copyright template files +FILESPATH:prepend := "${LAYERDIR_core}/licenses/debian:" + +# GPL-2.0 licensed packages +SRC_URI:append = " ${@ 'file://GPL-2.0/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-2.0' else '' }" +TEMPLATE_FILES:append = "${@ ' GPL-2.0/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-2.0' else '' }" + +# GPL-2.0+ licensed packages +SRC_URI:append = " ${@ 'file://GPL-2.0+/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-2.0+' else '' }" +TEMPLATE_FILES:append = "${@ ' GPL-2.0+/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-2.0+' else '' }" + +# GPL-3.0 licensed packages +SRC_URI:append = " ${@ 'file://GPL-3.0/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-3.0' else '' }" +TEMPLATE_FILES:append = "${@ ' GPL-3.0/default-copyright.tmpl' if d.getVar('LICENSE') == 'GPL-3.0' else '' }" + +# MIT licensed packages +SRC_URI:append = " ${@ 'file://MIT/default-copyright.tmpl' if d.getVar('LICENSE') == 'MIT' else '' }" +TEMPLATE_FILES:append = "${@ ' MIT/default-copyright.tmpl' if d.getVar('LICENSE') == 'MIT' else '' }" diff --git a/meta/licenses/debian/GPL-2.0+/default-copyright.tmpl b/meta/licenses/debian/GPL-2.0+/default-copyright.tmpl new file mode 100644 index 00000000..5c6d27c5 --- /dev/null +++ b/meta/licenses/debian/GPL-2.0+/default-copyright.tmpl @@ -0,0 +1,24 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${BPN} +Source: ${HOMEPAGE} + +Files: * +Copyright: ${MAINTAINER} +License: GPL-2.0+ + +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/meta/licenses/debian/GPL-2.0/default-copyright.tmpl b/meta/licenses/debian/GPL-2.0/default-copyright.tmpl new file mode 100644 index 00000000..223e5841 --- /dev/null +++ b/meta/licenses/debian/GPL-2.0/default-copyright.tmpl @@ -0,0 +1,23 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${BPN} +Source: ${HOMEPAGE} + +Files: * +Copyright: ${MAINTAINER} +License: GPL-2.0 + +License: GPL-2.0 + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/meta/licenses/debian/GPL-3.0/default-copyright.tmpl b/meta/licenses/debian/GPL-3.0/default-copyright.tmpl new file mode 100644 index 00000000..c2511481 --- /dev/null +++ b/meta/licenses/debian/GPL-3.0/default-copyright.tmpl @@ -0,0 +1,22 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${BPN} +Source: ${HOMEPAGE} + +Files: * +Copyright: ${MAINTAINER} +License: GPL-3.0 + +License: GPL-3.0 + This program is free software: you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation, version 3 of the License. + . + This program is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along with + this program. If not, see . + . + On Debian systems, the complete text of the GNU General Public License version + 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/meta/licenses/debian/MIT/default-copyright.tmpl b/meta/licenses/debian/MIT/default-copyright.tmpl new file mode 100644 index 00000000..2bced7f5 --- /dev/null +++ b/meta/licenses/debian/MIT/default-copyright.tmpl @@ -0,0 +1,26 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ${BPN} +Source: ${HOMEPAGE} + +Files: * +Copyright: ${MAINTAINER} +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software 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 MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 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 DEALINGS IN THE + SOFTWARE. -- 2.34.1