make main package archful to run tests on all arches

- pythonN-pyelftools subpackages are still noarch
- run readelf tests only on x86_64
This commit is contained in:
Dominik 'Rathann' Mierzejewski 2019-12-17 12:18:01 +01:00
parent ed65c4fcbd
commit b37dece1d1

View File

@ -18,6 +18,9 @@
%global with_python3 1 %global with_python3 1
%endif %endif
# main package is archful to run tests everywhere but produces noarch packages
%global debug_package %{nil}
Summary: Pure-Python library for parsing and analyzing ELF files Summary: Pure-Python library for parsing and analyzing ELF files
Name: pyelftools Name: pyelftools
Version: 0.26 Version: 0.26
@ -27,15 +30,6 @@ URL: https://github.com/eliben/pyelftools
# https://github.com/eliben/pyelftools/issues/260 # https://github.com/eliben/pyelftools/issues/260
#Source0: https://files.pythonhosted.org/packages/source/p/pyelftools/pyelftools-%{version}.tar.gz #Source0: https://files.pythonhosted.org/packages/source/p/pyelftools/pyelftools-%{version}.tar.gz
Source0: https://github.com/eliben/pyelftools/archive/v%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/eliben/pyelftools/archive/v%{version}/%{name}-%{version}.tar.gz
%if 0%{?with_python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
BuildArch: noarch
%global _description \ %global _description \
Pure-Python library for parsing and analyzing ELF files\ Pure-Python library for parsing and analyzing ELF files\
and DWARF debugging information. and DWARF debugging information.
@ -45,6 +39,9 @@ and DWARF debugging information.
%package -n python2-%{name} %package -n python2-%{name}
Summary: %{summary} Summary: %{summary}
Requires: python2-construct Requires: python2-construct
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildArch: noarch
%{?python_provide:%python_provide python2-%{name}} %{?python_provide:%python_provide python2-%{name}}
# Remove before F30 # Remove before F30
%description -n python2-%{name} %_description %description -n python2-%{name} %_description
@ -54,6 +51,9 @@ Requires: python2-construct
%package -n python3-%{name} %package -n python3-%{name}
Summary: %{summary} Summary: %{summary}
Requires: python3-construct Requires: python3-construct
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildArch: noarch
%{?python_provide:%python_provide python3-%{name}} %{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name} %_description %description -n python3-%{name} %_description
%endif %endif
@ -83,17 +83,21 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf}
%if 0%{?with_python2} %if 0%{?with_python2}
%{__python2} test/run_all_unittests.py %{__python2} test/run_all_unittests.py
%{__python2} test/run_examples_test.py %{__python2} test/run_examples_test.py
%ifarch x86_64
# tests may fail because of differences in output-formatting # tests may fail because of differences in output-formatting
# from binutils' readelf. See: # from binutils' readelf. See:
# 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 || :
%endif %endif
%endif
%if 0%{?with_python3} %if 0%{?with_python3}
%{__python3} test/run_all_unittests.py %{__python3} test/run_all_unittests.py
%{__python3} test/run_examples_test.py %{__python3} test/run_examples_test.py
%ifarch x86_64
# ditto # ditto
%{__python3} test/run_readelf_tests.py || : %{__python3} test/run_readelf_tests.py || :
%endif %endif
%endif
%if 0%{?with_python2} %if 0%{?with_python2}
%files -n python2-%{name} %files -n python2-%{name}
@ -116,6 +120,9 @@ mv %{buildroot}/usr/bin/readelf.py %{buildroot}/usr/bin/%{py3readelf}
%changelog %changelog
* Tue Dec 17 2019 Dominik Mierzejewski <rpm@greysector.net> - 0.26-1 * Tue Dec 17 2019 Dominik Mierzejewski <rpm@greysector.net> - 0.26-1
- update to 0.26 (#1780153) - update to 0.26 (#1780153)
- 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
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.25-5 * Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.25-5
- Rebuilt for Python 3.8.0rc1 (#1748018) - Rebuilt for Python 3.8.0rc1 (#1748018)