]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Achieve better tarball compression ratios in "make dist".
authorBruno Haible <bruno@clisp.org>
Wed, 8 Jan 2025 08:34:55 +0000 (09:34 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 8 Jan 2025 09:44:13 +0000 (10:44 +0100)
Suggested by Lasse Collin <lasse.collin@tukaani.org>
in <https://lists.gnu.org/archive/html/bug-gettext/2025-01/msg00011.html>.

* configure.ac (am__tar): Sort the files by basename.

configure.ac

index 51066769554dcb473bb0ade10ad7cc54587d648a..2521e4da0a3cd41834cb59872c3d00a12551e4bd 100644 (file)
@@ -1,5 +1,5 @@
 dnl Configuration for the toplevel directory of GNU gettext
-dnl Copyright (C) 1995-2024 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2025 Free Software Foundation, Inc.
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -24,8 +24,13 @@ AC_CONFIG_SRCDIR([gettext-tools/src/msgfmt.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([1.13 silent-rules parallel-tests tar-ustar])
 
-dnl Override automake's tar command used for creating distributions.
-am__tar='${AMTAR} chf - --format=ustar --owner=root --group=root "$$tardir"'
+dnl Override automake's tar command used for creating distributions:
+dnl - Sort the files by basename, not by dirname, to achieve higher compression
+dnl   ratios (because all compression programs have a limited-size "window").
+dnl - Use format 'ustar' to avoid "file name is too long (max 99)" errors.
+dnl - Use --owner=root --group=root to avoid unsuitable file ownership after
+dnl   the tarball is unpacked by root.
+am__tar='{ find "$$tardir" -type d | LC_ALL=C sort; find "$$tardir" ! -type d -printf "%f\\t%p\\n" | LC_ALL=C sort | LC_ALL=C cut -f2; } | ${AMTAR} chf - --no-recursion --files-from=- --format=ustar --owner=root --group=root'
 
 dnl Checks for programs.