public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: srinuvasan.a@siemens.com
To: isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com, ubely@ilbers.de,
	Srinuvasan A <srinuvasan.a@siemens.com>
Subject: [PATCH v3] meta/classes/debianize: Add copyright file to debian folder
Date: Fri,  8 Mar 2024 19:56:33 +0530	[thread overview]
Message-ID: <20240308142633.3850490-1-srinuvasan.a@siemens.com> (raw)
In-Reply-To: <7ee2e99e-7e11-4c15-adf4-1ad3c40761f3@siemens.com>

From: Srinuvasan A <srinuvasan.a@siemens.com>

In downstream layer we uses copyright files for most of the packages,
this is very important for our OSS clearing.

User can add the copyright to the required recipe, then the generated
packages from the recipes contains the debian/copyright file.

Added example copyright file in example-raw recipe.

Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
 doc/user_manual.md                            |  2 ++
 .../example-raw/example-raw_0.3.bb            |  3 ++-
 .../example-raw/files/default-copyright       | 22 +++++++++++++++++++
 meta/classes/debianize.bbclass                |  4 ++++
 4 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 meta-isar/recipes-app/example-raw/files/default-copyright

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 include:
  - `DEBIAN_PROVIDES` - declare a virtual package to satisfy dependencies
  - `DEBIAN_REPLACES` - to replace a package with another
 
+Added provision to generate copyright file in debian packages, this would be helpful for downstream project's OSS clearing.
+
 ### Prebuilt .deb packages from somewhere
 
 In some cases you might find yourself having a `.deb` that someone else built,
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 ffa14340..35f4b3d9 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 = "adduser, apt (>= 0.4.2)"
 
 SRC_URI = "file://README \
 	   file://postinst \
-	   file://rules"
+	   file://rules \
+	   file://default-copyright"
 
 inherit dpkg-raw
 
diff --git a/meta-isar/recipes-app/example-raw/files/default-copyright b/meta-isar/recipes-app/example-raw/files/default-copyright
new file mode 100644
index 00000000..3511cb51
--- /dev/null
+++ b/meta-isar/recipes-app/example-raw/files/default-copyright
@@ -0,0 +1,22 @@
+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 f256333d..0febcbe2 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -120,6 +120,10 @@ 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
+	fi
 	# prepend a changelog-entry unless an existing changelog file already
 	# contains an entry with CHANGELOG_V
 	deb_add_changelog
-- 
2.34.1


  parent reply	other threads:[~2024-03-08 14:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28  7:22 [PATCH] " srinuvasan.a
2024-02-29  1:10 ` Jan Kiszka
2024-02-29  5:02   ` srinu
2024-03-01  7:36     ` Jan Kiszka
2024-03-07 14:48       ` [PATCH v2] " srinuvasan.a
2024-03-08  7:15         ` Jan Kiszka
2024-03-08  7:18           ` srinu
2024-03-08 14:26           ` srinuvasan.a [this message]
2024-03-08 14:37             ` [PATCH v3] " Jan Kiszka
2024-03-11  6:22               ` [PATCH v4 1/2] " srinuvasan.a
2024-03-11  6:22                 ` [PATCH v4 2/2] doc/user_manual: add a section for debianize class srinuvasan.a
2024-03-12 16:10                   ` srinu
2024-03-12 16:36                   ` Jan Kiszka
2024-03-13  5:57                     ` [PATCH v5 " srinuvasan.a
2024-03-13  8:38                       ` Florian Bezdeka
2024-03-13  9:44                         ` [PATCH v6 " srinuvasan.a
2024-03-15 12:56                           ` Uladzimir Bely
2024-03-12 16:34                 ` [PATCH v4 1/2] meta/classes/debianize: Add copyright file to debian folder Jan Kiszka
2024-03-15 12:55                 ` Uladzimir Bely
2024-02-29 19:14 ` [PATCH] " Florian Bezdeka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308142633.3850490-1-srinuvasan.a@siemens.com \
    --to=srinuvasan.a@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=ubely@ilbers.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox