]> git.pld-linux.org Git - SPECS.git/blob - python-elftools.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-elftools.spec
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
12 Summary(pl.UTF-8):      Czysto pythonowa biblioteka do analizy plików ELF
13 Name:           python-%{module}
14 Version:        0.23
15 Release:        9
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
22 BuildRequires:  rpmbuild(macros) >= 1.710
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
39 %description -l pl.UTF-8
40 pyelftools to czysto pythonowa biblioteka do analizy plików ELF oraz
41 informacji dla debuggera DWARF.
42
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
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
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
57 %prep
58 %setup -q -n pyelftools-%{version}
59
60 %build
61 %if %{with python2}
62 %py_build
63
64 %if %{with tests}
65 %{__python} ./test/all_tests.py
66 %endif
67 %endif
68
69 %if %{with python3}
70 %py3_build %{?with_tests:test}
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}
81 %py_install
82
83 %py_postclean
84 %endif
85
86 %if %{with python3}
87 %py3_install
88 %endif
89
90 # readelf clone example
91 %{__rm} $RPM_BUILD_ROOT%{_bindir}/readelf.py
92
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
This page took 1.627582 seconds and 3 git commands to generate.