Drop python2 subpackage

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-08-12 17:00:15 +02:00
parent 06c9153c98
commit 9e4dd3841e
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

View File

@ -1,99 +1,69 @@
%global modname appdirs %global srcname appdirs
%global build_wheel 1 %bcond_without wheel
%global wheelname %{srcname}-%{version}-py2.py3-none-any.whl
%global python2_wheelname %{modname}-%{version}-py2.py3-none-any.whl Name: python-%{srcname}
%global python3_wheelname %python2_wheelname
Name: python-%{modname}
Version: 1.4.3 Version: 1.4.3
Release: 5%{?dist} Release: 6%{?dist}
Summary: Python module for determining platform-specific directories Summary: Python module for determining platform-specific directories
License: MIT License: MIT
URL: https://github.com/ActiveState/appdirs URL: https://github.com/ActiveState/appdirs
Source0: https://files.pythonhosted.org/packages/source/a/%{modname}/%{modname}-%{version}.tar.gz Source0: %{pypi_source}
BuildArch: noarch BuildArch: noarch
%description %description
A small Python module for determining appropriate " + " platform-specific A small Python module for determining appropriate " + " platform-specific
directories, e.g. a "user data dir". directories, e.g. a "user data dir".
%package -n python2-%{modname} %package -n python3-%{srcname}
Summary: Python 2 module for determining platform-specific directoriess Summary: %{summary}
%{?python_provide:%python_provide python2-%{modname}} %{?python_provide:%python_provide python3-%{srcname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%if 0%{?build_wheel}
BuildRequires: python2-pip
BuildRequires: python2-wheel
%endif
%description -n python2-%{modname}
A small Python 2 module for determining appropriate " + " platform-specific
directories, e.g. a "user data dir".
%package -n python3-%{modname}
Summary: Python 3 module for determining platform-specific directoriess
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%if 0%{?build_wheel} %if %{with wheel}
BuildRequires: python3-pip BuildRequires: python3-pip
BuildRequires: python3-wheel BuildRequires: python3-wheel
%endif %endif
%description -n python3-%{modname} %description -n python3-%{srcname}
A small Python 3 module for determining appropriate " + " platform-specific A small Python 3 module for determining appropriate " + " platform-specific
directories, e.g. a "user data dir". directories, e.g. a "user data dir".
%prep %prep
%autosetup -n %{modname}-%{version} %autosetup -n %{srcname}-%{version}
rm -rf %{modname}.egg-info rm -vrf %{srcname}.egg-info
%build %build
%if 0%{?build_wheel} %if %{with wheel}
%py2_build_wheel %py3_build_wheel
%else %else
%py2_build %py3_build
%endif
%if 0%{?build_wheel}
%py3_build_wheel
%else
%py3_build
%endif %endif
%install %install
%if 0%{?build_wheel} %if %{with wheel}
%py2_install_wheel %{python2_wheelname} %py3_install_wheel %{wheelname}
%else %else
%py2_install %py3_install
%endif
%if 0%{?build_wheel}
%py3_install_wheel %{python3_wheelname}
%else
%py3_install
%endif %endif
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python2_sitelib}/%{modname}.py sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/%{srcname}.py
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/%{modname}.py
%check %check
%{__python2} setup.py test
%{__python3} setup.py test %{__python3} setup.py test
%files -n python2-%{modname} %files -n python3-%{srcname}
%license LICENSE.txt %license LICENSE.txt
%doc README.rst CHANGES.rst %doc README.rst CHANGES.rst
%{python2_sitelib}/%{modname}* %{python3_sitelib}/%{srcname}*
%{python3_sitelib}/__pycache__/%{srcname}.*
%files -n python3-%{modname}
%license LICENSE.txt
%doc README.rst CHANGES.rst
%{python3_sitelib}/%{modname}*
%{python3_sitelib}/__pycache__/%{modname}.*
%changelog %changelog
* Sun Aug 12 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.4.3-6
- Drop python2 subpackage
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.3-5 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild