[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: support for lzma in automake?
From: |
Jim Meyering |
Subject: |
Re: support for lzma in automake? |
Date: |
Sun, 07 Oct 2007 11:44:55 +0200 |
address@hidden (Karl Berry) wrote:
> Could we have a new option in automake for making lzma-compressed
> tarballs, a la bzip2? The package to use is lzma-utils, from
> http://tukaani.org/lzma/. Generally, it compresses better and
> uncompresses faster than bzip.
>
> Jim, perhaps you would like to supply a patch :)? (Jim was the one who
> instigated this.)
Here's the patch. It works for coreutils.
It also passed "make check", well at least up to "pr401.test"
where I interrupted it.
[BTW, if there's interest (ha!) I will set up a read-only git mirror
on sourceware.org of the primary automake-cvs repository there.
Lvm2 and device-mapper were the first test subjects there:
http://sources.redhat.com/git/gitweb.cgi
]
2007-10-07 Jim Meyering <address@hidden>
Add lzma compression support.
* NEWS: Mention it.
* automake.in (handle_dist): Recognize dist-lzma.
(make_paragraphs): Map LZMA to dist-lzma.
* doc/automake.texi (Dist): Add dist-lzma.
(Options): Likewise.
* lib/Automake/Options.pm (_process_option_list):
* lib/am/distdir.am (dist-lzma): New rule.
(dist dist-all): Add command to create an lzma-compressed tarball.
(distcheck): Handle lzma-compressed tarballs just like the others.
* tests/defs.in: Test for lzma, too.
* tests/lzma.test: New file, based on nogzip.test.
* tests/Makefile.am (TESTS): Add lzma.test.
I'll commit it in a couple days.
Signed-off-by: Jim Meyering <address@hidden>
---
NEWS | 2 ++
automake.in | 3 ++-
doc/automake.texi | 15 +++++++++++++--
lib/Automake/Options.pm | 3 ++-
lib/am/distdir.am | 9 +++++++++
tests/Makefile.am | 1 +
tests/defs.in | 4 ++++
tests/lzma.test | 45 +++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 78 insertions(+), 4 deletions(-)
create mode 100755 tests/lzma.test
diff --git a/NEWS b/NEWS
index 6304757..467208e 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@ New in 1.10a:
* Miscellaneous changes:
+ - Supports lzma-compressed tarballs.
+
- Automake is licensed under GPLv3+. `automake --add-missing' will
by default install the GPLv3 file as COPYING if it is missing.
Note that Automake will never overwrite an existing COPYING file,
diff --git a/automake.in b/automake.in
index 47023ba..234947b 100755
--- a/automake.in
+++ b/automake.in
@@ -3613,7 +3613,7 @@ sub handle_dist ()
{
my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
$archive_defined ||=
- grep { option "dist-$_" } ('shar', 'zip', 'tarZ', 'bzip2');
+ grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma);
error (option 'no-dist-gzip',
"no-dist-gzip specified but no dist-* specified, "
. "at least one archive format must be enabled")
@@ -6446,6 +6446,7 @@ sub make_paragraphs ($%)
'MAINTAINER-MODE'
=> $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
+ 'LZMA' => !! option 'dist-lzma',
'BZIP2' => !! option 'dist-bzip2',
'COMPRESS' => !! option 'dist-tarZ',
'GZIP' => ! option 'no-dist-gzip',
diff --git a/doc/automake.texi b/doc/automake.texi
index b3361d3..1b7e521 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8082,6 +8082,11 @@ frequently smaller than gzipped archives.
Generate a gzip tar archive of the distribution.
@trindex dist-gzip
address@hidden @code{dist-lzma}
+Generate a lzma tar archive of the distribution. lzma archives are
+frequently smaller than bzipped archives.
address@hidden dist-lzma
+
@item @code{dist-shar}
Generate a shar archive of the distribution.
@trindex dist-shar
@@ -8369,6 +8374,12 @@ Cause @command{dejagnu}-specific rules to be generated.
@xref{Tests}.
Hook @code{dist-bzip2} to @code{dist}.
@trindex dist-bzip2
address@hidden @option{dist-lzma}
address@hidden Option, @option{dist-lzma}
address@hidden dist-lzma
+Hook @code{dist-lzma} to @code{dist}.
address@hidden dist-lzma
+
@item @option{dist-shar}
@cindex Option, @option{dist-shar}
@opindex dist-shar
@@ -8540,7 +8551,7 @@ In order to use this option with C sources, you should add
These three mutually exclusive options select the tar format to use
when generating tarballs with @samp{make dist}. (The tar file created
is then compressed according to the set of @option{no-dist-gzip},
address@hidden and @option{dist-tarZ} options in use.)
address@hidden, @option{dist-lzma} and @option{dist-tarZ} options in use.)
These options must be passed as argument to @code{AM_INIT_AUTOMAKE}
(@pxref{Macros}) because they can require additional configure checks.
@@ -12074,4 +12085,4 @@ The number of test cases in the test suite.
@c LocalWords: LTALLOCA MALLOC malloc memcmp strdup alloca libcompat xyz DFOO
@c LocalWords: unprefixed buildable preprocessed DBAZ DDATADIR WARNINGCFLAGS
@c LocalWords: LIBFOOCFLAGS LIBFOOLDFLAGS ftable testSubDir obj LIBTOOLFLAGS
address@hidden LocalWords: barexec Pinard's automatize initialize
address@hidden LocalWords: barexec Pinard's automatize initialize lzma
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index c4c8775..a63f97a 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2007 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
@@ -261,6 +261,7 @@ sub _process_option_list (\%$@)
elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
|| $_ eq 'dist-shar' || $_ eq 'dist-zip'
|| $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
+ || $_ eq 'dist-lzma'
|| $_ eq 'no-dist-gzip' || $_ eq 'no-dist'
|| $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
|| $_ eq 'readme-alpha' || $_ eq 'check-news'
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index c62ef53..ce547fd 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -259,6 +259,12 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+?LZMA?DIST_ARCHIVES += $(distdir).tar.lzma
+.PHONY: dist-lzma
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
.PHONY: dist-tarZ
dist-tarZ: distdir
@@ -295,6 +301,7 @@ if %?TOPDIR_P%
dist dist-all: distdir
?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c
>$(distdir).tar.gz
?BZIP2? tardir=$(distdir) && $(am__tar) | bzip2 -9 -c
>$(distdir).tar.bz2
+?LZMA? tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
?COMPRESS? tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
?ZIP? -rm -f $(distdir).zip
@@ -320,6 +327,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ee35345..436de63 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -358,6 +358,7 @@ ltconv.test \
ltdeps.test \
ltlibobjs.test \
ltlibsrc.test \
+lzma.test \
maintclean.test \
make.test \
makej.test \
diff --git a/tests/defs.in b/tests/defs.in
index 78cf37a..f2887a6 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -162,6 +162,10 @@ do
echo "$me: running $CC -V -help"
( $CC -V -help ) || exit 77
;;
+ lzma)
+ echo "$me: running lzma --version"
+ ( lzma --version ) || exit 77
+ ;;
makedepend)
echo "$me: running makedepend -f-"
( makedepend -f- ) || exit 77
diff --git a/tests/lzma.test b/tests/lzma.test
new file mode 100755
index 0000000..cbdaf20
--- /dev/null
+++ b/tests/lzma.test
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2007 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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, or (at your option)
+# any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Check support for no-dist-gzip with lzma
+
+required=lzma
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([nogzip], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-lzma])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+test: distcheck
+ test $(DIST_ARCHIVES) = nogzip-1.0.tar.lzma
+ test -f $(DIST_ARCHIVES)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE test
--
1.5.3.4.206.g58ba4
- Re: support for lzma in automake?,
Jim Meyering <=