From 2d2306a640a9ba4a57be25ce1830dce3f1c0e2b6 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Tue, 17 Dec 2019 13:39:36 +0100 Subject: [PATCH] rename binaries to conform to Python packaging guidelines --- pyelftools.spec | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/pyelftools.spec b/pyelftools.spec index 9f0345d..aeefd51 100644 --- a/pyelftools.spec +++ b/pyelftools.spec @@ -1,9 +1,11 @@ %if 0%{?fedora} || 0%{?rhel} >= 8 -%global py2readelf py2readelf -%global py3readelf pyreadelf +%global py2readelf %{nil} +%global py3readelf %{_bindir}/pyreadelf +%global pyreadelf pyreadelf-3 %else -%global py2readelf pyreadelf -%global py3readelf py3readelf +%global py2readelf %{_bindir}/pyreadelf +%global py3readelf %{nil} +%global pyreadelf pyreadelf-2 %endif %if 0%{?fedora} && 0%{?fedora} < 32 @@ -72,12 +74,21 @@ BuildArch: noarch %install %if 0%{?with_python2} %{py2_install} -mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py2readelf} +pushd %{buildroot}%{_bindir} +mv readelf.py pyreadelf-%{python2_version} +ln -s pyreadelf-%{python2_version} pyreadelf-2 +popd %endif %if 0%{?with_python3} %{py3_install} -mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf} +pushd %{buildroot}%{_bindir} +mv readelf.py pyreadelf-%{python3_version} +ln -s pyreadelf-%{python3_version} pyreadelf-3 +popd %endif +pushd %{buildroot}%{_bindir} +ln -s %{pyreadelf} pyreadelf +popd %check %if 0%{?with_python2} @@ -103,7 +114,9 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf} %files -n python2-%{name} %license LICENSE %doc CHANGES -%{_bindir}/%{py2readelf} +%{py2readelf} +%{_bindir}/pyreadelf-%{python2_version} +%{_bindir}/pyreadelf-2 %{python2_sitelib}/elftools %{python2_sitelib}/pyelftools-*.egg-info %endif @@ -112,7 +125,9 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf} %files -n python3-%{name} %license LICENSE %doc CHANGES -%{_bindir}/%{py3readelf} +%{py3readelf} +%{_bindir}/pyreadelf-%{python3_version} +%{_bindir}/pyreadelf-3 %{python3_sitelib}/elftools %{python3_sitelib}/pyelftools-*.egg-info %endif @@ -123,6 +138,7 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf} - make main package archful to run tests on all arches (pythonN-pyelftools subpackages are still noarch) - run readelf tests on x86_64 only for now +- rename binaries to conform to Python packaging guidelines * Thu Oct 03 2019 Miro HronĨok - 0.25-5 - Rebuilt for Python 3.8.0rc1 (#1748018)