From patchwork Mon Mar 18 09:24:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Arjunan, Srinu" X-Patchwork-Id: 3421 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 18 Mar 2024 10:25:29 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-yb1-f189.google.com (mail-yb1-f189.google.com [209.85.219.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 42I9POY1010094 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 18 Mar 2024 10:25:25 +0100 Received: by mail-yb1-f189.google.com with SMTP id 3f1490d57ef6-dcdc3db67f0sf5697691276.1 for ; Mon, 18 Mar 2024 02:25:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710753918; cv=pass; d=google.com; s=arc-20160816; b=afnO+IkXJ6d1bfGs97eHY7acSOeKiKSruvHZ/AAiy6/2BNwwLeKCBlq7b4p+PwBxX9 tguifPlQxCr0YgoPJPiCs81oSbt1cX30ZNDECHYliLOcL4nYNIYg4YhSiu/IYs9HRVgC +S3sa/N9fdv4Q5t1afyXpoJMPBDNLQwv+nd73B93K+7S7M4gYxSNPpz1rHPlvvcHWyoq b5D6eAatMgvkfG9+kYvE9JWESA+fYuWnDRsn3uSSeiQfqbhMIQ6aQQS+bvXQz34tN/Xq s17yoLgAMcwKsUzdjepZuRVKGlSSg9VNYtL6c536JujkXexkSx4MVltY8364LLFKjVVH EKqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cJeMVaf7Ei2g8sMBuGNjwvPyAJgEa87b4+JHMW51lf4=; fh=qqs5Yn2pUlSgZl97TQfWxl7SgL6NF6txWdu3V9W6F9M=; b=qsXrCo57zRulB0SsRmc1B0mD5nhHBUvyLYhQzkHYw8B0pACyg1cJE/iVO6ENAST+CQ wAUo15VwHqoAySX+yN8iFfj5sMuGJy2Q2xEQejWjlz5bpzhwZgV+MtFn6qb/nL1vzRn7 fPDclsSUT0NaEwMwf64xrKUv/HzL2wL//9KYOnL3/Xt/9s8xG0xCBALDLIDO1fgW+olD 5LmLBf49NNVxQYGamRugnJAUt6xsWYVL9RzXjTHufiVKNU4RKznrc4Whe3ghDLYZioDZ ifubtE4vhbJ9BM7LHKhpnoAPBu8M8/yEECoy+lcjiscD+gas/Uvr2nGDmUnrgnUZqtd4 V9dg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=OvHUhmbG; spf=pass (google.com: domain of fm-1324425-20240318092515dbcb13cb69e83516bd-rlff1u@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-20240318092515dbcb13cb69e83516bd-RlFf1u@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1710753918; x=1711358718; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=cJeMVaf7Ei2g8sMBuGNjwvPyAJgEa87b4+JHMW51lf4=; b=WLV0LdyW2naouNLdsC3Mkxw4RXbru/hN/LkrRVDQhcc5H02iRy/m+5dUDwd0TGYYEq 4tVrNX3fVZ6gL61+XlRhEgh37sM+MlMfbJxqwTMSSefLvYgsQigIKnhBd+QtAl67s1d/ 9rv0FCm2yz828RVbT7ZbsLkv+32fKu23gMdiDJZ0aTQByUxUqLX6e744wd7JEA0dX9kt sjoXHLSL73QmRFvupzCMUn/GYU8KtXSOX/4p0oWf34E36vfRjdCCoQPbC/J1Ro5bTZiu 6Zmg0AHPGBDhQKFxCPL4PjaIhfDs0NuMptzve79gSflbyjV1ezkEYBq0uFnODA2fl2FK EG/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710753918; x=1711358718; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cJeMVaf7Ei2g8sMBuGNjwvPyAJgEa87b4+JHMW51lf4=; b=oOAdE+V/rzcaughssJEpLpyrGu+t1FpLg76RQiiiqb3OeB+6aRCzbCimIh81kykBo0 fmVxcYmqHm7rn2SI2c9vtJl0ez2Px1g56nCgJUrSBqhh2ovdr65XHiyJSRO7u+v5Anmr p58oKCIqQenWTv76MgtLTgRPLjK0XcBH5TSfanlxLTuJVyTUzdNycUjXE4Hc+FK9DWM1 KSrMjyW1eGXC982K+kkpCcEg9xtpbQsB+pdU0799gpUCMQ/W2m8WtWbi3GsJmcmTiGo4 mVdcz2b98yzjE7ry/P1VIkLEtFaOUBlWU0q5c1Z1oM4lrgeQFvSBfZRJfe45rNraYX3E B+pA== X-Forwarded-Encrypted: i=2; AJvYcCVN3zI970j6XejH1Pye8TGLnUFZ6q5rVk3Z0F2XEQbhHJ1jTWAqLmVl3n7IlU3YcTOaotEV0ooSNXu/dhy53Mou80krtIk= X-Gm-Message-State: AOJu0YzlsbCAtpgEAOFe6Kh3hh8WcyTPELzP/qfyV8V7zG6nXLbEMENd 51+LXLCpS9/oh9DSHT4PKUT4Z1eUnP88wiiTB34q61Da4x87JHa1 X-Google-Smtp-Source: AGHT+IEJG9iDc6Cv2Y7TM5NJR0ZMfwVfOhxXlivDjQIVDa3/4mBW1NwGL+xoVWIkdeKaVLw6iLRlmQ== X-Received: by 2002:a25:c54b:0:b0:dd1:1d7b:efcc with SMTP id v72-20020a25c54b000000b00dd11d7befccmr11606342ybe.6.1710753918561; Mon, 18 Mar 2024 02:25:18 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a25:aa8a:0:b0:dcc:37ed:efb1 with SMTP id t10-20020a25aa8a000000b00dcc37edefb1ls125424ybi.2.-pod-prod-00-us; Mon, 18 Mar 2024 02:25:17 -0700 (PDT) X-Received: by 2002:a81:8503:0:b0:610:c60b:499e with SMTP id v3-20020a818503000000b00610c60b499emr1231351ywf.11.1710753917472; Mon, 18 Mar 2024 02:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710753917; cv=none; d=google.com; s=arc-20160816; b=UZSp8uN+2S/G1/dFQUzeFfMrb27learq6HKZGL0ygVtDZD7vz6IClxhytr4EdWDIQs 2nGjC5Q9WsvXVtO/QnT/Syd7jnExkUEV6IJdRojRJIG4xfFFS2Q3EaLqUjwZWFysBvwx 7W79aHkCP3UmPUgq3O0nDNQCMorE3lKS60wjUhxrTXI+oyGoi3LbuTMNalIbVxjxLY2O D8wezv5YWz1ARjDZfF/1+bw5gfp2nQBUfEB9gODLF4GuwdaH5rVGsXlfzZhqqPG092Fk c1GijDm1XB+mgdGzPbKTkJqohKTF37NXxZZP34sx5HTDqFMkTf2R/6u1kPoKUg6ndj5q WmeA== 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=siRxUFrFLBY+ZMxD2eEPOgNiwl1UJUMA18DAad6wKEE=; fh=WVMeai9loJiEap2ByklCyhZmqtNmEGYqHW7Xl46Np9U=; b=KR2Jl/LaXqUoGoddAx2tud1bEmaxgI4Qr97EuHJHm8fKn6ffwNvL49SwAs6BOg+FAA MOW3fbeYjQvbkuYaIn05D2ibIs64dtGv+9+hvkS2RT7heasC6tJl3h5tVWaCdQjK27AS 4+jRDXevZTqvneg8CG0iBMoCeYCEn3J/en/OzKO2zGCmMv9QLghJWEURXkei/3DCp/O6 gk9I5olzYgbvLRWjI9IUnvJtfkT+PgtMveZa2zErMxdbefz62XSz4w9WEBk5jFDdvqhK LaUR9Qimr5i/4qGxsjuMTrA8oqFu/eLJ1lvPyN3ULOhsDvTtIEIOnl2tcmeNNa7Fr87y eYUg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=OvHUhmbG; spf=pass (google.com: domain of fm-1324425-20240318092515dbcb13cb69e83516bd-rlff1u@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-20240318092515dbcb13cb69e83516bd-RlFf1u@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id r126-20020a819a84000000b0060a6050a1c1si982799ywg.4.2024.03.18.02.25.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2024 02:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1324425-20240318092515dbcb13cb69e83516bd-rlff1u@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20240318092515dbcb13cb69e83516bd for ; Mon, 18 Mar 2024 10:25:15 +0100 X-Patchwork-Original-From: "srinuvasan.a via isar-users" From: "Arjunan, Srinu" To: isar-users@googlegroups.com Cc: cedric.hombourger@siemens.com, jan.kiszka@siemens.com, Srinuvasan A Subject: [RFC] meta/classes/debianize: get the copyright file based on LICENSE variable Date: Mon, 18 Mar 2024 14:54:53 +0530 Message-Id: <20240318092453.918778-1-srinuvasan.a@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1324425:519-21489:flowmailer X-Original-Sender: srinuvasan.a@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=OvHUhmbG; spf=pass (google.com: domain of fm-1324425-20240318092515dbcb13cb69e83516bd-rlff1u@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-1324425-20240318092515dbcb13cb69e83516bd-RlFf1u@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: srinuvasan.a@siemens.com Reply-To: srinuvasan.a@siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Srinuvasan A Now we introduced a few more OSS licenses template files, user can simply set the license f.e LICENSE = "MIT" in the recipe. Based on the license configuartion in the recipe, the respective copyright file installed in the debian package. Added example for example-raw recipe. Signed-off-by: Srinuvasan A --- .../example-raw/example-raw_0.3.bb | 1 + meta/classes/debianize.bbclass | 26 +++++++++++++++++-- .../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 +++++++++++++++++++ 6 files changed, 120 insertions(+), 2 deletions(-) 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..166f4a94 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,6 +6,7 @@ DESCRIPTION = "Sample application for ISAR" MAINTAINER = "Your name here " DEBIAN_DEPENDS = "adduser, apt (>= 0.4.2)" +LICENSE = "MIT" SRC_URI = "file://README \ file://postinst \ diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index 0febcbe2..9a4357c1 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -15,6 +15,7 @@ DEBIAN_MULTI_ARCH ??= "no" DEBIAN_COMPAT ??= "10" DESCRIPTION ??= "must not be empty" MAINTAINER ??= "Unknown maintainer " +LICENSE ??= "" deb_add_changelog() { changelog_v="${CHANGELOG_V}" @@ -121,8 +122,9 @@ deb_debianize() { 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 + # 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 @@ -140,3 +142,23 @@ deb_debianize() { done done } + +inherit template + +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.