# ---------------------------------------------------------------------- copyright and license --- # # file: rpm/locale-en_ru.spec.in # # Copyright 🄯 2013, 2014, 2016—2021, 2025 Van de Bugger. # # This file is a part of Locale en_RU. # # Locale en_RU 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 of # the License, or (at your option) any later version. # # Locale en_RU 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 Locale en_RU. If # not, see . # # SPDX-License-Identifier: GPL-3.0-or-later # # ---------------------------------------------------------------------- copyright and license --- %global rem() %{nil} # Directories: %global _i18ndir %{_datadir}/i18n %global _charmapsdir %{_i18ndir}/charmaps %global _localesdir %{_i18ndir}/locales # Files: %global _localedef %{_bindir}/localedef %global locale_archive %{_prefix}/lib/locale/locale-archive %global utf8_charmap %{_charmapsdir}/UTF-8.gz # Flags: %global add_flag %{_localstatedir}/lib/rpm-state/%{name}.add.flag %global added_flag %{_localstatedir}/lib/rpm-state/%{name}.added.flag %global install_flag %{_localstatedir}/lib/rpm-state/%{name}.install.flag %global all_flags %{_localstatedir}/lib/rpm-state/%{name}.*.flag # Packages: %global glibc_locale_source glibc-locale-source %{rem: Package containing charmaps/UTF-8.gz.} %global glibc_all_langpacks glibc-all-langpacks %{rem: Package containing locale-archive.} # Commands: %global add_locale %{_localedef} --quiet --replace -c -i %{_localesdir}/en_RU -f UTF-8 en_RU.utf8 %global del_locale %{_localedef} --quiet --delete-from-archive en_RU.utf8 Name: locale-en_ru Version: 0.5.5 Release: 0.vdb.5 Summary: English language for Russia Group: System Environment/Base License: GPLv3+ URL: https://en-ru.sourceforge.io/ Source0: https://sourceforge.net/projects/en-ru/files/0.5.5/%{name}-%{version}.tar.gz BuildArch: noarch # Build requires Perl 5.14: %global perl_version 5.14.0 %if 0%{?fedora} || 0%{?rhel} # Fedora and RHEL use epoch 4: %global perl_version 4:%{perl_version} %endif %if 0%{?suse_version} # OpenSuse does not use epoch in Perl version. %endif BuildRequires: gcc-c++ # There is one test written in C++. BuildRequires: make BuildRequires: %{__make} # BuildRequires: perl >= {perl_version} BuildRequires: %{__perl} BuildRequires: perl(utf8) BuildRequires: perl(open) BuildRequires: %{_localedef} %if 0 BuildRequires: %{_charmapsdir}/UTF-8.gz # F24 moves charmaps from glibc-common to glibc-locale-source. Let us require specific file # instead of package so the requirement can be fulfilled by any version of Fedora. %else BuildRequires: %{glibc_locale_source} # In F41 and some other OSes (e. g. RHEL 10) file dependency doesn't work, since the package # manager does not download file lists by default. %endif Requires: %{_localedef} %if 0 Requires: %{_charmapsdir}/UTF-8.gz # F24 moves charmaps from glibc-common to glibc-locale-source. Let us require specific file # instead of package so the requirement can be fulfilled by any version of Fedora. %else Requires: %{glibc_locale_source} %endif Conflicts: glibc-locale-en_RU = 0.001 Provides: locale-en_RU = %{version}-%{release} Obsoletes: locale-en_RU < %{version}-%{release} %description This is a glibc locale, namely, English language locale for Russia. It consistently sticks to English language, but makes other parameters more suitable for Russians, e. g.: * Ridiculous 12-hour clock is replaced with 24-hour clock. * Long date format is changed from confusing mm/dd/yyyy to unambiguous ISO yyyy-mm-dd. * Weeks start on Monday, not Sunday. * Thousand separator set to narrow non-breaking space. Decimal mark is dot, not comma -- it is an English variant of SI style. * Imperial units replaced with metric units. * Default paper sheet size is A4. * Territory is changed to Russia: country name, country phone code, currency name, etc. %global debug() if [[ -n "$LOCALE_EN_RU_DEBUG" ]]; then echo "--- %* ---"; set -x; fi %prep %setup -q %{__mkdir} _build cd _build %{__ln_s} ../con'fig'ure . # rpmlint thinks it is a configure call and warns "lib dir is not specified". %build cd _build export PERL=%{__perl} export LOCALEDEF=%{_localedef} %{configure} --disable-rpm --disable-html --srcdir=.. %{make_build} %install cd _build %{make_install} %check cd _build %{__make} %{_make_verbose} check # # The sriptlets are listed in order of execution. # # Bebore installing the package. %pre %debug pre-in touch %{install_flag} %{rem: Let the other scriptlets know this transaction installs (or updates) the locale. } # After installing the package. %post %debug post-in touch %{add_flag} %{rem: I cannot add a new locale now, because the preun scriplet of the obsoleted package locale-en_RU will run later and remove the added locale. Instead, let's create a flag that the posttrans scriptlet (which runs later) of this package need to build the locale. } # Before uninstalling the package. %preun %debug pre-un %{rem: Remove the locale only if we are deleting the last package. In case of upgrade deleting is not required, since the locale will be rewritten by the new package. } if [[ "$1" -eq 0 ]]; then %{del_locale} fi # A third-party package (glibc-all-langpacks) installed the locale archive file. %filetriggerin -- %{locale_archive} %{utf8_charmap} %debug file-trigger-in %{locale_archive} %{utf8_charmap} %{rem: The locale archive is updating. The locale must be re-added, but only if the transaction does not installs/updates the locale itself, otherwise the locale will be added twice. It doesn't hurt, but there's no point in doing the extra work. If UTF-8 charmap is updating, re-compile the locale as well to incorporate the new charmap. } if [[ -e %{install_flag} ]]; then : # This transaction installs/updates locale-en_ru, so the locale archive will be updated by # post-trans scriplet. else %{add_locale} touch --reference=%{locale_archive} %{added_flag} fi %triggerin -- %{glibc_all_langpacks} %{glibc_locale_source} %debug trigger-in %{glibc_all_langpacks} %{glibc_locale_source} if [[ -e %{install_flag} ]]; then : # This transaction installs/updates locale-en_ru, so the locale archive will be updated by # post-trans scriplet. else if [[ %{locale_archive} -nt %{added_flag} ]]; then %{add_locale} fi %{__rm} %{added_flag} fi # One or more third-party packages are installing the locale archive file. %transfiletriggerin -- %{locale_archive} %debug trans-file-trigger-in %{locale_archive} %{rem: In theory, the filetriggerin scriplet will be called for each third-party package installing the locale archive file, while this scriptlet will be called only once. However, I have never seen this scriptled executed. Also, the locale archive file is installed only by one package, glibc-all-langpacks, so in practice there is no difference between the filetriggerin and transfiletriggerin scriplets. } %transtriggerin -- %{glibc_all_langpacks} %debug trans-trigger-in %{glibc_all_langpacks} # At the end of the rpm transaction. %posttrans %debug post-trans %{rem: Post-trans is executed only if the transaction includes installing or uninstalling this package. In case of updating glibc, post-trans will *not* be called! } if [[ -e %{add_flag} ]]; then %{add_locale} fi %{__rm} -f %{all_flags} %files %defattr( -, root, root, - ) %{_localesdir}/en_RU %doc %dir %{_docdir}/%{name} %doc %{_docdir}/%{name}/* %changelog * Sun Apr 13 2025 Van de Bugger - 0.5.5-0.vdb.5 - Code for unsupported Fedora releases dropped. - Locale en_RU didn't survive glibc update, fixed. - Rebuilt for F41. * Mon Aug 9 2021 Van de Bugger - 0.5.5-0.vdb.4 - Rebuilt for F34. * Wed Oct 28 2020 Van de Bugger - 0.5.5-0.vdb.3 - Rebuilt for F33. * Wed May 06 2020 Van de Bugger - 0.5.5-0.vdb.2 - Rebuilt for F32. * Sun Feb 02 2020 Van de Bugger - 0.5.5-0.vdb.1 - Updated to v0.5.5. - Locale din't survive glibc update in F31. Fixed again. * Tue Nov 26 2019 Van de Bugger - 0.5.4-0.vdb.3 - Locale din't survive glibc update in F31. Fixed. * Sat Nov 02 2019 Van de Bugger - 0.5.4-0.vdb.2 - Spec fixed to enable OpenSuse and Mageia builds. - Rebuild for F31. * Wed Mar 27 2019 Van de Bugger - 0.5.4-0.1 - Updated to v0.5.4. * Thu Nov 01 2018 Van de Bugger - 0.5.3-2 - locale-en_RU survives updating the glic-all-langpacks. * Wed Oct 31 2018 Van de Bugger - 0.5.3-1 - Updated to v0.5.3. - make_build and make_install macros used. * Mon Apr 10 2017 Van de Bugger - 0.5.2-1 - Updated to v0.5.2. - Source0 tag specified properly. * Wed Aug 03 2016 Van de Bugger - 0.5.1-3 - BuildRequires tag was accidentally used instead of Requires tag. Fixed. * Mon Jun 27 2016 Van de Bugger - 0.5.1-2 - F24 moves charmaps from glibc-common to glibc-locale-source. Fix to work in F24. - _bindir macro used few times. * Fri Feb 19 2016 Van de Bugger - 0.5.1-1 - Build requires make and /usr/bin/make. - Build requires perl modules: perl(open), perl(utf8), not perl-open package. - Build requires glibc-common and /usr/bin/localedef. - Since we explicitly require /usr/bin/perl and /usr/bin/localedef, they are passed to configure. * Sun Feb 14 2016 Van de Bugger - 0.5-1 - Locale updated to v0.5. - perl-open was a missed build requirement, added now. - Test result is not ignored now. * Wed Nov 12 2014 Van de Bugger - 0.4.3-1 - HTML documentation bug fixing and improvements. - Many changes in build and test infrastructure, not visible to end users. * Tue Nov 4 2014 Van de Bugger - 0.4-1 - Locale updated to v0.4. - Documentation is installed to unversioned directory, like other Fedora 20 packages. * Sun Oct 27 2013 Van de Bugger - 0.3-1 - Locale updated to v0.3. - Fixed bug in spec file which prevents upgrade. - This package conflicts with glibc-locale-en_RU-0.001 to avoid the bug described above. - Documentation added. * Sat Oct 5 2013 Van de Bugger - 0.2-1 - Project renamed from "glibc-locale-en_RU" to "locale-en_RU". * Thu Mar 14 2013 Van de Bugger - 0.1-1 - Initial release. # end of file #