e354a5
commit 97476447edff96e526daa1a22d6ed3665181ff93
e354a5
Author: DJ Delorie <dj@redhat.com>
e354a5
Date:   Wed Oct 23 17:52:26 2019 -0400
e354a5
e354a5
    Install charmaps uncompressed in testroot
e354a5
    
e354a5
    The testroot does not have a gunzip command, so the charmap files
e354a5
    should not be installed gzipped else they cannot be used (and thus
e354a5
    tested).  With this patch, installing with INSTALL_UNCOMPRESSED=yes
e354a5
    installs uncompressed charmaps instead.
e354a5
    
e354a5
    Note that we must purge the $(symbolic_link_list) as it contains
e354a5
    references to $(DESTDIR), which we change during the testroot
e354a5
    installation.
e354a5
    
e354a5
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
e354a5
e354a5
diff --git a/Makefile b/Makefile
e354a5
index 3748d6f7cfb6223b..6d73241bbc811c13 100644
e354a5
--- a/Makefile
e354a5
+++ b/Makefile
e354a5
@@ -398,8 +398,15 @@ ifeq ($(run-built-tests),yes)
e354a5
 	    $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
e354a5
 	  done
e354a5
 endif
e354a5
+	# $(symbolic-link-list) is a file that encodes $(DESTDIR) so we
e354a5
+	# have to purge it
e354a5
+	rm -f $(symbolic-link-list)
e354a5
+	# Setting INSTALL_UNCOMPRESSED causes localedata/Makefile to
e354a5
+	# install the charmaps uncompressed, as the testroot does not
e354a5
+	# provide a gunzip program.
e354a5
 	$(MAKE) install DESTDIR=$(objpfx)testroot.pristine \
e354a5
-	  subdirs='$(sorted-subdirs)'
e354a5
+	  INSTALL_UNCOMPRESSED=yes subdirs='$(sorted-subdirs)'
e354a5
+	rm -f $(symbolic-link-list)
e354a5
 	touch $(objpfx)testroot.pristine/install.stamp
e354a5
 
e354a5
 tests-special-notdir = $(patsubst $(objpfx)%, %, $(tests-special))
e354a5
diff --git a/localedata/Makefile b/localedata/Makefile
e354a5
index 0fed95dcae6a9183..14fcc37fed21e740 100644
e354a5
--- a/localedata/Makefile
e354a5
+++ b/localedata/Makefile
e354a5
@@ -167,9 +167,17 @@ endif
e354a5
 endif
e354a5
 
e354a5
 # Files to install.
e354a5
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
e354a5
+# This option is for testing inside the testroot container, as the
e354a5
+# container does not include a working gunzip program.
e354a5
+install-others := $(addprefix $(inst_i18ndir)/, \
e354a5
+			      $(charmaps) \
e354a5
+			      $(locales))
e354a5
+else
e354a5
 install-others := $(addprefix $(inst_i18ndir)/, \
e354a5
 			      $(addsuffix .gz, $(charmaps)) \
e354a5
 			      $(locales))
e354a5
+endif
e354a5
 
e354a5
 tests: $(objdir)/iconvdata/gconv-modules
e354a5
 
e354a5
@@ -282,12 +290,22 @@ endif
e354a5
 
e354a5
 include ../Rules
e354a5
 
e354a5
+ifeq ($(INSTALL_UNCOMPRESSED),yes)
e354a5
+# Install the charmap files as-is.  This option is for testing inside
e354a5
+# the testroot container, as the container does not include a working
e354a5
+# gunzip program.
e354a5
+$(inst_i18ndir)/charmaps/%: charmaps/% $(+force)
e354a5
+	$(make-target-directory)
e354a5
+	rm -f $@
e354a5
+	$(INSTALL_DATA) $< $@
e354a5
+else
e354a5
 # Install the charmap files in gzipped format.
e354a5
 $(inst_i18ndir)/charmaps/%.gz: charmaps/% $(+force)
e354a5
 	$(make-target-directory)
e354a5
 	rm -f $(@:.gz=) $@
e354a5
 	$(INSTALL_DATA) $< $(@:.gz=)
e354a5
 	gzip -9n $(@:.gz=)
e354a5
+endif
e354a5
 
e354a5
 # Install the locale source files in the appropriate directory.
e354a5
 $(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)