From a175fe5d294e7671f9ccfbf14b113c7836eb55dc Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Nov 06 2015 02:02:48 +0000 Subject: Ship the reno script against python3 to comply with the python guidelines and solve the issue of the python3 package depending on /usr/bin/python2 --- diff --git a/python-reno.spec b/python-reno.spec index e384a52..c25502f 100644 --- a/python-reno.spec +++ b/python-reno.spec @@ -2,11 +2,23 @@ %if 0%{?fedora} %global with_python3 1 + +# Only reason to choose 24 is that that's what was in development when we made +# the switch for this package. Fedora Policy was to have made this switch for +# Fedora 22. +%if 0%{?fedora} >= 24 +%global default_python 3 +%else +%global default_python 2 +%endif + %endif + + Name: python-%{pypi_name} Version: 0.1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Release NOtes manager License: ASL 2.0 @@ -90,10 +102,17 @@ Documentation for reno %install %if 0%{with_python3} %py3_install +%if %{default_python} >= 3 +mv %{buildroot}%{_bindir}/%{pypi_name} ./%{pypi_name}.py3 +%endif %endif %py2_install +%if %{default_python} >= 3 +mv %{pypi_name}.py3 %{buildroot}%{_bindir}/%{pypi_name} +%endif + # generate html docs sphinx-build doc/source html # remove the sphinx-build leftovers @@ -102,7 +121,9 @@ rm -rf html/.{doctrees,buildinfo} %files -n python2-%{pypi_name} %doc doc/source/readme.rst README.rst %license LICENSE +%if %{default_python} <= 2 %{_bindir}/%{pypi_name} +%endif %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info @@ -110,7 +131,9 @@ rm -rf html/.{doctrees,buildinfo} %files -n python3-%{pypi_name} %doc doc/source/readme.rst README.rst %license LICENSE +%if %{default_python} >= 3 %{_bindir}/%{pypi_name} +%endif %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif @@ -120,6 +143,10 @@ rm -rf html/.{doctrees,buildinfo} %license LICENSE %changelog +* Thu Nov 5 2015 Toshio Kuratomi - 0.1.0-3 +- Ship the reno script against python3 to comply with the python guidelines and + solve the issue of the python3 package depending on /usr/bin/python2 + * Wed Sep 30 2015 Chandan Kumar -0.1.0-2 - Some cosmetic changes in spec file