]> git.pld-linux.org Git - packages/python-uncompyle6.git/blob - python-uncompyle6.spec
2122b744635a5e3a48bb40ed2f49f4e56d42e2f0
[packages/python-uncompyle6.git] / python-uncompyle6.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 %define         module          uncompyle6
8 %define         egg_name        uncompyle6
9 %define         pypi_name       uncompyle6
10 Summary:        A Python decompiler, disassembler and cross-version bytecode library
11 Name:           python-%{pypi_name}
12 Version:        2.7.0
13 Release:        4
14 License:        MIT
15 Group:          Applications
16 Source0:        https://github.com/rocky/python-uncompyle6/archive/release-%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5:  17887c06c40b23641490815432c44b99
18 URL:            https://github.com/rocky/python-uncompyle6/
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
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
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
55 %prep
56 %setup -qn %{name}-release-%{version}
57
58 # There is something wrong with this file that breaks tests
59 %{__rm} test/bytecode_2.4/02_complex.pyc
60
61 %build
62 %if %{with python2}
63 %py_build
64 %endif
65
66 %if %{with python3}
67 %py3_build
68 %endif
69
70 %{?with_tests:%{__make} PYTHONPATH=$(pwd) check}
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
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}
83 %py_install
84 %py_postclean
85 %endif
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %if %{with python2}
91 %files
92 %defattr(644,root,root,755)
93 %attr(755,root,root) %{_bindir}/pydisassemble
94 %attr(755,root,root) %{_bindir}/uncompyle6
95 %{py_sitescriptdir}/%{module}
96 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
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
This page took 0.078449 seconds and 2 git commands to generate.