#3 Fix of python3-editor requires both Python 2 and Python 3 (rhbz #1546794)
Merged 6 years ago by ralph. Opened 6 years ago by aries.
rpms/ aries/python-editor master  into  master

file modified
+15 -1
@@ -8,7 +8,7 @@ 

  

  Name:           python-editor

  Version:        1.0.3

- Release:        6%{?dist}

+ Release:        7%{?dist}

  Summary:        Programmatically open an editor, capture the result

  

  License:        ASL 2.0
@@ -46,11 +46,20 @@ 

  %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

  

  %build

  %{__python2} setup.py build

  %if 0%{?with_python3}

+ pushd %{py3dir}

  %{__python3} setup.py build

+ popd

  %endif

  

  %install
@@ -58,8 +67,10 @@ 

  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

  chmod a+x $RPM_BUILD_ROOT%{python3_sitelib}/editor.py

+ popd

  %endif

  

  %files -n python2-editor
@@ -79,6 +90,9 @@ 

  

  

  %changelog

+ * Thu Mar 22 2018 Jan Beran <jberan@redhat.com> - 1.0.3-7

+ - Fix of python3-editor requires both Python 2 and Python 3 (rhbz #1546794)

+ 

  * Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0.3-6

  - Update Python 2 dependency declarations to new packaging standards

    (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)