]>
Commit | Line | Data |
---|---|---|
29e92779 JK |
1 | # |
2 | # TODO: | |
3 | # - check why the tests fail | |
4 | # | |
5 | # Conditional build: | |
6 | %bcond_with tests # run tests | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
10 | %define module elftools | |
11 | Summary: Pure-Python library for parsing and analyzing ELF files | |
f2dda54f | 12 | Summary(pl.UTF-8): Czysto pythonowa biblioteka do analizy plików ELF |
29e92779 JK |
13 | Name: python-%{module} |
14 | Version: 0.23 | |
bff63d15 | 15 | Release: 10 |
29e92779 JK |
16 | License: public domain |
17 | Group: Libraries/Python | |
18 | Source0: https://pypi.python.org/packages/source/p/pyelftools/pyelftools-%{version}.tar.gz | |
19 | # Source0-md5: aa7cefa8bd2f63d7b017440c9084f310 | |
20 | URL: https://github.com/eliben/pyelftools | |
21 | BuildRequires: rpm-pythonprov | |
d1869374 | 22 | BuildRequires: rpmbuild(macros) >= 1.710 |
29e92779 JK |
23 | %if %{with python2} |
24 | BuildRequires: python-devel | |
25 | BuildRequires: python-setuptools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-devel | |
29 | BuildRequires: python3-setuptools | |
30 | %endif | |
31 | Requires: python-modules | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | pyelftools is a pure-Python library for parsing and analyzing ELF | |
37 | files and DWARF debugging information. | |
38 | ||
f2dda54f JB |
39 | %description -l pl.UTF-8 |
40 | pyelftools to czysto pythonowa biblioteka do analizy plików ELF oraz | |
41 | informacji dla debuggera DWARF. | |
42 | ||
29e92779 JK |
43 | %package -n python3-%{module} |
44 | Summary: Pure-Python library for parsing and analyzing ELF files | |
f2dda54f | 45 | Summary(pl.UTF-8): Czysto pythonowa biblioteka do analizy plików ELF |
29e92779 JK |
46 | Group: Libraries/Python |
47 | Requires: python3-modules | |
48 | ||
49 | %description -n python3-%{module} | |
50 | pyelftools is a pure-Python library for parsing and analyzing ELF | |
51 | files and DWARF debugging information. | |
52 | ||
f2dda54f JB |
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. | |
56 | ||
29e92779 JK |
57 | %prep |
58 | %setup -q -n pyelftools-%{version} | |
59 | ||
60 | %build | |
61 | %if %{with python2} | |
e31ddc23 | 62 | %py_build |
29e92779 JK |
63 | |
64 | %if %{with tests} | |
65 | %{__python} ./test/all_tests.py | |
66 | %endif | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
e31ddc23 | 70 | %py3_build %{?with_tests:test} |
29e92779 JK |
71 | |
72 | %if %{with tests} | |
73 | %{__python3} ./test/all_tests.py | |
74 | %endif | |
75 | %endif | |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
e31ddc23 | 81 | %py_install |
29e92779 JK |
82 | |
83 | %py_postclean | |
84 | %endif | |
85 | ||
86 | %if %{with python3} | |
e31ddc23 | 87 | %py3_install |
29e92779 JK |
88 | %endif |
89 | ||
f2dda54f JB |
90 | # readelf clone example |
91 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/readelf.py | |
92 | ||
29e92779 JK |
93 | %clean |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %if %{with python2} | |
97 | %files | |
98 | %defattr(644,root,root,755) | |
99 | %doc LICENSE CHANGES | |
100 | %{py_sitescriptdir}/%{module} | |
101 | %{py_sitescriptdir}/pyelftools-%{version}-py*.egg-info | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %files -n python3-%{module} | |
106 | %defattr(644,root,root,755) | |
107 | %doc LICENSE CHANGES | |
108 | %{py3_sitescriptdir}/%{module} | |
109 | %{py3_sitescriptdir}/pyelftools-%{version}-py*.egg-info | |
110 | %endif |