python3 is not available in epel7
This commit is contained in:
parent
f0aeace6b4
commit
360daf2c15
@ -1,4 +1,4 @@
|
|||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
%global __python_sitelib %{python2_sitelib}
|
%global __python_sitelib %{python2_sitelib}
|
||||||
%else
|
%else
|
||||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
||||||
@ -30,7 +30,7 @@ BuildRequires: python2-devel
|
|||||||
BuildRequires: python-setuptools
|
BuildRequires: python-setuptools
|
||||||
BuildRequires: python-construct
|
BuildRequires: python-construct
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
BuildRequires: python3-construct
|
BuildRequires: python3-construct
|
||||||
@ -53,7 +53,7 @@ Pure-Python library for parsing and analyzing ELF files
|
|||||||
and DWARF debugging information.
|
and DWARF debugging information.
|
||||||
|
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
%package -n python3-%{name}
|
%package -n python3-%{name}
|
||||||
Summary: Pure-Python library for parsing and analyzing ELF files
|
Summary: Pure-Python library for parsing and analyzing ELF files
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ and DWARF debugging information.
|
|||||||
rm -rf elftools/construct
|
rm -rf elftools/construct
|
||||||
|
|
||||||
# python3-package
|
# python3-package
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
rm -rf %{py3dir}
|
rm -rf %{py3dir}
|
||||||
cp -a . %{py3dir}
|
cp -a . %{py3dir}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python2|' scripts/readelf.py
|
|||||||
%build
|
%build
|
||||||
%{__python2} setup.py build
|
%{__python2} setup.py build
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
%{__python3} setup.py build
|
%{__python3} setup.py build
|
||||||
%endif
|
%endif
|
||||||
@ -98,7 +98,7 @@ pushd %{py3dir}
|
|||||||
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
|
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
|
||||||
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/pyreadelf
|
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/pyreadelf
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
pushd %{py3dir}
|
pushd %{py3dir}
|
||||||
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
|
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
|
||||||
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
||||||
@ -113,7 +113,7 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
|||||||
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
|
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
|
||||||
%{__python2} test/run_readelf_tests.py || :
|
%{__python2} test/run_readelf_tests.py || :
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
%{__python3} test/run_all_unittests.py
|
%{__python3} test/run_all_unittests.py
|
||||||
%{__python3} test/run_examples_test.py
|
%{__python3} test/run_examples_test.py
|
||||||
# tests may fail because of differences in output-formatting
|
# tests may fail because of differences in output-formatting
|
||||||
@ -128,7 +128,7 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/py3readelf
|
|||||||
%{__python_sitelib}/*elftools*
|
%{__python_sitelib}/*elftools*
|
||||||
%{_bindir}/pyreadelf
|
%{_bindir}/pyreadelf
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
%if 0%{?fedora} || 0%{?rhel} >= 8
|
||||||
%files -n python3-%{name}
|
%files -n python3-%{name}
|
||||||
%doc CHANGES LICENSE README* TODO
|
%doc CHANGES LICENSE README* TODO
|
||||||
%{python3_sitelib}/*elftools*
|
%{python3_sitelib}/*elftools*
|
||||||
|
Loading…
Reference in New Issue
Block a user