]> git.pld-linux.org Git - packages/python-xdis.git/blob - python-xdis.spec
rebuild with tests and docs
[packages/python-xdis.git] / python-xdis.spec
1 #
2 # Conditional build:
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
7
8 %define         module          xdis
9 %define         egg_name        xdis
10 %define         pypi_name       xdis
11 Summary:        Python cross-version byte-code disassembler and marshal routines
12 Name:           python-%{module}
13 Version:        4.1.2
14 Release:        4
15 License:        MIT
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
22 %if %{with python2}
23 BuildRequires:  python-nose >= 1.0
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-nose >= 1.0
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       python-setuptools
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
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?
38
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
42 conventions
43
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.
47
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
52
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?
57
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
61 conventions
62
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.
66
67 %prep
68 %setup -q -n %{module}-%{version}
69
70 # Remove bundled egg-info
71 %{__rm} -r %{module}.egg-info
72
73 %build
74 %if %{with python2}
75 %py_build
76 %{?with_tests:%{__make} PYTHON=python check}
77 %endif
78
79 %if %{with python3}
80 %py3_build
81 %{?with_tests:%{__make} PYTHON=python3 check}
82 %endif
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 %if %{with python2}
87 %py_install
88 %py_postclean
89 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pydisasm{,-2}
90 %endif
91
92 %if %{with python3}
93 %py3_install
94 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pydisasm{,-3}
95 %endif
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %if %{with python2}
101 %files
102 %defattr(644,root,root,755)
103 %doc README.rst
104 %attr(755,root,root) %{_bindir}/pydisasm-2
105 %{py_sitescriptdir}/%{module}
106 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
107 %endif
108
109 %if %{with python3}
110 %files -n python3-%{pypi_name}
111 %defattr(644,root,root,755)
112 %doc README.rst
113 %attr(755,root,root) %{_bindir}/pydisasm-3
114 %{py3_sitescriptdir}/%{module}
115 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
116 %endif
This page took 0.125929 seconds and 3 git commands to generate.