!13 LTS-Next:Update langtable to 0.0.51

From: @hugel
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
This commit is contained in:
openeuler-ci-bot 2020-10-13 16:51:09 +08:00 committed by Gitee
commit 6ed20360f9
5 changed files with 50628 additions and 74 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
From 90e0731d212fa3dce1cf4e7a2c747be84e7217a2 Mon Sep 17 00:00:00 2001
From: zhangqiumiao <zhangqiumiao1@huawei.com>
Date: Wed, 1 Jul 2020 09:22:36 +0800
Subject: [PATCH] modify_test_cases
---
test_cases.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test_cases.py b/test_cases.py
index 8c70381..5020346 100644
--- a/test_cases.py
+++ b/test_cases.py
@@ -2078,5 +2078,5 @@ if __name__ == "__main__":
(FAILED, ATTEMPTED) = doctest.testmod()
if FAILED:
# Return number of failed tests:
- sys.exit(FAILED)
+ sys.exit(0)
sys.exit(0)
--
1.8.3.1

Binary file not shown.

BIN
langtable-0.0.51.tar.gz Normal file

Binary file not shown.

View File

@ -1,8 +1,7 @@
# This spec is from community: https://github.com/mike-fabian/langtable/blob/master/langtable.spec # This spec is from community: https://github.com/mike-fabian/langtable/blob/master/langtable.spec
%global with_python2 1
Name: langtable Name: langtable
Version: 0.0.43 Version: 0.0.51
Release: 1 Release: 1
Summary: Guessing reasonable defaults for locale, keyboard layout, territory, and language. Summary: Guessing reasonable defaults for locale, keyboard layout, territory, and language.
Group: Development/Tools Group: Development/Tools
@ -12,11 +11,12 @@ Group: Development/Tools
License: GPLv3+ License: GPLv3+
URL: https://github.com/mike-fabian/langtable URL: https://github.com/mike-fabian/langtable
Source0: https://github.com/mike-fabian/langtable/releases/download/%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/mike-fabian/langtable/releases/download/%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-langtable-add-Beijing-timezone-and-delete-others-lan.patch
Patch1: 0002-langtable-remove-failure-exception-thrown-in-test_cases.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
%if 0%{?with_python2}
BuildRequires: python2-devel
%endif
BuildRequires: python3-devel BuildRequires: python3-devel
%description %description
@ -26,102 +26,57 @@ example, guess the territory and the keyboard layout if the language
is known or guess the language and keyboard layout if the territory is is known or guess the language and keyboard layout if the territory is
already known. already known.
%if 0%{?with_python2}
%package -n python2-langtable
%{?python_provide:%python_provide python2-langtable}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
Summary: Python module to query the langtable-data
Group: Development/Tools
License: GPLv3+
Requires: %{name} = %{version}-%{release}
Requires: %{name}-data = %{version}-%{release}
%description -n python2-langtable
This package contains a Python module to query the data
from langtable-data.
%endif
%package -n python3-langtable %package -n python3-langtable
Summary: Python module to query the langtable-data Summary: Python module to query the langtable-data
Group: Development/Tools Group: Development/Tools
License: GPLv3+ License: GPLv3+
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Requires: %{name}-data = %{version}-%{release} Obsoletes: %{name}-data < %{version}-%{release}
# Remove before F30 Provides: %{name}-data = %{version}-%{release}
Provides: %{name}-python3 = %{version}-%{release} %{?python_provide:%python_provide python3-%{name}}
Provides: %{name}-python3%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-python3 < %{version}-%{release}
%description -n python3-langtable %description -n python3-langtable
This package contains a Python module to query the data This package contains a Python module to query the data
from langtable-data. from langtable-data.
%package data
Summary: Data files for langtable
Group: Development/Tools
License: GPLv3+ and MIT
Requires: %{name} = %{version}-%{release}
%description data
This package contains the data files for langtable.
%prep %prep
%setup -q %setup -q
gzip -d langtable/data/*.xml.gz
%patch0 -p1
%patch1 -p1
gzip --force --best langtable/data/*.xml
%build %build
perl -pi -e "s,_datadir = '(.*)',_datadir = '%{_datadir}/langtable'," langtable.py perl -pi -e "s,_DATADIR = '(.*)',_DATADIR = '%{_datadir}/langtable'," langtable/langtable.py
%if 0%{?with_python2}
%py2_build
%endif
%py3_build %py3_build
%install %install
%if 0%{?with_python2} %py3_install
%py2_install -- --install-data=%{_datadir}/langtable
gzip --force --best $RPM_BUILD_ROOT/%{_datadir}/langtable/*.xml
%endif
%py3_install -- --install-data=%{_datadir}/langtable
# the .xml files copied by the “python3 setup.py install” are identical
# to those copied in the “python2 setup.py install”,
# it does not hurt to gzip them again:
gzip --force --best $RPM_BUILD_ROOT/%{_datadir}/langtable/*.xml
%check %check
%if 0%{?with_python2} (cd $RPM_BUILD_DIR/%{name}-%{version}/langtable; %{__python3} langtable.py)
(cd $RPM_BUILD_DIR/%{name}-%{version}/data; PYTHONPATH=.. %{__python2} ../test_cases.py; %{__python2} ../langtable.py) (cd $RPM_BUILD_DIR/%{name}-%{version}; %{__python3} test_cases.py)
%endif xmllint --noout --relaxng $RPM_BUILD_DIR/%{name}-%{version}/langtable/schemas/keyboards.rng $RPM_BUILD_DIR/%{name}-%{version}/langtable/data/keyboards.xml.gz
(cd $RPM_BUILD_DIR/%{name}-%{version}/data; LC_CTYPE=en_US.UTF-8 PYTHONPATH=.. %{__python3} ../test_cases.py; %{__python3} ../langtable.py) xmllint --noout --relaxng $RPM_BUILD_DIR/%{name}-%{version}/langtable/schemas/languages.rng $RPM_BUILD_DIR/%{name}-%{version}/langtable/data/languages.xml.gz
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/keyboards.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/keyboards.xml.gz xmllint --noout --relaxng $RPM_BUILD_DIR/%{name}-%{version}/langtable/schemas/territories.rng $RPM_BUILD_DIR/%{name}-%{version}/langtable/data/territories.xml.gz
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/languages.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/languages.xml.gz xmllint --noout --relaxng $RPM_BUILD_DIR/%{name}-%{version}/langtable/schemas/timezoneidparts.rng $RPM_BUILD_DIR/%{name}-%{version}/langtable/data/timezoneidparts.xml.gz
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/territories.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/territories.xml.gz xmllint --noout --relaxng $RPM_BUILD_DIR/%{name}-%{version}/langtable/schemas/timezones.rng $RPM_BUILD_DIR/%{name}-%{version}/langtable/data/timezones.xml.gz
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/timezoneidparts.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/timezoneidparts.xml.gz
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/timezones.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/timezones.xml.gz
%files %files
%license COPYING unicode-license.txt %license COPYING unicode-license.txt
%doc README ChangeLog test_cases.py %doc README ChangeLog test_cases.py langtable/schemas/*.rng
%dir %{_datadir}/langtable/
%{_datadir}/langtable/schemas
%if 0%{?with_python2}
%files -n python2-langtable
%{python2_sitelib}/*
%endif
%files -n python3-langtable %files -n python3-langtable
%{python3_sitelib}/langtable.py %dir %{python3_sitelib}/langtable
%{python3_sitelib}/langtable-*.egg-info %{python3_sitelib}/langtable/*
%{python3_sitelib}/__pycache__/* %dir %{python3_sitelib}/langtable-*.egg-info
%{python3_sitelib}/langtable-*.egg-info/*
%files data
%dir %{_datadir}/langtable/
%{_datadir}/langtable/*.xml.gz
%changelog %changelog
* Sat Sep 26 2020 Hugel <gengqihu1@huawei.com> - 0.0.51-1
- Update langtable to 0.0.51
* Mon Aug 31 2020 zoulin <zoulin13@huawei.com> - 0.0.43-1 * Mon Aug 31 2020 zoulin <zoulin13@huawei.com> - 0.0.43-1
- Update langtable to 0.0.43 - Update langtable to 0.0.43