Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/pyelftools.git#ca5e67ddd22b260c75abefb8b67daa606666cb02
This commit is contained in:
DistroBaker 2020-11-01 18:46:06 +00:00
parent f338af86ee
commit c17a5467a7
2 changed files with 15 additions and 87 deletions

View File

@ -1,140 +1,68 @@
%if 0%{?fedora} || 0%{?rhel} >= 8
%global py2readelf %{nil}
%global py3readelf %{_bindir}/pyreadelf
%global pyreadelf pyreadelf-3
%else
%global py2readelf %{_bindir}/pyreadelf
%global py3readelf %{nil}
%global pyreadelf pyreadelf-2
%endif
%if 0%{?fedora} && 0%{?fedora} < 32
%global with_python2 1
%endif
%if 0%{?rhel} && 0%{?rhel} < 8
%global with_python2 1
%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
%global with_python3 1
%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
Name: pyelftools
Version: 0.26
Release: 4%{?dist}
Version: 0.27
Release: 1%{?dist}
License: Public Domain
URL: https://github.com/eliben/pyelftools
# https://github.com/eliben/pyelftools/issues/260
#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
%global _description \
Pure-Python library for parsing and analyzing ELF files\
and DWARF debugging information.
%description %_description
%if 0%{?with_python2}
%package -n python2-%{name}
Summary: %{summary}
# https://github.com/eliben/pyelftools/issues/180
Provides: bundled(python2-construct) = 2.6
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildArch: noarch
%{?python_provide:%python_provide python2-%{name}}
# Remove before F30
%description -n python2-%{name} %_description
%endif # with_python2
%if 0%{?with_python3}
%package -n python3-%{name}
Summary: %{summary}
# https://github.com/eliben/pyelftools/issues/180
Provides: bundled(python3-construct) = 2.6
BuildRequires: %{_bindir}/readelf
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildArch: noarch
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name} %_description
%endif
%prep
%setup -q
%ifnarch x86_64
rm test/external_tools/readelf
%endif
%build
%if 0%{?with_python2}
%{py2_build}
%endif
%if 0%{?with_python3}
%{py3_build}
%endif
%install
%if 0%{?with_python2}
%{py2_install}
pushd %{buildroot}%{_bindir}
mv readelf.py pyreadelf-%{python2_version}
ln -s pyreadelf-%{python2_version} pyreadelf-2
popd
%endif
%if 0%{?with_python3}
%{py3_install}
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
ln -s pyreadelf-3 pyreadelf
popd
%check
%if 0%{?with_python2}
%{__python2} test/run_all_unittests.py
%{__python2} test/run_examples_test.py
%ifarch x86_64
%{__python3} test/run_all_unittests.py
%{__python3} test/run_examples_test.py
# tests may fail because of differences in output-formatting
# from binutils' readelf. See:
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
%{__python2} test/run_readelf_tests.py || :
%endif
%endif
%if 0%{?with_python3}
%{__python3} test/run_all_unittests.py
%{__python3} test/run_examples_test.py
%ifarch x86_64
# ditto
%{__python3} test/run_readelf_tests.py || :
%endif
%endif
%if 0%{?with_python2}
%files -n python2-%{name}
%license LICENSE
%doc CHANGES
%{py2readelf}
%{_bindir}/pyreadelf-%{python2_version}
%{_bindir}/pyreadelf-2
%{python2_sitelib}/elftools
%{python2_sitelib}/pyelftools-*.egg-info
%endif
%if 0%{?with_python3}
%files -n python3-%{name}
%license LICENSE
%doc CHANGES
%{py3readelf}
%{_bindir}/pyreadelf
%{_bindir}/pyreadelf-%{python3_version}
%{_bindir}/pyreadelf-3
%{python3_sitelib}/elftools
%{python3_sitelib}/pyelftools-*.egg-info
%endif
%changelog
* Fri Oct 30 2020 Dominik Mierzejewski <rpm@greysector.net> - 0.27-1
- update to 0.27 (#1891845)
- run readelf tests on all arches
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.26-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (pyelftools-0.26.tar.gz) = dd166f56654592f6a0d7a91bc41c01b9300de6d2f08b204a61ac48eb3f4b3224f89271c5fe66adc41d71a5e2bed8ddfa4ad495098df917623f7aa90c2caffeca
SHA512 (pyelftools-0.27.tar.gz) = bb0a00e5500016e3d4f64be0a728e190f84b11a805f78d668b5a74716a30400e6794946f198ef4a3f3b8f64a63deb1b5a96180b09e56b7357b988b28e25fad0a