!8 upgrade to version 0.0.51

Merge pull request !8 from zhangqiumiao/master
This commit is contained in:
openeuler-ci-bot 2020-06-29 11:09:43 +08:00 committed by Gitee
commit 53334573fa
4 changed files with 25 additions and 30614 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
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,8 @@ 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
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,32 +22,14 @@ 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
@ -69,60 +46,41 @@ This package contains the data files for langtable.
%prep %prep
%setup -q %setup -q
%patch9000 -p1
%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
# 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
* 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