Prepare bcond for Python 2 removal
This commit is contained in:
parent
225e9ffad1
commit
8e645873fd
22
pytz.spec
22
pytz.spec
@ -1,3 +1,9 @@
|
|||||||
|
# Prepared for Python 2 removal
|
||||||
|
%bcond_without python2
|
||||||
|
|
||||||
|
# Allow build without test
|
||||||
|
%bcond_without tests
|
||||||
|
|
||||||
Name: pytz
|
Name: pytz
|
||||||
Version: 2019.3
|
Version: 2019.3
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
@ -25,24 +31,30 @@ Almost all (over 540) of the Olson timezones are supported.
|
|||||||
%description %_description
|
%description %_description
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-%{name}
|
%package -n python2-%{name}
|
||||||
Summary: %summary
|
Summary: %summary
|
||||||
%{?python_provide:%python_provide python2-%{name}}
|
%{?python_provide:%python_provide python2-%{name}}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
|
%if %{with tests}
|
||||||
BuildRequires: python2-pytest
|
BuildRequires: python2-pytest
|
||||||
|
%endif
|
||||||
Requires: tzdata
|
Requires: tzdata
|
||||||
# Remove before F30
|
# Remove before F30
|
||||||
Provides: pytz = %{version}-%{release}
|
Provides: pytz = %{version}-%{release}
|
||||||
Obsoletes: pytz < %{version}-%{release}
|
Obsoletes: pytz < %{version}-%{release}
|
||||||
|
|
||||||
%description -n python2-%{name} %_description
|
%description -n python2-%{name} %_description
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%package -n python3-%{name}
|
%package -n python3-%{name}
|
||||||
Summary: %summary
|
Summary: %summary
|
||||||
%{?python_provide:%python_provide python3-%{name}}
|
%{?python_provide:%python_provide python3-%{name}}
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
%if %{with tests}
|
||||||
BuildRequires: python3-pytest
|
BuildRequires: python3-pytest
|
||||||
|
%endif
|
||||||
Requires: tzdata
|
Requires: tzdata
|
||||||
|
|
||||||
%description -n python3-%{name} %_description
|
%description -n python3-%{name} %_description
|
||||||
@ -53,14 +65,18 @@ Requires: tzdata
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
%py2_build
|
%py2_build
|
||||||
|
%endif
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with python2}
|
||||||
%py2_install
|
%py2_install
|
||||||
rm -r %{buildroot}%{python2_sitelib}/pytz/zoneinfo
|
rm -r %{buildroot}%{python2_sitelib}/pytz/zoneinfo
|
||||||
pathfix.py -pn -i %{__python2} %{buildroot}%{python2_sitelib}
|
pathfix.py -pn -i %{__python2} %{buildroot}%{python2_sitelib}
|
||||||
|
%endif
|
||||||
|
|
||||||
%py3_install
|
%py3_install
|
||||||
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
|
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
|
||||||
@ -68,15 +84,21 @@ pathfix.py -pn -i %{__python3} %{buildroot}%{python3_sitelib}
|
|||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if %{with tests}
|
||||||
|
%if %{with python2}
|
||||||
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m pytest -v
|
PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} -m pytest -v
|
||||||
|
%endif
|
||||||
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
|
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-%{name}
|
%files -n python2-%{name}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.txt
|
%doc README.txt
|
||||||
%{python2_sitelib}/pytz/
|
%{python2_sitelib}/pytz/
|
||||||
%{python2_sitelib}/*.egg-info
|
%{python2_sitelib}/*.egg-info
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n python3-pytz
|
%files -n python3-pytz
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user