diff --git a/python-editor.spec b/python-editor.spec index b8579ff..0c7ce2a 100644 --- a/python-editor.spec +++ b/python-editor.spec @@ -1,14 +1,10 @@ %global pypi_name python-editor -%if 0%{?fedora} || 0%{?rhel} >= 8 -%global with_python3 1 -%endif - %{!?upstream_version: %global upstream_version %{version}%{?milestone}} Name: python-editor Version: 1.0.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Programmatically open an editor, capture the result License: ASL 2.0 @@ -19,19 +15,6 @@ BuildArch: noarch %description Programmatically open an editor, capture the result. -%package -n python2-editor -Summary: Programmatically open an editor, capture the result. -%{?python_provide:%python_provide python2-editor} -# python_provide does not exist in CBS Cloud buildroot -Provides: python-editor = %{upstream_version} - -BuildRequires: python2-devel -BuildRequires: python2-setuptools - -%description -n python2-editor -Programmatically open an editor, capture the result. - -%if 0%{?with_python3} %package -n python3-editor Summary: Programmatically open an editor, capture the result. %{?python_provide:%python_provide python3-editor} @@ -41,55 +24,33 @@ BuildRequires: python3-setuptools %description -n python3-editor Programmatically open an editor, capture the result. -%endif %prep %setup -q -n %{pypi_name}-%{upstream_version} rm -rf %{pypi_name}.egg-info # Change shebang according to Python version -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' %{py3dir}/editor.py -%endif -sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python2}=' editor.py +sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' editor.py %build -%{__python2} setup.py build -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif +%py3_build %install -%{__python2} setup.py install --skip-build --root=$RPM_BUILD_ROOT -chmod a+x $RPM_BUILD_ROOT%{python2_sitelib}/editor.py - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root=$RPM_BUILD_ROOT +%py3_install chmod a+x $RPM_BUILD_ROOT%{python3_sitelib}/editor.py -popd -%endif -%files -n python2-editor -%doc README.md -%license LICENSE -%{python2_sitelib}/editor.py* -%{python2_sitelib}/python_editor-%{version}-py?.?.egg-info - -%if 0%{?with_python3} %files -n python3-editor %doc README.md %license LICENSE -%{python3_sitelib}/*.egg-info +%{python3_sitelib}/*.egg-info/ %{python3_sitelib}/editor.py* %{python3_sitelib}/__pycache__/* -%endif %changelog +* Wed Sep 25 2019 Miro Hrončok - 1.0.4-4 +- Subpackage python2-editor has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + * Fri Aug 16 2019 Miro Hrončok - 1.0.4-3 - Rebuilt for Python 3.8