Dear Recipients,

The bug#18485 has been fixed.  The change has been pushed to Savannah.
The patch is attached to this e-mail.  Thank you for reporting.

--
With Valediction,
Kamila Szewczyk (https://iczelia.net)
From 4a834f920d33d6dcaed39b44bd6512ba48d455e2 Mon Sep 17 00:00:00 2001
From: Kamila Szewczyk <[email protected]>
Date: Tue, 25 Aug 2026 16:23:42 +0200
Subject: [PATCH] automake: fix automake bug #18485
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From https://bugs.gnu.org/18485 (Niels Möller).

Recognise COPYINGv2, COPYINGv3, COPYING.LESSERv2 and COPYING.LESSERv3
as license files; distribute them automatically, similarly to COPYING.
This improves compatibility with other GNU projects, notably GNU GMP.

A regression test has been added alongside the change.

* bin/automake.in: Add the relevant license names to common files and
  licenses list.
* NEWS: Mention this patch.
* t/license-gnulib-names.sh: Add a regression test.
* t/list-of-tests.mk: Register the test above.
---
 NEWS                      |  5 +++
 bin/automake.in           |  8 +++--
 t/license-gnulib-names.sh | 66 +++++++++++++++++++++++++++++++++++++++
 t/list-of-tests.mk        |  1 +
 4 files changed, 77 insertions(+), 3 deletions(-)
 create mode 100755 t/license-gnulib-names.sh

diff --git a/NEWS b/NEWS
index 9348148f8..f4f3e0af5 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,11 @@ New in 1.19 (????-??-??):
 
 * Bugs fixed
 
+  - Recognise COPYINGv2, COPYINGv3, COPYING.LESSERv2 and COPYING.LESSERv3
+    as license files; distribute them automatically, similarly to COPYING.
+    This improves compatibility with other GNU projects, notably GNU GMP.
+    (bug#17394)
+
   - `make dist-bzip2 dist-xz' now succeeds.  They share the intermediate
     uncompressed tarball as a result of another fix.  The first goal used
     to delete it, so every later goal failed with ENOENT.  Under GNU make
diff --git a/bin/automake.in b/bin/automake.in
index f43c4e112..c44a9c56c 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -204,7 +204,8 @@ my @toplevelmd_ok = qw(AUTHORS ChangeLog INSTALL NEWS README THANKS);
 # Commonly found files we look for and automatically include in DISTFILES.
 my @common_files =
     (qw(ABOUT-GNU ABOUT-NLS BACKLOG COPYING
-        COPYING.DOC COPYING.LIB COPYING.LESSER TODO
+        COPYING.DOC COPYING.LIB COPYING.LESSER
+        COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3 TODO
 	ar-lib compile config.guess config.rpath
 	config.sub depcomp install-sh libversion.in mdate-sh
 	missing mkinstalldirs py-compile texinfo.tex ylwrap),
@@ -5743,10 +5744,11 @@ sub check_gnu_standards ()
           require_file ("$am_file.am", GNU, $required);
         }
 
-      # Accept one of these three licenses; default to COPYING.
+      # Accept one of these licenses; default to COPYING.
       # Make sure we do not overwrite an existing license.
       my $license;
-      foreach (qw /COPYING COPYING.LIB COPYING.LESSER/)
+      foreach (qw /COPYING COPYING.LIB COPYING.LESSER
+                   COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3/)
 	{
 	  if (-f $_)
 	    {
diff --git a/t/license-gnulib-names.sh b/t/license-gnulib-names.sh
new file mode 100755
index 000000000..c434ee8e8
--- /dev/null
+++ b/t/license-gnulib-names.sh
@@ -0,0 +1,66 @@
+#! /bin/sh
+# Copyright (C) 2026 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 2, 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/>.
+
+. test-init.sh
+
+cat > configure.ac << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([gnu])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+: > Makefile.am
+: > AUTHORS
+: > ChangeLog
+: > NEWS
+: > README
+: > INSTALL
+: > COPYINGv2
+: > COPYINGv3
+: > COPYING.LESSERv3
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+# No license file may have been added ...
+test ! -e COPYING
+# ... and nothing may have been said about one being missing.
+$AUTOMAKE --add-missing 2>stderr
+cat stderr
+grep -i 'COPYING' stderr && exit 1
+
+# All of them are distributed, as plain COPYING would be.
+$FGREP 'COPYINGv2' Makefile.in
+$FGREP 'COPYINGv3' Makefile.in
+$FGREP 'COPYING.LESSERv3' Makefile.in
+
+# A package with no license at all must still get one, as before.
+mkdir sub
+cd sub
+cat > configure.ac << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([gnu])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+: > Makefile.am
+for f in AUTHORS ChangeLog NEWS README INSTALL; do : > $f; done
+$ACLOCAL
+$AUTOMAKE --add-missing
+test -e COPYING
+
+:
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index ae8b7079c..ab5a45b3f 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -664,6 +664,7 @@ t/libtool8.sh \
 t/libtool9.sh \
 t/license.sh \
 t/license2.sh \
+t/license-gnulib-names.sh \
 t/link_c_cxx.sh \
 t/link_cond.sh \
 t/link_dist.sh \
-- 
2.53.0

Attachment: OpenPGP_0xC868F0B6DE38409D.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to