From patchwork Thu Jul 26 20:17:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 28637 Received: (qmail 128267 invoked by alias); 26 Jul 2018 20:17:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 128254 invoked by uid 89); 26 Jul 2018 20:17:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=HX-Gm-Message-State:AOUpUlH X-HELO: mail-qk0-f196.google.com Return-Path: Subject: [PATCHv3] Add convenience target 'install-locale-files'. To: Rical Jasan , Joseph Myers Cc: GNU C Library , Florian Weimer References: <7b4c3d0d-3fa1-3302-5e09-84326cb279d1@redhat.com> <3d01061c-9323-09ab-8571-75900dabd397@redhat.com> From: Carlos O'Donell Message-ID: <7e678d8f-0b90-475a-feec-7e0d54127f62@redhat.com> Date: Thu, 26 Jul 2018 16:17:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: 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= 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. From b46aeeae17bb45753c36767f7d8ac7b95ae33dfa Mon Sep 17 00:00:00 2001 From: Carlos O'Donell 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= --- 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 + + * 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 [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