3 %bcond_without doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
10 %define pypi_name xdis
11 Summary: Python cross-version byte-code disassembler and marshal routines
12 Name: python-%{module}
16 Group: Libraries/Python
17 Source0: https://files.pythonhosted.org/packages/source/x/%{module}/%{module}-%{version}.tar.gz
18 # Source0-md5: 8aca98d1837df4b0073fe1cacd65d91d
19 URL: https://github.com/rocky/python-xdis/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-nose >= 1.0
24 BuildRequires: python-setuptools
27 BuildRequires: python3-nose >= 1.0
28 BuildRequires: python3-setuptools
30 Requires: python-setuptools
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 The Python dis module allows you to disassemble byte from the same
36 version of Python that you are running on. But what about bytecode
37 from different versions?
39 That's what this package is for. It can marshal load Python bytecodes
40 from different versions of Python. The command-line routine
41 pydisssemble will show disassembly output using Python 3.5 disassembly
44 It accepts bytecodes from Python version 2.3 to 3.5 or so. The code
45 requires Python 2.5 or later and has been tested on Python running
46 versions 2.6, 2.7, pypy-5.0.1, 3.2, 3.3, 3.4 and 3.5.
48 %package -n python3-%{pypi_name}
49 Summary: Python cross-version byte-code disassembler and marshal routines
50 Group: Libraries/Python
51 Requires: python3-setuptools
53 %description -n python3-%{pypi_name}
54 The Python dis module allows you to disassemble byte from the same
55 version of Python that you are running on. But what about bytecode
56 from different versions?
58 That's what this package is for. It can marshal load Python bytecodes
59 from different versions of Python. The command-line routine
60 pydisssemble will show disassembly output using Python 3.5 disassembly
63 It accepts bytecodes from Python version 2.3 to 3.5 or so. The code
64 requires Python 2.5 or later and has been tested on Python running
65 versions 2.6, 2.7, pypy-5.0.1, 3.2, 3.3, 3.4 and 3.5.
68 %setup -q -n %{module}-%{version}
70 # Remove bundled egg-info
71 %{__rm} -r %{module}.egg-info
76 %{?with_tests:%{__make} PYTHON=python check}
81 %{?with_tests:%{__make} PYTHON=python3 check}
85 rm -rf $RPM_BUILD_ROOT
89 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pydisasm{,-2}
94 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pydisasm{,-3}
98 rm -rf $RPM_BUILD_ROOT
102 %defattr(644,root,root,755)
104 %attr(755,root,root) %{_bindir}/pydisasm-2
105 %{py_sitescriptdir}/%{module}
106 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
110 %files -n python3-%{pypi_name}
111 %defattr(644,root,root,755)
113 %attr(755,root,root) %{_bindir}/pydisasm-3
114 %{py3_sitescriptdir}/%{module}
115 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info