From 2d7238ab2e188931130b0b8a5f9584a8edc90bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 11 Oct 2019 14:48:35 +0200 Subject: [PATCH] Modernize executable names Rename the Python-versioned executables not to start with "python" (if you have python3-mako installed and you type python[tab], it gets in the way) Make mako-render Python 3 on Fedora 32+ See https://fedoraproject.org/wiki/Changes/Python_means_Python3 (arguably, this is correct for F31 as well, but the timing is not good for that) --- python-mako.spec | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/python-mako.spec b/python-mako.spec index aaf8e6b..127ae44 100644 --- a/python-mako.spec +++ b/python-mako.spec @@ -14,7 +14,7 @@ Name: python-mako Version: 1.1.0 -Release: 1%{?dist} +Release: 2%{?dist} BuildArch: noarch # Mostly MIT, but _ast_util.py is Python licensed. @@ -99,6 +99,10 @@ Requires: python3-markupsafe # Beaker is the preferred caching backend, but is not strictly necessary Recommends: python3-beaker +%if 0%{?fedora} >= 32 +Conflicts: python2-mako < 1.1.0-2 +%endif + %{?python_provide:%python_provide python3-mako} %if %{without python2} @@ -128,13 +132,26 @@ This package contains the mako module built for use with python3. %install -%{?with_python3:%py3_install} +%if %{with python3} +%py3_install -%if %{with python2} -mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/python3-mako-render +mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python3_version} +ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render-3 %endif -%{?with_python2:%py2_install} +%if %{with python2} +%py2_install + +mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python2_version} +ln -s ./mako-render-%{python2_version} %{buildroot}/%{_bindir}/mako-render-2 +%if ! (%{with python3} && 0%{?fedora} >= 32) +ln -s ./mako-render-%{python2_version} %{buildroot}/%{_bindir}/mako-render +%endif +%endif + +%if %{with python3} && 0%{?fedora} >= 32 +ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render +%endif # These are supporting files for building the docs. No need to ship rm -rf doc/build @@ -152,7 +169,11 @@ py.test-3 %files -n python2-mako %license LICENSE %doc CHANGES README.rst examples +%if ! (%{with python3} && 0%{?fedora} >= 32) %{_bindir}/mako-render +%endif +%{_bindir}/mako-render-2 +%{_bindir}/mako-render-%{python2_version} %{python2_sitelib}/* %endif %{with python2} @@ -160,11 +181,11 @@ py.test-3 %files -n python3-mako %license LICENSE %doc CHANGES README.rst examples -%if %{with python2} -%{_bindir}/python3-mako-render -%else +%if %{with python3} && 0%{?fedora} >= 32 %{_bindir}/mako-render %endif +%{_bindir}/mako-render-3 +%{_bindir}/mako-render-%{python3_version} %{python3_sitelib}/* %endif @@ -173,6 +194,10 @@ py.test-3 %changelog +* Fri Oct 11 2019 Miro HronĨok - 1.1.0-2 +- Rename the Python-versioned executables not to start with "python" +- Make mako-render Python 3 on Fedora 32+ + * Tue Sep 03 2019 Randy Barlow - 1.1.0-1 - Update to 1.1.0 (#1725969). - https://docs.makotemplates.org/en/latest/changelog.html#change-1.1.0