bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* put appropriate license notices in source files
@ 2021-06-04 20:03 Bruno Haible
  2021-06-04 20:25 ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Haible @ 2021-06-04 20:03 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 3550 bytes --]

This series of patches puts into the source files (in lib/ and build-aux/)
the license notices that match the module descriptions.

What to do with tiny files that, so far, have no copyright notice?
The Maintainers' Guide [1] allows to omit the copyright notice for "trivial"
files.
I find it reasonable to add a copyright and license notice to such tiny files
in Gnulib nevertheless, because:
  * It is debatable at which point a file starts to be "nontrivial".
  * The first line of a file should state its purpose. E.g. xstrtoull.c.
    Once it is done, the file is less trivial already.
  * Contributors to the file should know under which license they are
    contributing.
  * Packages which borrow files (as opposed to modules) from gnulib should
    not be surprised when a file with no license notice suddenly gets a
    license notice that they did not expect.
  * There are many tools for copyright and license checking [2] and we make
    their job easier by avoiding unclear situations regarding what is
    "nontrivial".
So, I added copyright and license notices to these files.

[1] https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
[2] https://wiki.debian.org/CopyrightReviewTools


2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put GPLv3+ notices in source files where appropriate.
	* lib/*.{h,c}: Use GPLv3+ notice whenever the module description says
	so.
	* build-aux/pmccabe.css: Likewise.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put LGPLv3+ notices in source files where appropriate.
	* lib/*.{h,c}: Use LGPLv3+ notice whenever the module description says
	so.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put "LGPLv3+ or GPLv2+" notices in source files where appropriate.
	* lib/**.{h,c,gperf}: Use "LGPLv3+ or GPLv2+" notice whenever the module
	description says so.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Generate correct license notices in libunistring files.
	* lib/gen-uni-tables.c (output_library_license, output_tests_license):
	New functions.
	(output_predicate, output_category, output_combclass,
	output_bidi_category, output_decimal_digit, output_digit,
	output_numeric, output_mirror, output_joining_type,
	output_joining_group, output_scripts, output_scripts_byname,
	output_blocks, output_ident_category, output_lbrk_tables,
	output_wbrk_tables, output_gbp_table, output_decomposition_tables,
	output_composition_tables, output_simple_mapping, output_casing_rules):
	Invoke output_library_license.
	(output_predicate_test, output_decimal_digit_test, output_digit_test,
	output_numeric_test, output_joining_type_test,
	output_joining_group_test, output_gbp_test, output_simple_mapping_test):
	Invoke output_tests_license.
	* lib/uni*/*.h, lib/uni*/*.gperf: Regenerated.
	* tests/uni*/*.h: Likewise.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Generate correct license notices in libunistring files.
	* lib/uniname/gen-uninames.lisp (main): Emit a copyright and license
	notice.
	* lib/uniname/uninames.h: Regenerated.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put LGPLv2+ notices in source files where appropriate.
	* lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description
	says so.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put "unlimited" notices in source files where appropriate.
	* build-aux/prefix-gnulib-mk: Use "unlimited" notice, since the module
	description says so.

2021-06-04  Bruno Haible  <bruno@clisp.org>

	Put public domain notices in source files where appropriate.
	* lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.


[-- Attachment #2: 0001-Put-public-domain-notices-in-source-files-where-appr.patch --]
[-- Type: text/x-patch, Size: 3601 bytes --]

From fa5c2532b786e4108163fd6949e48a409eef5daa Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Fri, 4 Jun 2021 20:55:35 +0200
Subject: [PATCH 1/8] Put public domain notices in source files where
 appropriate.

* lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.
---
 ChangeLog     |  5 +++++
 lib/alloca.c  |  4 +++-
 lib/atexit.c  |  6 ++++--
 lib/dummy.c   | 13 +------------
 lib/memmove.c |  8 +++++---
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96261d5b..752b748 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2021-06-04  Bruno Haible  <bruno@clisp.org>
 
+	Put public domain notices in source files where appropriate.
+	* lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.
+
+2021-06-04  Bruno Haible  <bruno@clisp.org>
+
 	Revamp check-copyright script.
 	* check-copyright: Search only the first 50 lines of each file.
 	Recognize 'LGPLv3+ or GPLv2+', 'unlimited', and 'public domain' license
diff --git a/lib/alloca.c b/lib/alloca.c
index 91b9ec3..4880283 100644
--- a/lib/alloca.c
+++ b/lib/alloca.c
@@ -1,5 +1,7 @@
 /* alloca.c -- allocate automatically reclaimed memory
-   (Mostly) portable public-domain implementation -- D A Gwyn
+   This file is in the public domain.  */
+
+/* (Mostly) portable implementation -- D A Gwyn
 
    This implementation of the PWB library alloca function,
    which is used to allocate space off the run-time stack so
diff --git a/lib/atexit.c b/lib/atexit.c
index 5ef33e5..e47b9fb 100644
--- a/lib/atexit.c
+++ b/lib/atexit.c
@@ -1,5 +1,7 @@
-/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
-/* This function is in the public domain.  --Mike Stump. */
+/* Wrapper to implement ANSI C's atexit using SunOS's on_exit.  */
+/* This file is in the public domain.  */
+
+/* Written by Mike Stump.  */
 
 #include <config.h>
 
diff --git a/lib/dummy.c b/lib/dummy.c
index fa899e5..49b58b1 100644
--- a/lib/dummy.c
+++ b/lib/dummy.c
@@ -1,18 +1,7 @@
 /* A dummy file, to prevent empty libraries from breaking builds.
    Copyright (C) 2004, 2007, 2009-2021 Free Software Foundation, Inc.
 
-   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; either version 3 of the License, or
-   (at your option) any later version.
-
-   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 <https://www.gnu.org/licenses/>.  */
+   This file is in the public domain.  */
 
 /* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
    libraries without any object files.  You might get an error like:
diff --git a/lib/memmove.c b/lib/memmove.c
index 0f04054..0d80de6 100644
--- a/lib/memmove.c
+++ b/lib/memmove.c
@@ -1,12 +1,14 @@
 /* memmove.c -- copy memory.
-   Copy LENGTH bytes from SOURCE to DEST.  Does not null-terminate.
-   In the public domain.
-   By David MacKenzie <djm@gnu.ai.mit.edu>.  */
+   This file is in the public domain.  */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
 #include <config.h>
 
 #include <stddef.h>
 
+/* Copy LENGTH bytes from SOURCE to DEST.  Does not null-terminate.  */
+
 void *
 memmove (void *dest0, void const *source0, size_t length)
 {
-- 
2.7.4


[-- Attachment #3: 0002-Put-unlimited-notices-in-source-files-where-appropri.patch --]
[-- Type: text/x-patch, Size: 2087 bytes --]

From 429b9cda0b1fff009c132f7ea461e08cc7095d8e Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Fri, 4 Jun 2021 20:55:39 +0200
Subject: [PATCH 2/8] Put "unlimited" notices in source files where
 appropriate.

* build-aux/prefix-gnulib-mk: Use "unlimited" notice, since the module
description says so.
---
 ChangeLog                  |  6 ++++++
 build-aux/prefix-gnulib-mk | 15 +++------------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 752b748..39f57b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-06-04  Bruno Haible  <bruno@clisp.org>
 
+	Put "unlimited" notices in source files where appropriate.
+	* build-aux/prefix-gnulib-mk: Use "unlimited" notice, since the module
+	description says so.
+
+2021-06-04  Bruno Haible  <bruno@clisp.org>
+
 	Put public domain notices in source files where appropriate.
 	* lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.
 
diff --git a/build-aux/prefix-gnulib-mk b/build-aux/prefix-gnulib-mk
index 65ee85f..347ddcd 100755
--- a/build-aux/prefix-gnulib-mk
+++ b/build-aux/prefix-gnulib-mk
@@ -5,18 +5,9 @@
 
 # Copyright (C) 2012-2021 Free Software Foundation, Inc.
 #
-# 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, either version 3 of the License, or
-# (at your option) any later version.
-#
-# 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 <https://www.gnu.org/licenses/>.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
 #
 # Written by Jim Meyering
 
-- 
2.7.4


[-- Attachment #4: 0003-Put-LGPLv2-notices-in-source-files-where-appropriate.patch.xz --]
[-- Type: application/x-xz, Size: 37112 bytes --]

[-- Attachment #5: 0004-Generate-correct-license-notices-in-libunistring-fil.patch --]
[-- Type: text/x-patch, Size: 6696 bytes --]

From 80b4ecc452f9a6cafa38702e465bf25d7c27c5de Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Fri, 4 Jun 2021 20:55:44 +0200
Subject: [PATCH 4/8] Generate correct license notices in libunistring files.

* lib/uniname/gen-uninames.lisp (main): Emit a copyright and license
notice.
* lib/uniname/uninames.h: Regenerated.
---
 ChangeLog                     |  7 +++++++
 lib/uniname/gen-uninames.lisp | 46 +++++++++++++++++++++++++++++++++++--------
 lib/uniname/uninames.h        | 22 +++++++++++++++++++++
 3 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 79aabfb..7706351 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2021-06-04  Bruno Haible  <bruno@clisp.org>
 
+	Generate correct license notices in libunistring files.
+	* lib/uniname/gen-uninames.lisp (main): Emit a copyright and license
+	notice.
+	* lib/uniname/uninames.h: Regenerated.
+
+2021-06-04  Bruno Haible  <bruno@clisp.org>
+
 	Put LGPLv2+ notices in source files where appropriate.
 	* lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description
 	says so.
diff --git a/lib/uniname/gen-uninames.lisp b/lib/uniname/gen-uninames.lisp
index 86cc2f7..e34ef19 100755
--- a/lib/uniname/gen-uninames.lisp
+++ b/lib/uniname/gen-uninames.lisp
@@ -5,18 +5,26 @@
 ;;; Copyright (C) 2000-2021 Free Software Foundation, Inc.
 ;;; Written by Bruno Haible <bruno@clisp.org>, 2000-12-28.
 ;;;
-;;; 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; either version 3 of the License, or
-;;; (at your option) any later version.
+;;; This program is free software.
+;;; It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
+;;; You can redistribute it and/or modify it under either
+;;;   - the terms of the GNU Lesser General Public License as published
+;;;     by the Free Software Foundation; either version 3, or (at your
+;;;     option) any later version, or
+;;;   - the terms of the GNU General Public License as published by the
+;;;     Free Software Foundation; either version 2, or (at your option)
+;;;     any later version, or
+;;;   - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
 ;;;
 ;;; 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.
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; Lesser General Public License and 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 <https://www.gnu.org/licenses/>.
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License and of the GNU General Public License along with this
+;;; program.  If not, see <https://www.gnu.org/licenses/>.
 
 (defparameter add-comments nil)
 
@@ -166,6 +174,28 @@
         (format ostream " * Unicode character name table.~%")
         (format ostream " * Generated automatically by the gen-uninames utility.~%")
         (format ostream " */~%")
+        (format ostream "/* Copyright (C) 2000-2021 Free Software Foundation, Inc.~%")
+        (format ostream "~%")
+        (format ostream "   This program is free software.~%")
+        (format ostream "   It is dual-licensed under \"the GNU LGPLv3+ or the GNU GPLv2+\".~%")
+        (format ostream "   You can redistribute it and/or modify it under either~%")
+        (format ostream "     - the terms of the GNU Lesser General Public License as published~%")
+        (format ostream "       by the Free Software Foundation; either version 3, or (at your~%")
+        (format ostream "       option) any later version, or~%")
+        (format ostream "     - the terms of the GNU General Public License as published by the~%")
+        (format ostream "       Free Software Foundation; either version 2, or (at your option)~%")
+        (format ostream "       any later version, or~%")
+        (format ostream "     - the same dual license \"the GNU LGPLv3+ or the GNU GPLv2+\".~%")
+        (format ostream "~%")
+        (format ostream "   This program is distributed in the hope that it will be useful,~%")
+        (format ostream "   but WITHOUT ANY WARRANTY; without even the implied warranty of~%")
+        (format ostream "   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU~%")
+        (format ostream "   Lesser General Public License and the GNU General Public License~%")
+        (format ostream "   for more details.~%")
+        (format ostream "~%")
+        (format ostream "   You should have received a copy of the GNU Lesser General Public~%")
+        (format ostream "   License and of the GNU General Public License along with this~%")
+        (format ostream "   program.  If not, see <https://www.gnu.org/licenses/>.  */~%")
         (format ostream "~%")
         (format ostream "static const char unicode_name_words[~D] = {~%"
                         (let ((sum 0))
diff --git a/lib/uniname/uninames.h b/lib/uniname/uninames.h
index 191b353..3203c66 100644
--- a/lib/uniname/uninames.h
+++ b/lib/uniname/uninames.h
@@ -5,6 +5,28 @@
  * Unicode character name table.
  * Generated automatically by the gen-uninames utility.
  */
+/* Copyright (C) 2000-2021 Free Software Foundation, Inc.
+
+   This program is free software.
+   It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+".
+   You can redistribute it and/or modify it under either
+     - the terms of the GNU Lesser General Public License as published
+       by the Free Software Foundation; either version 3, or (at your
+       option) any later version, or
+     - the terms of the GNU General Public License as published by the
+       Free Software Foundation; either version 2, or (at your option)
+       any later version, or
+     - the same dual license "the GNU LGPLv3+ or the GNU GPLv2+".
+
+   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
+   Lesser General Public License and the GNU General Public License
+   for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License and of the GNU General Public License along with this
+   program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 static const char unicode_name_words[71408] = {
   'A',
-- 
2.7.4


[-- Attachment #6: 0005-Generate-correct-license-notices-in-libunistring-fil.patch.xz --]
[-- Type: application/x-xz, Size: 10068 bytes --]

[-- Attachment #7: 0006-Put-LGPLv3-or-GPLv2-notices-in-source-files-where-ap.patch.xz --]
[-- Type: application/x-xz, Size: 21976 bytes --]

[-- Attachment #8: 0007-Put-LGPLv3-notices-in-source-files-where-appropriate.patch.xz --]
[-- Type: application/x-xz, Size: 14352 bytes --]

[-- Attachment #9: 0008-Put-GPLv3-notices-in-source-files-where-appropriate.patch.xz --]
[-- Type: application/x-xz, Size: 5076 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: put appropriate license notices in source files
  2021-06-04 20:03 put appropriate license notices in source files Bruno Haible
@ 2021-06-04 20:25 ` Eric Blake
  2021-06-04 20:36   ` Paul Eggert
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Eric Blake @ 2021-06-04 20:25 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

On Fri, Jun 04, 2021 at 10:03:04PM +0200, Bruno Haible wrote:
>   * There are many tools for copyright and license checking [2] and we make
>     their job easier by avoiding unclear situations regarding what is
>     "nontrivial".
> So, I added copyright and license notices to these files.
> 
> [1] https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
> [2] https://wiki.debian.org/CopyrightReviewTools

Speaking of tools, should we include SPDX tags alongside the full text
of all our licenses, as that is yet another thing that aids
license-checking tools?

https://spdx.github.io/spdx-spec/appendix-V-using-SPDX-short-identifiers-in-source-files/

However, for clarity, I think it is wrong to rely on SPDX tag only in
place of the full license text; adding the one-liner SPDX should be
just that, an additional line.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: put appropriate license notices in source files
  2021-06-04 20:25 ` Eric Blake
@ 2021-06-04 20:36   ` Paul Eggert
  2021-06-04 21:02   ` Bruno Haible
  2021-06-07 10:13   ` Simon Josefsson via Gnulib discussion list
  2 siblings, 0 replies; 5+ messages in thread
From: Paul Eggert @ 2021-06-04 20:36 UTC (permalink / raw)
  To: Eric Blake; +Cc: Bruno Haible, bug-gnulib

On 6/4/21 1:25 PM, Eric Blake wrote:
> Speaking of tools, should we include SPDX tags alongside the full text
> of all our licenses, as that is yet another thing that aids
> license-checking tools?

That's not a job I'd care to take on, for reasons I discussed for tzdb 
last year (see the last paragraph):

https://mm.icann.org/pipermail/tz/2020-June/029122.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: put appropriate license notices in source files
  2021-06-04 20:25 ` Eric Blake
  2021-06-04 20:36   ` Paul Eggert
@ 2021-06-04 21:02   ` Bruno Haible
  2021-06-07 10:13   ` Simon Josefsson via Gnulib discussion list
  2 siblings, 0 replies; 5+ messages in thread
From: Bruno Haible @ 2021-06-04 21:02 UTC (permalink / raw)
  To: Eric Blake; +Cc: bug-gnulib

Eric Blake wrote:
> Speaking of tools, should we include SPDX tags alongside the full text
> of all our licenses, as that is yet another thing that aids
> license-checking tools?

If there is a GNU policy on this, I would follow it.

Personally I think there is little point to it. SPDX arose in the Linux kernel,
where there is (or has traditionally been at some time) a sloppy attitude
regarding copyright and license headers.
In GNU, the systematic use of a license header in most files alleviates the
problem to a large extent.

Bruno



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: put appropriate license notices in source files
  2021-06-04 20:25 ` Eric Blake
  2021-06-04 20:36   ` Paul Eggert
  2021-06-04 21:02   ` Bruno Haible
@ 2021-06-07 10:13   ` Simon Josefsson via Gnulib discussion list
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Josefsson via Gnulib discussion list @ 2021-06-07 10:13 UTC (permalink / raw)
  To: Eric Blake; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Eric Blake <eblake@redhat.com> writes:

> Speaking of tools, should we include SPDX tags alongside the full text
> of all our licenses, as that is yet another thing that aids
> license-checking tools?
>
> https://spdx.github.io/spdx-spec/appendix-V-using-SPDX-short-identifiers-in-source-files/

I'm not a big fan of doing that -- to me it is yet another way we patch
source code to solve external tooling problems, and this tool is not
even used for technical purposes.  I believe we've seen that over time
that is a bad approach, even if a good case can be made for each
improvement (like this).

Another problem is that SPDX introduce the possibility of mismatch
between the license mentioned by a SPDX tag and the license boiler plate
(which is GNU policy and standard legal behaviour).  Given that we
already have some of that complexity in gnulib ('License:' clause in
modules file), I'm not sure I would want to make the situation even more
complex.

OTOH, I don't think there needs to be a firm catch-all rule on this, if
someone wants to include and maintain SPDX tags in some files.

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-07 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 20:03 put appropriate license notices in source files Bruno Haible
2021-06-04 20:25 ` Eric Blake
2021-06-04 20:36   ` Paul Eggert
2021-06-04 21:02   ` Bruno Haible
2021-06-07 10:13   ` Simon Josefsson via Gnulib discussion list

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).