upgrade to version 0.0.51

This commit is contained in:
zhangqiumiao 2020-06-18 17:27:53 +08:00
parent de54b667b8
commit 20c4cd4d39
4 changed files with 39989 additions and 29192 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

BIN
langtable-0.0.51.tar.gz Normal file

Binary file not shown.

View File

@ -1,9 +1,8 @@
# 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.38 Version: 0.0.51
Release: 9 Release: 1%{?dist}
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
# the translations in languages.xml and territories.xml are (mostly) # the translations in languages.xml and territories.xml are (mostly)
@ -12,12 +11,9 @@ 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
Patch9000: 0001-langtable-add-Beijing-timezone-and-delete-others-lan.patch Patch9000: 0001-langtable-add-Beijing-timezone-and-delete-others-lan.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
@ -27,22 +23,6 @@ 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
@ -69,60 +49,45 @@ This package contains the data files for langtable.
%prep %prep
%setup -q %setup -q
gzip -d langtable/data/*.xml.gz
%patch9000 -p1 %patch9000 -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}
%py2_install -- --install-data=%{_datadir}/langtable
gzip --force --best $RPM_BUILD_ROOT/%{_datadir}/langtable/*.xml
%endif
%py3_install -- --install-data=%{_datadir}/langtable %py3_install -- --install-data=%{_datadir}/langtable
# the .xml files copied by the “python3 setup.py install” are identical # the .xml files copied by the “python3 setup.py install” are identical
# to those copied in the “python2 setup.py install”, # to those copied in the “python2 setup.py install”,
# it does not hurt to gzip them again: # 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; LC_CTYPE=en_US.UTF-8 PYTHONPATH=.. %{__python3} ../test_cases.py; %{__python3} langtable.py)
(cd $RPM_BUILD_DIR/%{name}-%{version}/data; PYTHONPATH=.. %{__python2} ../test_cases.py; %{__python2} ../langtable.py) xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/keyboards.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/data/keyboards.xml.gz
%endif xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/languages.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/data/languages.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_ROOT/%{_datadir}/langtable/schemas/territories.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/data/territories.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_ROOT/%{_datadir}/langtable/schemas/timezoneidparts.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/data/timezoneidparts.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_ROOT/%{_datadir}/langtable/schemas/timezones.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/data/timezones.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_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
* Tue Jun 16 2020 zhangqiumiao <zhangqiumiao1@huawei.com> - 0.0.51-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:upgrade to version 0.0.51
* Tue May 19 2020 songzhenyu <songzhenyu@huawei.com> - 0.0.38-9 * Tue May 19 2020 songzhenyu <songzhenyu@huawei.com> - 0.0.38-9
- modify release - modify release