From 360daf2c1525fad37d5871a78e3c695546fc7f3d Mon Sep 17 00:00:00 2001 From: Moez Roy Date: Sun, 5 Oct 2014 01:37:25 -0700 Subject: [PATCH] python3 is not available in epel7 --- pyelftools.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyelftools.spec b/pyelftools.spec index 295add0..966a9ab 100644 --- a/pyelftools.spec +++ b/pyelftools.spec @@ -1,4 +1,4 @@ -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 %global __python_sitelib %{python2_sitelib} %else %{!?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-construct -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-construct @@ -53,7 +53,7 @@ Pure-Python library for parsing and analyzing ELF files and DWARF debugging information. -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 %package -n python3-%{name} Summary: Pure-Python library for parsing and analyzing ELF files @@ -74,7 +74,7 @@ and DWARF debugging information. rm -rf elftools/construct # python3-package -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 rm -rf %{py3dir} cp -a . %{py3dir} @@ -88,7 +88,7 @@ sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/python2|' scripts/readelf.py %build %{__python2} setup.py build -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 pushd %{py3dir} %{__python3} setup.py build %endif @@ -98,7 +98,7 @@ pushd %{py3dir} %{__python2} setup.py install -O1 --skip-build --root %{buildroot} mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/pyreadelf -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} 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 %{__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_examples_test.py # 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* %{_bindir}/pyreadelf -%if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 8 %files -n python3-%{name} %doc CHANGES LICENSE README* TODO %{python3_sitelib}/*elftools*