%global pypi_name python-editor %{!?upstream_version: %global upstream_version %{version}%{?milestone}} Name: python-editor Version: 1.0.3 Release: 11%{?dist} Summary: Programmatically open an editor, capture the result License: ASL 2.0 URL: https://github.com/fmoo/python-editor Source: https://github.com/fmoo/python-editor/archive/%{version}.tar.gz 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. %package -n python%{python3_pkgversion}-editor Summary: Programmatically open an editor, capture the result. %{?python_provide:%python_provide python%{python3_pkgversion}-editor} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools %description -n python%{python3_pkgversion}-editor Programmatically open an editor, capture the result. %prep %setup -q -n %{pypi_name}-%{upstream_version} rm -rf %{pypi_name}.egg-info # Change shebang according to Python version rm -rf %{py3dir} cp -a . %{py3dir} sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python3}=' %{py3dir}/editor.py sed -i '1s=^#!/usr/bin/\(python\|env python\)[0-9.]*=#!%{__python2}=' editor.py %build %{__python2} setup.py build pushd %{py3dir} %{__python3} setup.py build popd %install %{__python2} setup.py install --skip-build --root=$RPM_BUILD_ROOT chmod a+x $RPM_BUILD_ROOT%{python2_sitelib}/editor.py pushd %{py3dir} %{__python3} setup.py install --skip-build --root=$RPM_BUILD_ROOT chmod a+x $RPM_BUILD_ROOT%{python3_sitelib}/editor.py popd %files -n python2-editor %doc README.md %license LICENSE %{python2_sitelib}/editor.py* %{python2_sitelib}/python_editor-%{version}-py?.?.egg-info %files -n python%{python3_pkgversion}-editor %doc README.md %license LICENSE %{python3_sitelib}/*.egg-info %{python3_sitelib}/editor.py* %{python3_sitelib}/__pycache__/* %changelog * Wed Apr 10 2019 Marc Dequènes (Duck) - 1.0.3-11 - Adaptations to build Python 3 on EPEL * Sat Feb 02 2019 Fedora Release Engineering - 1.0.3-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Sat Jul 14 2018 Fedora Release Engineering - 1.0.3-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sun Jun 17 2018 Miro Hrončok - 1.0.3-8 - Rebuilt for Python 3.7 * Thu Mar 22 2018 Jan Beran - 1.0.3-7 - Fix of python3-editor requires both Python 2 and Python 3 (rhbz #1546794) * Mon Feb 12 2018 Iryna Shcherbina - 1.0.3-6 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Fri Feb 09 2018 Fedora Release Engineering - 1.0.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek - 1.0.3-4 - Fix creation of python2- subpackage * Thu Jul 27 2017 Fedora Release Engineering - 1.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 11 2017 Fedora Release Engineering - 1.0.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Dec 27 2016 Kevin Fenzi - 1.0.3-1 - Update to 1.0.3. Fixes bug #1400316 * Mon Dec 19 2016 Miro Hrončok - 1.0.2-2 - Rebuild for Python 3.6 * Wed Nov 23 2016 Kevin Fenzi - 1.0.2-1 - Update to 1.0.2 * Tue Jul 19 2016 Fedora Release Engineering - 1.0.1-2 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Wed Jun 15 2016 Kevin Fenzi - 1.0.1-1 - Update to 1.0.1. Fixes bug #1346641 * Sun Apr 10 2016 Kevin Fenzi - 1.0-1 - Update to 1.0. Fixes bug #1323386 * Thu Feb 04 2016 Fedora Release Engineering - 0.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 24 2015 Ralph Bean - 0.4-4 - Merge branches together and bump release for bodhi updates. - Removed empty %%check section. - Fix incorrect usage of %%{pypi_name}. * Tue Nov 10 2015 Fedora Release Engineering - 0.4-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Mon Aug 31 2015 Lukas Bezdicka - 0.4-2 - fix python2 and python3 support and add support for Centos CBS - fix description * Wed Aug 26 2015 Lukas Bezdicka - 0.4-1 - Bump to 0.4 * Tue Aug 25 2015 Lukas Bezdicka - 0.3-1 - initial package