3 # - check why the tests fail
6 %bcond_with tests # run tests
7 %bcond_without python2 # CPython 2.x module
8 %bcond_without python3 # CPython 3.x module
10 %define module elftools
11 Summary: Pure-Python library for parsing and analyzing ELF files
12 Summary(pl.UTF-8): Czysto pythonowa biblioteka do analizy plików ELF
13 Name: python-%{module}
16 License: public domain
17 Group: Libraries/Python
18 Source0: https://files.pythonhosted.org/packages/source/p/pyelftools/pyelftools-%{version}.tar.gz
19 # Source0-md5: 2afc97cd239c0dea0cca97d00d3dcb42
20 URL: https://github.com/eliben/pyelftools
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python-devel
25 BuildRequires: python-setuptools
28 BuildRequires: python3-devel
29 BuildRequires: python3-setuptools
31 Requires: python-modules
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 pyelftools is a pure-Python library for parsing and analyzing ELF
37 files and DWARF debugging information.
39 %description -l pl.UTF-8
40 pyelftools to czysto pythonowa biblioteka do analizy plików ELF oraz
41 informacji dla debuggera DWARF.
43 %package -n python3-%{module}
44 Summary: Pure-Python library for parsing and analyzing ELF files
45 Summary(pl.UTF-8): Czysto pythonowa biblioteka do analizy plików ELF
46 Group: Libraries/Python
47 Requires: python3-modules
49 %description -n python3-%{module}
50 pyelftools is a pure-Python library for parsing and analyzing ELF
51 files and DWARF debugging information.
53 %description -n python3-%{module} -l pl.UTF-8
54 pyelftools to czysto pythonowa biblioteka do analizy plików ELF oraz
55 informacji dla debuggera DWARF.
58 %setup -q -n pyelftools-%{version}
65 %{__python} ./test/all_tests.py
70 %py3_build %{?with_tests:test}
73 %{__python3} ./test/all_tests.py
78 rm -rf $RPM_BUILD_ROOT
90 # readelf clone example
91 %{__rm} $RPM_BUILD_ROOT%{_bindir}/readelf.py
94 rm -rf $RPM_BUILD_ROOT
98 %defattr(644,root,root,755)
100 %{py_sitescriptdir}/%{module}
101 %{py_sitescriptdir}/pyelftools-%{version}-py*.egg-info
105 %files -n python3-%{module}
106 %defattr(644,root,root,755)
108 %{py3_sitescriptdir}/%{module}
109 %{py3_sitescriptdir}/pyelftools-%{version}-py*.egg-info