]>
Commit | Line | Data |
---|---|---|
7dc1b643 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
41d7062e JR |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
7dc1b643 | 6 | |
41d7062e JR |
7 | %define module uncompyle6 |
8 | %define egg_name uncompyle6 | |
7dc1b643 | 9 | %define pypi_name uncompyle6 |
48d68929 | 10 | Summary: A Python decompiler, disassembler and cross-version bytecode library |
7dc1b643 | 11 | Name: python-%{pypi_name} |
f97a680d JR |
12 | Version: 3.5.0 |
13 | Release: 1 | |
b65cedb5 | 14 | License: MIT |
48d68929 | 15 | Group: Applications |
f97a680d JR |
16 | Source0: https://github.com/rocky/python-uncompyle6/archive/%{version}/%{name}-%{version}.tar.gz |
17 | # Source0-md5: 2e7f32b662a565a843b1de3bfd54a5b6 | |
48d68929 | 18 | URL: https://github.com/rocky/python-uncompyle6/ |
41d7062e JR |
19 | %if %{with python2} |
20 | BuildRequires: python-modules | |
21 | BuildRequires: python-pytest | |
22 | BuildRequires: python-setuptools | |
23 | BuildRequires: python-spark_parser | |
24 | BuildRequires: python-xdis | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules | |
28 | BuildRequires: python3-pytest | |
29 | BuildRequires: python3-setuptools | |
30 | BuildRequires: python3-spark_parser | |
31 | BuildRequires: python3-xdis | |
32 | %endif | |
48d68929 ER |
33 | BuildRequires: rpm-pythonprov |
34 | BuildRequires: rpmbuild(macros) >= 1.219 | |
35 | BuildArch: noarch | |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | uncompyle6 translates Python bytecode back into equivalent Python | |
40 | source code. It accepts bytecodes from Python version 2.5 to 3.4 or so | |
41 | and has been tested on Python running versions 2.6, 2.7, 3.3, 3.4 and | |
42 | 3.5. | |
43 | ||
41d7062e JR |
44 | %package -n python3-%{module} |
45 | Summary: A Python decompiler, disassembler and cross-version bytecode library | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules | |
48 | ||
49 | %description -n python3-%{module} | |
50 | uncompyle6 translates Python bytecode back into equivalent Python | |
51 | source code. It accepts bytecodes from Python version 2.5 to 3.4 or so | |
52 | and has been tested on Python running versions 2.6, 2.7, 3.3, 3.4 and | |
53 | 3.5. | |
54 | ||
48d68929 | 55 | %prep |
f97a680d | 56 | %setup -q |
48d68929 | 57 | |
2b1b691d JR |
58 | # There is something wrong with this file that breaks tests |
59 | %{__rm} test/bytecode_2.4/02_complex.pyc | |
60 | ||
48d68929 | 61 | %build |
41d7062e | 62 | %if %{with python2} |
48d68929 | 63 | %py_build |
41d7062e | 64 | %endif |
48d68929 | 65 | |
41d7062e JR |
66 | %if %{with python3} |
67 | %py3_build | |
7dc1b643 ER |
68 | %endif |
69 | ||
41d7062e JR |
70 | %{?with_tests:%{__make} PYTHONPATH=$(pwd) check} |
71 | ||
48d68929 ER |
72 | %install |
73 | rm -rf $RPM_BUILD_ROOT | |
41d7062e JR |
74 | |
75 | %if %{with python3} | |
76 | %py3_install | |
77 | ||
78 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{pydisassemble,py3disassemble} | |
79 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{uncompyle6,py3uncompyle6} | |
80 | %endif | |
81 | ||
82 | %if %{with python2} | |
48d68929 ER |
83 | %py_install |
84 | %py_postclean | |
41d7062e | 85 | %endif |
48d68929 ER |
86 | |
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
41d7062e | 90 | %if %{with python2} |
48d68929 ER |
91 | %files |
92 | %defattr(644,root,root,755) | |
93 | %attr(755,root,root) %{_bindir}/pydisassemble | |
94 | %attr(755,root,root) %{_bindir}/uncompyle6 | |
7dc1b643 ER |
95 | %{py_sitescriptdir}/%{module} |
96 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
41d7062e JR |
97 | %endif |
98 | ||
99 | %if %{with python3} | |
100 | %files -n python3-%{module} | |
101 | %defattr(644,root,root,755) | |
102 | %attr(755,root,root) %{_bindir}/py3disassemble | |
103 | %attr(755,root,root) %{_bindir}/py3uncompyle6 | |
104 | %{py3_sitescriptdir}/%{module} | |
105 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
106 | %endif |