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 <br...@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 <br...@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 <br...@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 <br...@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 <br...@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 <br...@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 <br...@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 <br...@clisp.org> Put public domain notices in source files where appropriate. * lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.
>From fa5c2532b786e4108163fd6949e48a409eef5daa Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@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 <br...@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 <br...@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 <d...@gnu.ai.mit.edu>. */ + This file is in the public domain. */ + +/* Written by David MacKenzie <d...@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
>From 429b9cda0b1fff009c132f7ea461e08cc7095d8e Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@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 <br...@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 <br...@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
0003-Put-LGPLv2-notices-in-source-files-where-appropriate.patch.xz
Description: application/xz
>From 80b4ecc452f9a6cafa38702e465bf25d7c27c5de Mon Sep 17 00:00:00 2001 From: Bruno Haible <br...@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 <br...@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 <br...@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 <br...@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
0005-Generate-correct-license-notices-in-libunistring-fil.patch.xz
Description: application/xz
0006-Put-LGPLv3-or-GPLv2-notices-in-source-files-where-ap.patch.xz
Description: application/xz
0007-Put-LGPLv3-notices-in-source-files-where-appropriate.patch.xz
Description: application/xz
0008-Put-GPLv3-notices-in-source-files-where-appropriate.patch.xz
Description: application/xz