2019-11-07 17:21:11 +00:00
|
|
|
#
|
2024-02-08 21:52:49 +00:00
|
|
|
# spec file for package python-langtable
|
2019-11-07 17:21:11 +00:00
|
|
|
#
|
2024-02-08 21:52:49 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-11-07 17:21:11 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-05-25 11:05:34 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "data"
|
2023-05-25 11:10:23 +00:00
|
|
|
%define psuffix -data-src
|
2023-05-25 11:05:34 +00:00
|
|
|
%bcond_without data
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with data
|
|
|
|
%endif
|
2019-11-07 17:21:11 +00:00
|
|
|
%define skip_python2 1
|
2023-05-26 05:55:27 +00:00
|
|
|
%global literalpython python
|
2023-05-25 11:06:23 +00:00
|
|
|
Name: python-langtable%{psuffix}
|
2024-06-04 21:03:30 +00:00
|
|
|
Version: 0.0.66
|
2019-11-07 17:21:11 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Database to guess defaults for locale settings
|
|
|
|
# the translations in languages.xml and territories.xml are (mostly)
|
|
|
|
# imported from CLDR and are thus under the Unicode license, the
|
|
|
|
# short name for this license is "MIT", see:
|
|
|
|
# https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT#Modern_Style_without_sublicense_.28Unicode.29
|
2020-04-15 11:01:14 +00:00
|
|
|
License: GPL-3.0-or-later
|
2019-11-07 17:21:11 +00:00
|
|
|
Group: System/Localization
|
|
|
|
URL: https://github.com/mike-fabian/langtable
|
|
|
|
Source0: https://github.com/mike-fabian/langtable/releases/download/%{version}/langtable-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: %{pythons}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: libxml2-tools
|
2022-01-11 21:08:07 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2023-05-25 11:05:34 +00:00
|
|
|
%if %{without data}
|
2023-05-26 05:55:27 +00:00
|
|
|
Requires: %{literalpython}-langtable-data = %{version}
|
2023-05-25 11:05:34 +00:00
|
|
|
%endif
|
2019-11-07 17:21:11 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
langtable is used to guess reasonable defaults for locale, keyboard layout,
|
|
|
|
territory, and language, if part of that information is already known. For
|
|
|
|
example, guess the territory and the keyboard layout if the language
|
|
|
|
is known or guess the language and keyboard layout if the territory is
|
|
|
|
already known.
|
|
|
|
|
2023-05-04 12:54:25 +00:00
|
|
|
%package -n python-langtable-data
|
|
|
|
Summary: XML data to map various locale settingsn and its relations
|
|
|
|
|
|
|
|
%description -n python-langtable-data
|
|
|
|
Provides XML data used by python-langtable. Packaged separately so it is not affected
|
|
|
|
by more python target versions and also it can be used indenpendently.
|
|
|
|
|
2019-11-07 17:21:11 +00:00
|
|
|
%prep
|
|
|
|
%autosetup -n langtable-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
2023-05-25 11:05:34 +00:00
|
|
|
|
|
|
|
%if %{with data}
|
|
|
|
# Data package
|
|
|
|
mkdir -p %{buildroot}/%{_datadir}/langtable/data
|
|
|
|
mv langtable/data/* %{buildroot}/%{_datadir}/langtable/data
|
|
|
|
%else
|
|
|
|
# Main package
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%python_expand rm -rf %{buildroot}%{$python_sitelib}/langtable/data
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Main package
|
|
|
|
%if %{without data}
|
2019-11-07 17:21:11 +00:00
|
|
|
|
|
|
|
%check
|
|
|
|
(cd langtable; python3 langtable.py)
|
|
|
|
python3 test_cases.py
|
|
|
|
for i in keyboards languages territories timezoneidparts timezones; do
|
|
|
|
xmllint --noout --relaxng \
|
|
|
|
langtable/schemas/$i.rng \
|
|
|
|
langtable/data/$i.xml.gz
|
|
|
|
done
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
%license COPYING unicode-license.txt
|
|
|
|
%doc README ChangeLog
|
|
|
|
%{python_sitelib}/*
|
|
|
|
|
2023-05-25 11:05:34 +00:00
|
|
|
%else
|
2023-05-25 11:06:23 +00:00
|
|
|
# Data package
|
2023-05-25 11:05:34 +00:00
|
|
|
|
2023-05-04 12:54:25 +00:00
|
|
|
%files -n python-langtable-data
|
|
|
|
%{_datadir}/langtable
|
2023-05-25 11:05:34 +00:00
|
|
|
%endif
|
2023-05-04 12:54:25 +00:00
|
|
|
|
2019-11-07 17:21:11 +00:00
|
|
|
%changelog
|