2018-05-18 17:54:08 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-pyelftools
|
|
|
|
#
|
2020-03-19 15:54:40 +01:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2018-05-18 17:54:08 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-05-25 11:34:04 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
2018-05-18 17:54:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
Name: python-pyelftools
|
2020-03-19 15:54:40 +01:00
|
|
|
Version: 0.26
|
2018-05-18 17:54:08 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Library for analyzing ELF files and DWARF debugging information
|
2019-05-25 11:34:04 +02:00
|
|
|
License: SUSE-Public-Domain
|
2018-05-18 17:54:08 +02:00
|
|
|
Group: Development/Languages/Python
|
2019-05-25 11:34:04 +02:00
|
|
|
URL: https://github.com/eliben/pyelftools
|
2018-05-18 17:54:08 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pyelftools/pyelftools-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
2019-05-25 11:34:04 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-05-20 13:29:10 +02:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2018-05-18 17:54:08 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
pyelftools is a pure python library for analyzing ELF files and DWARF debugging information
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n pyelftools-%{version}
|
2020-03-19 15:54:40 +01:00
|
|
|
# DROP THIS REMOVAL!
|
|
|
|
rm test/test_pubtypes.py
|
|
|
|
# ^^^ https://github.com/eliben/pyelftools/commit/83ad8a220d0fd7a183bf249ad8bbb681227dc266
|
2018-05-18 17:54:08 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2020-05-20 13:29:10 +02:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/readelf.py
|
2018-05-18 17:54:08 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-05-25 11:34:04 +02:00
|
|
|
|
2018-05-18 17:54:08 +02:00
|
|
|
%check
|
|
|
|
%python_exec test/run_all_unittests.py
|
|
|
|
%python_exec test/run_examples_test.py
|
|
|
|
# May fail due to minor differences in the output of readelf
|
|
|
|
# https://github.com/eliben/pyelftools/wiki/Hacking-guide#tests
|
|
|
|
%python_exec test/run_readelf_tests.py || :
|
|
|
|
|
2020-05-20 13:29:10 +02:00
|
|
|
%post
|
|
|
|
%python_install_alternative readelf.py
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative readelf.py
|
|
|
|
|
2018-05-18 17:54:08 +02:00
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
|
|
|
%doc CHANGES
|
2020-05-20 13:29:10 +02:00
|
|
|
%python_alternative %{_bindir}/readelf.py
|
2018-05-18 17:54:08 +02:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|