public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add convenience target 'install-locale-files'.
@ 2018-07-26 17:27 Carlos O'Donell
  2018-07-26 17:33 ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-26 17:27 UTC (permalink / raw)
  To: GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>

OK for 2.29 when it opens?

Signed-off-by: Carlos O'Donell <carlos@redhat.com>

Cheers,
Carlos.

[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 3472 bytes --]

From fde96ec607c2720a1c3e184447f932b83c8abfdf Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>
---
 ChangeLog           | 10 ++++++++++
 localedata/Makefile | 26 ++++++++++++++++++++------
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..3606b912ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Add convenience target 'install-locale-files'.
  2018-07-26 17:27 [PATCH] Add convenience target 'install-locale-files' Carlos O'Donell
@ 2018-07-26 17:33 ` Joseph Myers
  2018-07-26 18:03   ` [PATCHv2] " Carlos O'Donell
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Myers @ 2018-07-26 17:33 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: GNU C Library, Florian Weimer

On Thu, 26 Jul 2018, Carlos O'Donell wrote:

> The convenience install target 'install-locale-files' is created
> to allow distributions to install all of the SUPPORTED locales as
> files instead of into the locale-archive.
> 
> You invoke the new convenience target like this:
> make localedata/install-locale-files install_root=<prefix>
> 
> OK for 2.29 when it opens?

This is missing documentation in install.texi (alongside the existing 
documentation of "make localedata/install-locales") / regeneration of 
INSTALL.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCHv2] Add convenience target 'install-locale-files'.
  2018-07-26 17:33 ` Joseph Myers
@ 2018-07-26 18:03   ` Carlos O'Donell
  2018-07-26 18:36     ` Rical Jasan
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-26 18:03 UTC (permalink / raw)
  To: Joseph Myers; +Cc: GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

On 07/26/2018 01:33 PM, Joseph Myers wrote:
> On Thu, 26 Jul 2018, Carlos O'Donell wrote:
> 
>> The convenience install target 'install-locale-files' is created
>> to allow distributions to install all of the SUPPORTED locales as
>> files instead of into the locale-archive.
>>
>> You invoke the new convenience target like this:
>> make localedata/install-locale-files install_root=<prefix>
>>
>> OK for 2.29 when it opens?
> 
> This is missing documentation in install.texi (alongside the existing 
> documentation of "make localedata/install-locales") / regeneration of 
> INSTALL.

Fixed.

v2
- Update documentation to talk about locale-archive / locale files.
- Regenerate INSTALL.

Tested both install methods.

OK for 2.29 when it opens?


[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 8452 bytes --]

From e91cedf2e53acfe9d0670c275648e8f33de2d126 Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>
---
 ChangeLog           | 12 ++++++++++++
 INSTALL             | 28 ++++++++++++++++++++++------
 localedata/Makefile | 26 ++++++++++++++++++++------
 manual/install.texi | 28 +++++++++++++++++++++-------
 4 files changed, 75 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..f52bf6a1a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+	* manual/install.texi (Running make install): Document.
+	* manual/INSTALL: Regenerate.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/INSTALL b/INSTALL
index 840b862511..47aa241af4 100644
--- a/INSTALL
+++ b/INSTALL
@@ -419,13 +419,29 @@ a pseudoterminal so it can be used by the calling process.  If you are
 using a Linux kernel with the 'devpts' filesystem enabled and mounted at
 '/dev/pts', you don't need this program.
 
-   After installation you might want to configure the timezone and
-locale installation of your system.  The GNU C Library comes with a
-locale database which gets configured with 'localedef'.  For example, to
-set up a German locale with name 'de_DE', simply issue the command
-'localedef -i de_DE -f ISO-8859-1 de_DE'.  To configure all locales that
+   After installation you should configure the timezone and install
+locales for your system.  The time zone configuration ensures that youre
+system time matches the time for your current timezone.  The locales
+ensure that the display of information on your system matches the
+expectations of your language and geographic region.
+
+   The GNU C Library is able to use two kinds of localization
+information sources, the first is a locale database named
+'locale-archive' which is generally installed as
+'/usr/lib/locale/locale-archive'.  The locale archive has the benefit of
+taking up less space and being very fast to load, but only if you plan
+to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.  '/usr/lib/locale/en_US.utf8'.  For example to install
+the German locale using the character set for UTF-8 with name 'de_DE'
+into the locale archive issue the command 'localedef -i de_DE -f UTF-8
+de_DE', and to install just the one locale issue the command 'localedef
+--no-archive -i de_DE -f UTF-8 de_DE'.  To configure all locales that
 are supported by the GNU C Library, you can issue from your build
-directory the command 'make localedata/install-locales'.
+directory the command 'make localedata/install-locales' to install all
+locales into the locale archive or 'make
+localedata/install-locale-files' to install all locales as files in the
+locale installation directory.
 
    To configure the locally used timezone, set the 'TZ' environment
 variable.  The script 'tzselect' helps you to select the right value.
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/manual/install.texi b/manual/install.texi
index a8577dd610..2501586302 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -462,13 +462,27 @@ permissions on a pseudoterminal so it can be used by the calling process.
 If you are using a Linux kernel with the @code{devpts} filesystem enabled
 and mounted at @file{/dev/pts}, you don't need this program.
 
-After installation you might want to configure the timezone and locale
-installation of your system.  @Theglibc{} comes with a locale
-database which gets configured with @code{localedef}.  For example, to
-set up a German locale with name @code{de_DE}, simply issue the command
-@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
-that are supported by @theglibc{}, you can issue from your build directory the
-command @samp{make localedata/install-locales}.
+After installation you should configure the timezone and install locales
+for your system.  The time zone configuration ensures that youre system
+time matches the time for your current timezone.  The locales ensure that
+the display of information on your system matches the expectations of
+your language and geographic region.
+
+@Theglibc{} is able to use two kinds of localization information sources, the
+first is a locale database named @file{locale-archive} which is generally
+installed as @file{/usr/lib/locale/locale-archive}.  The locale archive has the
+benefit of taking up less space and being very fast to load, but only if you
+plan to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install the
+German locale using the character set for UTF-8 with name @code{de_DE} into the
+locale archive issue the command @samp{localedef -i de_DE -f UTF-8 de_DE}, and
+to install just the one locale issue the command @samp{localedef --no-archive -i
+de_DE -f UTF-8 de_DE}.  To configure all locales that are supported by
+@theglibc{}, you can issue from your build directory the command @samp{make
+localedata/install-locales} to install all locales into the locale archive or
+@samp{make localedata/install-locale-files} to install all locales as files in
+the locale installation directory.
 
 To configure the locally used timezone, set the @code{TZ} environment
 variable.  The script @code{tzselect} helps you to select the right value.
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCHv2] Add convenience target 'install-locale-files'.
  2018-07-26 18:03   ` [PATCHv2] " Carlos O'Donell
@ 2018-07-26 18:36     ` Rical Jasan
  2018-07-26 20:17       ` [PATCHv3] " Carlos O'Donell
  0 siblings, 1 reply; 9+ messages in thread
From: Rical Jasan @ 2018-07-26 18:36 UTC (permalink / raw)
  To: Carlos O'Donell, Joseph Myers; +Cc: GNU C Library, Florian Weimer

On 07/26/2018 11:03 AM, Carlos O'Donell wrote:
...
> diff --git a/manual/install.texi b/manual/install.texi
> index a8577dd610..2501586302 100644
> --- a/manual/install.texi
> +++ b/manual/install.texi
> @@ -462,13 +462,27 @@ permissions on a pseudoterminal so it can be used by the calling process.
>  If you are using a Linux kernel with the @code{devpts} filesystem enabled
>  and mounted at @file{/dev/pts}, you don't need this program.
>  
> -After installation you might want to configure the timezone and locale
> -installation of your system.  @Theglibc{} comes with a locale
> -database which gets configured with @code{localedef}.  For example, to
> -set up a German locale with name @code{de_DE}, simply issue the command
> -@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
> -that are supported by @theglibc{}, you can issue from your build directory the
> -command @samp{make localedata/install-locales}.
> +After installation you should configure the timezone and install locales
> +for your system.  The time zone configuration ensures that youre system

"your"

Should there be a short NEWS entry about this?  I mention it because
additions to INSTALL seem to almost always be accompanied by one.

Also, what about documenting the install_root=<prefix> option?  I
recognize it as a common option, but it's still an option that packagers
have to choose to use, so it wouldn't hurt to mention that we support
it, especially since the content talks about installing the locale files
/somewhere/ on the system (giving examples).  My first question about
running a command whose name is "install-something" is, "Where?"

Rical

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCHv3] Add convenience target 'install-locale-files'.
  2018-07-26 18:36     ` Rical Jasan
@ 2018-07-26 20:17       ` Carlos O'Donell
  2018-07-26 20:25         ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-26 20:17 UTC (permalink / raw)
  To: Rical Jasan, Joseph Myers; +Cc: GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]

On 07/26/2018 02:36 PM, Rical Jasan wrote:
> On 07/26/2018 11:03 AM, Carlos O'Donell wrote:
> ...
>> diff --git a/manual/install.texi b/manual/install.texi
>> index a8577dd610..2501586302 100644
>> --- a/manual/install.texi
>> +++ b/manual/install.texi
>> @@ -462,13 +462,27 @@ permissions on a pseudoterminal so it can be used by the calling process.
>>  If you are using a Linux kernel with the @code{devpts} filesystem enabled
>>  and mounted at @file{/dev/pts}, you don't need this program.
>>  
>> -After installation you might want to configure the timezone and locale
>> -installation of your system.  @Theglibc{} comes with a locale
>> -database which gets configured with @code{localedef}.  For example, to
>> -set up a German locale with name @code{de_DE}, simply issue the command
>> -@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
>> -that are supported by @theglibc{}, you can issue from your build directory the
>> -command @samp{make localedata/install-locales}.
>> +After installation you should configure the timezone and install locales
>> +for your system.  The time zone configuration ensures that youre system
> 
> "your"

Fixed.

> Should there be a short NEWS entry about this?  I mention it because
> additions to INSTALL seem to almost always be accompanied by one.

We could. Done.

> Also, what about documenting the install_root=<prefix> option?  I
> recognize it as a common option, but it's still an option that packagers
> have to choose to use, so it wouldn't hurt to mention that we support
> it, especially since the content talks about installing the locale files
> /somewhere/ on the system (giving examples).  My first question about
> running a command whose name is "install-something" is, "Where?"

The use of install_root is not kosher. We actually should only use DESTDIR
as documented in the GNU Coding Standards. We set install_root from DESTDIR.
And we describe DESTDIR earlier in install.texi.

https://www.gnu.org/prep/standards/html_node/DESTDIR.html

I'll mention DESTDIR.

v3
- s/youre/your/g
- Mention DESTDIR.

Cheers,
Carlos.

[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 9733 bytes --]

From b46aeeae17bb45753c36767f7d8ac7b95ae33dfa Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>
---
 ChangeLog           | 12 ++++++++++++
 INSTALL             | 32 ++++++++++++++++++++++++++------
 NEWS                |  7 +++++++
 localedata/Makefile | 26 ++++++++++++++++++++------
 manual/install.texi | 31 ++++++++++++++++++++++++-------
 5 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..f52bf6a1a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+	* manual/install.texi (Running make install): Document.
+	* manual/INSTALL: Regenerate.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/INSTALL b/INSTALL
index 840b862511..1567d7f724 100644
--- a/INSTALL
+++ b/INSTALL
@@ -419,13 +419,33 @@ a pseudoterminal so it can be used by the calling process.  If you are
 using a Linux kernel with the 'devpts' filesystem enabled and mounted at
 '/dev/pts', you don't need this program.
 
-   After installation you might want to configure the timezone and
-locale installation of your system.  The GNU C Library comes with a
-locale database which gets configured with 'localedef'.  For example, to
-set up a German locale with name 'de_DE', simply issue the command
-'localedef -i de_DE -f ISO-8859-1 de_DE'.  To configure all locales that
+   After installation you should configure the timezone and install
+locales for your system.  The time zone configuration ensures that your
+system time matches the time for your current timezone.  The locales
+ensure that the display of information on your system matches the
+expectations of your language and geographic region.
+
+   The GNU C Library is able to use two kinds of localization
+information sources, the first is a locale database named
+'locale-archive' which is generally installed as
+'/usr/lib/locale/locale-archive'.  The locale archive has the benefit of
+taking up less space and being very fast to load, but only if you plan
+to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.  '/usr/lib/locale/en_US.utf8'.  For example to install
+the German locale using the character set for UTF-8 with name 'de_DE'
+into the locale archive issue the command 'localedef -i de_DE -f UTF-8
+de_DE', and to install just the one locale issue the command 'localedef
+--no-archive -i de_DE -f UTF-8 de_DE'.  To configure all locales that
 are supported by the GNU C Library, you can issue from your build
-directory the command 'make localedata/install-locales'.
+directory the command 'make localedata/install-locales' to install all
+locales into the locale archive or 'make
+localedata/install-locale-files' to install all locales as files in the
+default configured locale installation directory (derived from
+'--prefix' or '--localedir').  To install into an alternative system
+root use 'DESTDIR' e.g.  'make localedata/install-locale-files
+DESTDIR=/opt/glibc', but note that this does not change the configured
+prefix.
 
    To configure the locally used timezone, set the 'TZ' environment
 variable.  The script 'tzselect' helps you to select the right value.
diff --git a/NEWS b/NEWS
index b08fee64a6..5032e1a82b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,13 @@ Version 2.28
 
 Major new features:
 
+* A new convenience target has been added for distribution maintainers
+  to build and install all locales as directories with files.  The new
+  target is run by issuing the following command in your build tree:
+  'make localedata/install-locale-files', with an optional DESTDIR
+  to set the install root if you wish to install into a non-default
+  configured location.
+
 * The GNU C Library can now be compiled with support for Intel CET, AKA
   Intel Control-flow Enforcement Technology.  When the library is built
   with --enable-cet, the resulting glibc is protected with indirect
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/manual/install.texi b/manual/install.texi
index a8577dd610..d6301dd382 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -462,13 +462,30 @@ permissions on a pseudoterminal so it can be used by the calling process.
 If you are using a Linux kernel with the @code{devpts} filesystem enabled
 and mounted at @file{/dev/pts}, you don't need this program.
 
-After installation you might want to configure the timezone and locale
-installation of your system.  @Theglibc{} comes with a locale
-database which gets configured with @code{localedef}.  For example, to
-set up a German locale with name @code{de_DE}, simply issue the command
-@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
-that are supported by @theglibc{}, you can issue from your build directory the
-command @samp{make localedata/install-locales}.
+After installation you should configure the timezone and install locales
+for your system.  The time zone configuration ensures that your system
+time matches the time for your current timezone.  The locales ensure that
+the display of information on your system matches the expectations of
+your language and geographic region.
+
+@Theglibc{} is able to use two kinds of localization information sources, the
+first is a locale database named @file{locale-archive} which is generally
+installed as @file{/usr/lib/locale/locale-archive}.  The locale archive has the
+benefit of taking up less space and being very fast to load, but only if you
+plan to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install
+the German locale using the character set for UTF-8 with name @code{de_DE} into
+the locale archive issue the command @samp{localedef -i de_DE -f UTF-8 de_DE},
+and to install just the one locale issue the command @samp{localedef
+--no-archive -i de_DE -f UTF-8 de_DE}.  To configure all locales that are
+supported by @theglibc{}, you can issue from your build directory the command
+@samp{make localedata/install-locales} to install all locales into the locale
+archive or @samp{make localedata/install-locale-files} to install all locales
+as files in the default configured locale installation directory (derived from
+@samp{--prefix} or @code{--localedir}).  To install into an alternative system
+root use @samp{DESTDIR} e.g. @samp{make localedata/install-locale-files
+DESTDIR=/opt/glibc}, but note that this does not change the configured prefix.
 
 To configure the locally used timezone, set the @code{TZ} environment
 variable.  The script @code{tzselect} helps you to select the right value.
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCHv3] Add convenience target 'install-locale-files'.
  2018-07-26 20:17       ` [PATCHv3] " Carlos O'Donell
@ 2018-07-26 20:25         ` Joseph Myers
  2018-07-26 20:30           ` [PATCHv4] " Carlos O'Donell
  0 siblings, 1 reply; 9+ messages in thread
From: Joseph Myers @ 2018-07-26 20:25 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Rical Jasan, GNU C Library, Florian Weimer

On Thu, 26 Jul 2018, Carlos O'Donell wrote:

> +directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install

Should have exactly one space after "e.g.", and need @: before that space 
for it to be properly treated as not an end-of-sentence space.

> +root use @samp{DESTDIR} e.g. @samp{make localedata/install-locale-files

Likewise, need @: after e.g. to avoid makeinfo treating it as the end of a 
sentence and inserting an extra space in INSTALL there.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCHv4] Add convenience target 'install-locale-files'.
  2018-07-26 20:25         ` Joseph Myers
@ 2018-07-26 20:30           ` Carlos O'Donell
  2018-07-27 20:17             ` [PATCHv5] " Carlos O'Donell
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-26 20:30 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Rical Jasan, GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

On 07/26/2018 04:25 PM, Joseph Myers wrote:
> On Thu, 26 Jul 2018, Carlos O'Donell wrote:
> 
>> +directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install
> 
> Should have exactly one space after "e.g.", and need @: before that space 
> for it to be properly treated as not an end-of-sentence space.
> 
>> +root use @samp{DESTDIR} e.g. @samp{make localedata/install-locale-files
> 
> Likewise, need @: after e.g. to avoid makeinfo treating it as the end of a 
> sentence and inserting an extra space in INSTALL there.
> 

Thanks! I'd forgotten about that.

v4
- Fix texinfo formatting.

Cheers,
Carlos.

[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 9734 bytes --]

From 3ea8650c94889e4cced7db310e3b324fb90ed389 Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>
---
 ChangeLog           | 12 ++++++++++++
 INSTALL             | 32 ++++++++++++++++++++++++++------
 NEWS                |  7 +++++++
 localedata/Makefile | 26 ++++++++++++++++++++------
 manual/install.texi | 31 ++++++++++++++++++++++++-------
 5 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..f52bf6a1a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+	* manual/install.texi (Running make install): Document.
+	* manual/INSTALL: Regenerate.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/INSTALL b/INSTALL
index 840b862511..8056a0ac5d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -419,13 +419,33 @@ a pseudoterminal so it can be used by the calling process.  If you are
 using a Linux kernel with the 'devpts' filesystem enabled and mounted at
 '/dev/pts', you don't need this program.
 
-   After installation you might want to configure the timezone and
-locale installation of your system.  The GNU C Library comes with a
-locale database which gets configured with 'localedef'.  For example, to
-set up a German locale with name 'de_DE', simply issue the command
-'localedef -i de_DE -f ISO-8859-1 de_DE'.  To configure all locales that
+   After installation you should configure the timezone and install
+locales for your system.  The time zone configuration ensures that your
+system time matches the time for your current timezone.  The locales
+ensure that the display of information on your system matches the
+expectations of your language and geographic region.
+
+   The GNU C Library is able to use two kinds of localization
+information sources, the first is a locale database named
+'locale-archive' which is generally installed as
+'/usr/lib/locale/locale-archive'.  The locale archive has the benefit of
+taking up less space and being very fast to load, but only if you plan
+to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g. '/usr/lib/locale/en_US.utf8'.  For example to install
+the German locale using the character set for UTF-8 with name 'de_DE'
+into the locale archive issue the command 'localedef -i de_DE -f UTF-8
+de_DE', and to install just the one locale issue the command 'localedef
+--no-archive -i de_DE -f UTF-8 de_DE'.  To configure all locales that
 are supported by the GNU C Library, you can issue from your build
-directory the command 'make localedata/install-locales'.
+directory the command 'make localedata/install-locales' to install all
+locales into the locale archive or 'make
+localedata/install-locale-files' to install all locales as files in the
+default configured locale installation directory (derived from
+'--prefix' or '--localedir').  To install into an alternative system
+root use 'DESTDIR' e.g. 'make localedata/install-locale-files
+DESTDIR=/opt/glibc', but note that this does not change the configured
+prefix.
 
    To configure the locally used timezone, set the 'TZ' environment
 variable.  The script 'tzselect' helps you to select the right value.
diff --git a/NEWS b/NEWS
index b08fee64a6..5032e1a82b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,13 @@ Version 2.28
 
 Major new features:
 
+* A new convenience target has been added for distribution maintainers
+  to build and install all locales as directories with files.  The new
+  target is run by issuing the following command in your build tree:
+  'make localedata/install-locale-files', with an optional DESTDIR
+  to set the install root if you wish to install into a non-default
+  configured location.
+
 * The GNU C Library can now be compiled with support for Intel CET, AKA
   Intel Control-flow Enforcement Technology.  When the library is built
   with --enable-cet, the resulting glibc is protected with indirect
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/manual/install.texi b/manual/install.texi
index a8577dd610..21f882c574 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -462,13 +462,30 @@ permissions on a pseudoterminal so it can be used by the calling process.
 If you are using a Linux kernel with the @code{devpts} filesystem enabled
 and mounted at @file{/dev/pts}, you don't need this program.
 
-After installation you might want to configure the timezone and locale
-installation of your system.  @Theglibc{} comes with a locale
-database which gets configured with @code{localedef}.  For example, to
-set up a German locale with name @code{de_DE}, simply issue the command
-@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
-that are supported by @theglibc{}, you can issue from your build directory the
-command @samp{make localedata/install-locales}.
+After installation you should configure the timezone and install locales
+for your system.  The time zone configuration ensures that your system
+time matches the time for your current timezone.  The locales ensure that
+the display of information on your system matches the expectations of
+your language and geographic region.
+
+@Theglibc{} is able to use two kinds of localization information sources, the
+first is a locale database named @file{locale-archive} which is generally
+installed as @file{/usr/lib/locale/locale-archive}.  The locale archive has the
+benefit of taking up less space and being very fast to load, but only if you
+plan to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.@: @file{/usr/lib/locale/en_US.utf8}.  For example to install
+the German locale using the character set for UTF-8 with name @code{de_DE} into
+the locale archive issue the command @samp{localedef -i de_DE -f UTF-8 de_DE},
+and to install just the one locale issue the command @samp{localedef
+--no-archive -i de_DE -f UTF-8 de_DE}.  To configure all locales that are
+supported by @theglibc{}, you can issue from your build directory the command
+@samp{make localedata/install-locales} to install all locales into the locale
+archive or @samp{make localedata/install-locale-files} to install all locales
+as files in the default configured locale installation directory (derived from
+@samp{--prefix} or @code{--localedir}).  To install into an alternative system
+root use @samp{DESTDIR} e.g.@: @samp{make localedata/install-locale-files
+DESTDIR=/opt/glibc}, but note that this does not change the configured prefix.
 
 To configure the locally used timezone, set the @code{TZ} environment
 variable.  The script @code{tzselect} helps you to select the right value.
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCHv5] Add convenience target 'install-locale-files'.
  2018-07-26 20:30           ` [PATCHv4] " Carlos O'Donell
@ 2018-07-27 20:17             ` Carlos O'Donell
  2018-08-02 19:33               ` Carlos O'Donell
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-27 20:17 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Rical Jasan, GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

On 07/26/2018 04:30 PM, Carlos O'Donell wrote:
> On 07/26/2018 04:25 PM, Joseph Myers wrote:
>> On Thu, 26 Jul 2018, Carlos O'Donell wrote:
>>
>>> +directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install
>>
>> Should have exactly one space after "e.g.", and need @: before that space 
>> for it to be properly treated as not an end-of-sentence space.
>>
>>> +root use @samp{DESTDIR} e.g. @samp{make localedata/install-locale-files
>>
>> Likewise, need @: after e.g. to avoid makeinfo treating it as the end of a 
>> sentence and inserting an extra space in INSTALL there.
>>
> 
> Thanks! I'd forgotten about that.
> 
> v4
> - Fix texinfo formatting.

v5
- Fix commit message to use DESTDIR.

Final version. I'll push this when 2.29 opens if nobody objects.

Cheers,
Carlos.

[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 9729 bytes --]

From 7007b7882df69a3d247ad8af36f805c3e3416ccf Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files DESTDIR=<prefix>
---
 ChangeLog           | 12 ++++++++++++
 INSTALL             | 32 ++++++++++++++++++++++++++------
 NEWS                |  7 +++++++
 localedata/Makefile | 26 ++++++++++++++++++++------
 manual/install.texi | 31 ++++++++++++++++++++++++-------
 5 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..f52bf6a1a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+	* manual/install.texi (Running make install): Document.
+	* manual/INSTALL: Regenerate.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/INSTALL b/INSTALL
index 840b862511..8056a0ac5d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -419,13 +419,33 @@ a pseudoterminal so it can be used by the calling process.  If you are
 using a Linux kernel with the 'devpts' filesystem enabled and mounted at
 '/dev/pts', you don't need this program.
 
-   After installation you might want to configure the timezone and
-locale installation of your system.  The GNU C Library comes with a
-locale database which gets configured with 'localedef'.  For example, to
-set up a German locale with name 'de_DE', simply issue the command
-'localedef -i de_DE -f ISO-8859-1 de_DE'.  To configure all locales that
+   After installation you should configure the timezone and install
+locales for your system.  The time zone configuration ensures that your
+system time matches the time for your current timezone.  The locales
+ensure that the display of information on your system matches the
+expectations of your language and geographic region.
+
+   The GNU C Library is able to use two kinds of localization
+information sources, the first is a locale database named
+'locale-archive' which is generally installed as
+'/usr/lib/locale/locale-archive'.  The locale archive has the benefit of
+taking up less space and being very fast to load, but only if you plan
+to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g. '/usr/lib/locale/en_US.utf8'.  For example to install
+the German locale using the character set for UTF-8 with name 'de_DE'
+into the locale archive issue the command 'localedef -i de_DE -f UTF-8
+de_DE', and to install just the one locale issue the command 'localedef
+--no-archive -i de_DE -f UTF-8 de_DE'.  To configure all locales that
 are supported by the GNU C Library, you can issue from your build
-directory the command 'make localedata/install-locales'.
+directory the command 'make localedata/install-locales' to install all
+locales into the locale archive or 'make
+localedata/install-locale-files' to install all locales as files in the
+default configured locale installation directory (derived from
+'--prefix' or '--localedir').  To install into an alternative system
+root use 'DESTDIR' e.g. 'make localedata/install-locale-files
+DESTDIR=/opt/glibc', but note that this does not change the configured
+prefix.
 
    To configure the locally used timezone, set the 'TZ' environment
 variable.  The script 'tzselect' helps you to select the right value.
diff --git a/NEWS b/NEWS
index b08fee64a6..5032e1a82b 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,13 @@ Version 2.28
 
 Major new features:
 
+* A new convenience target has been added for distribution maintainers
+  to build and install all locales as directories with files.  The new
+  target is run by issuing the following command in your build tree:
+  'make localedata/install-locale-files', with an optional DESTDIR
+  to set the install root if you wish to install into a non-default
+  configured location.
+
 * The GNU C Library can now be compiled with support for Intel CET, AKA
   Intel Control-flow Enforcement Technology.  When the library is built
   with --enable-cet, the resulting glibc is protected with indirect
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/manual/install.texi b/manual/install.texi
index a8577dd610..21f882c574 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -462,13 +462,30 @@ permissions on a pseudoterminal so it can be used by the calling process.
 If you are using a Linux kernel with the @code{devpts} filesystem enabled
 and mounted at @file{/dev/pts}, you don't need this program.
 
-After installation you might want to configure the timezone and locale
-installation of your system.  @Theglibc{} comes with a locale
-database which gets configured with @code{localedef}.  For example, to
-set up a German locale with name @code{de_DE}, simply issue the command
-@samp{localedef -i de_DE -f ISO-8859-1 de_DE}.  To configure all locales
-that are supported by @theglibc{}, you can issue from your build directory the
-command @samp{make localedata/install-locales}.
+After installation you should configure the timezone and install locales
+for your system.  The time zone configuration ensures that your system
+time matches the time for your current timezone.  The locales ensure that
+the display of information on your system matches the expectations of
+your language and geographic region.
+
+@Theglibc{} is able to use two kinds of localization information sources, the
+first is a locale database named @file{locale-archive} which is generally
+installed as @file{/usr/lib/locale/locale-archive}.  The locale archive has the
+benefit of taking up less space and being very fast to load, but only if you
+plan to install sixty or more locales.  If you plan to install one or two
+locales you can instead install individual locales into their self-named
+directories e.g.@: @file{/usr/lib/locale/en_US.utf8}.  For example to install
+the German locale using the character set for UTF-8 with name @code{de_DE} into
+the locale archive issue the command @samp{localedef -i de_DE -f UTF-8 de_DE},
+and to install just the one locale issue the command @samp{localedef
+--no-archive -i de_DE -f UTF-8 de_DE}.  To configure all locales that are
+supported by @theglibc{}, you can issue from your build directory the command
+@samp{make localedata/install-locales} to install all locales into the locale
+archive or @samp{make localedata/install-locale-files} to install all locales
+as files in the default configured locale installation directory (derived from
+@samp{--prefix} or @code{--localedir}).  To install into an alternative system
+root use @samp{DESTDIR} e.g.@: @samp{make localedata/install-locale-files
+DESTDIR=/opt/glibc}, but note that this does not change the configured prefix.
 
 To configure the locally used timezone, set the @code{TZ} environment
 variable.  The script @code{tzselect} helps you to select the right value.
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCHv5] Add convenience target 'install-locale-files'.
  2018-07-27 20:17             ` [PATCHv5] " Carlos O'Donell
@ 2018-08-02 19:33               ` Carlos O'Donell
  0 siblings, 0 replies; 9+ messages in thread
From: Carlos O'Donell @ 2018-08-02 19:33 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Rical Jasan, GNU C Library, Florian Weimer

On 07/27/2018 04:17 PM, Carlos O'Donell wrote:
> On 07/26/2018 04:30 PM, Carlos O'Donell wrote:
>> On 07/26/2018 04:25 PM, Joseph Myers wrote:
>>> On Thu, 26 Jul 2018, Carlos O'Donell wrote:
>>>
>>>> +directories e.g.  @file{/usr/lib/locale/en_US.utf8}.  For example to install
>>>
>>> Should have exactly one space after "e.g.", and need @: before that space 
>>> for it to be properly treated as not an end-of-sentence space.
>>>
>>>> +root use @samp{DESTDIR} e.g. @samp{make localedata/install-locale-files
>>>
>>> Likewise, need @: after e.g. to avoid makeinfo treating it as the end of a 
>>> sentence and inserting an extra space in INSTALL there.
>>>
>>
>> Thanks! I'd forgotten about that.
>>
>> v4
>> - Fix texinfo formatting.
> 
> v5
> - Fix commit message to use DESTDIR.
> 
> Final version. I'll push this when 2.29 opens if nobody objects.

Committed.

-- 
Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-08-02 19:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 17:27 [PATCH] Add convenience target 'install-locale-files' Carlos O'Donell
2018-07-26 17:33 ` Joseph Myers
2018-07-26 18:03   ` [PATCHv2] " Carlos O'Donell
2018-07-26 18:36     ` Rical Jasan
2018-07-26 20:17       ` [PATCHv3] " Carlos O'Donell
2018-07-26 20:25         ` Joseph Myers
2018-07-26 20:30           ` [PATCHv4] " Carlos O'Donell
2018-07-27 20:17             ` [PATCHv5] " Carlos O'Donell
2018-08-02 19:33               ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).