Drop Python 2 subpackage. Resolves: rhbz#1559099
This commit is contained in:
parent
497fa253b9
commit
e5b5ea302e
@ -1,9 +1,3 @@
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||
%global with_python3 1
|
||||
%else
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
||||
%endif
|
||||
|
||||
Name: langtable
|
||||
Version: 0.0.38
|
||||
Release: 3%{?dist}
|
||||
@ -18,10 +12,7 @@ URL: https://github.com/mike-fabian/langtable
|
||||
Source0: https://github.com/mike-fabian/langtable/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: python2-devel
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%endif # if with_python3
|
||||
|
||||
%description
|
||||
langtable is used to guess reasonable defaults for locale, keyboard layout,
|
||||
@ -30,22 +21,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
|
||||
already known.
|
||||
|
||||
%package -n python2-langtable
|
||||
%{?python_provide:%python_provide python2-langtable}
|
||||
# Remove before F30
|
||||
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.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package python3
|
||||
Summary: Python module to query the langtable-data
|
||||
Group: Development/Tools
|
||||
@ -57,8 +32,6 @@ Requires: %{name}-data = %{version}-%{release}
|
||||
This package contains a Python module to query the data
|
||||
from langtable-data.
|
||||
|
||||
%endif # with_python3
|
||||
|
||||
%package data
|
||||
Summary: Data files for langtable
|
||||
Group: Development/Tools
|
||||
@ -73,29 +46,15 @@ This package contains the data files for langtable.
|
||||
|
||||
%build
|
||||
perl -pi -e "s,_datadir = '(.*)',_datadir = '%{_datadir}/langtable'," langtable.py
|
||||
%py2_build
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%py3_build
|
||||
%endif # with_python3
|
||||
|
||||
%install
|
||||
%py2_install -- --install-data=%{_datadir}/langtable
|
||||
gzip --force --best $RPM_BUILD_ROOT/%{_datadir}/langtable/*.xml
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%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
|
||||
%endif # with_python3
|
||||
|
||||
%check
|
||||
(cd $RPM_BUILD_DIR/%{name}-%{version}/data; PYTHONPATH=.. %{__python2} ../test_cases.py; %{__python2} ../langtable.py)
|
||||
%if 0%{?with_python3}
|
||||
(cd $RPM_BUILD_DIR/%{name}-%{version}/data; LC_CTYPE=en_US.UTF-8 PYTHONPATH=.. %{__python3} ../test_cases.py; %{__python3} ../langtable.py)
|
||||
%endif # with_python3
|
||||
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/languages.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/languages.xml.gz
|
||||
xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/territories.rng $RPM_BUILD_ROOT/%{_datadir}/langtable/territories.xml.gz
|
||||
@ -108,21 +67,20 @@ xmllint --noout --relaxng $RPM_BUILD_ROOT/%{_datadir}/langtable/schemas/timezone
|
||||
%dir %{_datadir}/langtable/
|
||||
%{_datadir}/langtable/schemas
|
||||
|
||||
%files -n python2-langtable
|
||||
%{python_sitelib}/*
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files python3
|
||||
%{python3_sitelib}/langtable.py
|
||||
%{python3_sitelib}/langtable-*.egg-info
|
||||
%{python3_sitelib}/__pycache__/*
|
||||
%endif # with_python3
|
||||
|
||||
%files data
|
||||
%dir %{_datadir}/langtable/
|
||||
%{_datadir}/langtable/*.xml.gz
|
||||
|
||||
%changelog
|
||||
* Wed Apr 04 2018 Mike FABIAN <mfabian@redhat.com> - 0.0.38-4
|
||||
- Drop Python 2 subpackage
|
||||
- Resolves: rhbz#1559099
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.38-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user