]>
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} |
af3636b1 | 12 | Version: 2.6.0 |
41d7062e | 13 | Release: 2 |
b65cedb5 | 14 | License: MIT |
48d68929 | 15 | Group: Applications |
8020bffe | 16 | Source0: https://github.com/rocky/python-uncompyle6/archive/release-%{version}/%{name}-%{version}.tar.gz |
af3636b1 | 17 | # Source0-md5: bfa928d524c800d4c61ff46e3c119e6e |
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 |
b65cedb5 | 56 | %setup -qn %{name}-release-%{version} |
48d68929 ER |
57 | |
58 | %build | |
41d7062e | 59 | %if %{with python2} |
48d68929 | 60 | %py_build |
41d7062e | 61 | %endif |
48d68929 | 62 | |
41d7062e JR |
63 | %if %{with python3} |
64 | %py3_build | |
7dc1b643 ER |
65 | %endif |
66 | ||
41d7062e JR |
67 | %{?with_tests:%{__make} PYTHONPATH=$(pwd) check} |
68 | ||
48d68929 ER |
69 | %install |
70 | rm -rf $RPM_BUILD_ROOT | |
41d7062e JR |
71 | |
72 | %if %{with python3} | |
73 | %py3_install | |
74 | ||
75 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{pydisassemble,py3disassemble} | |
76 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{uncompyle6,py3uncompyle6} | |
77 | %endif | |
78 | ||
79 | %if %{with python2} | |
48d68929 ER |
80 | %py_install |
81 | %py_postclean | |
41d7062e | 82 | %endif |
48d68929 ER |
83 | |
84 | %clean | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
41d7062e | 87 | %if %{with python2} |
48d68929 ER |
88 | %files |
89 | %defattr(644,root,root,755) | |
90 | %attr(755,root,root) %{_bindir}/pydisassemble | |
91 | %attr(755,root,root) %{_bindir}/uncompyle6 | |
7dc1b643 ER |
92 | %{py_sitescriptdir}/%{module} |
93 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
41d7062e JR |
94 | %endif |
95 | ||
96 | %if %{with python3} | |
97 | %files -n python3-%{module} | |
98 | %defattr(644,root,root,755) | |
99 | %attr(755,root,root) %{_bindir}/py3disassemble | |
100 | %attr(755,root,root) %{_bindir}/py3uncompyle6 | |
101 | %{py3_sitescriptdir}/%{module} | |
102 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
103 | %endif |