]>
Commit | Line | Data |
---|---|---|
4dc10c99 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # unit tests (using local python installation, failing on python 3.9) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Read/rewrite/write Python ASTs | |
8 | Summary(pl.UTF-8): Odczyt/przepisywanie/zapis pythonowych AST | |
9 | Name: python-astor | |
10 | Version: 0.8.1 | |
286be1e5 | 11 | Release: 2 |
4dc10c99 JB |
12 | License: BSD |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/astor/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/a/astor/astor-%{version}.tar.gz | |
16 | # Source0-md5: 83ab4ee6598f0381d94ed6949a6d6da2 | |
17 | URL: https://pypi.org/project/astor/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.7 | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | BuildRequires: python-astunparse | |
23 | BuildRequires: python-nose | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.4 | |
28 | BuildRequires: python3-setuptools | |
29 | %if %{with tests} | |
30 | BuildRequires: python3-astunparse | |
31 | BuildRequires: python3-nose | |
32 | %endif | |
33 | %endif | |
34 | BuildRequires: rpm-pythonprov | |
35 | BuildRequires: rpmbuild(macros) >= 1.714 | |
36 | Requires: python-modules >= 1:2.7 | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | astor is designed to allow easy manipulation of Python source via the | |
42 | AST. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | astor powstał, aby umożliwić łatwe operowanie na kodzie źródłowym w | |
46 | Pythonie poprzez AST. | |
47 | ||
48 | %package -n python3-astor | |
49 | Summary: Read/rewrite/write Python ASTs | |
50 | Summary(pl.UTF-8): Odczyt/przepisywanie/zapis pythonowych AST | |
51 | Group: Libraries/Python | |
52 | Requires: python3-modules >= 1:3.4 | |
53 | ||
54 | %description -n python3-astor | |
55 | astor is designed to allow easy manipulation of Python source via the | |
56 | AST. | |
57 | ||
58 | %description -n python3-astor -l pl.UTF-8 | |
59 | astor powstał, aby umożliwić łatwe operowanie na kodzie źródłowym w | |
60 | Pythonie poprzez AST. | |
61 | ||
62 | %prep | |
63 | %setup -q -n astor-%{version} | |
64 | ||
65 | %build | |
66 | %if %{with python2} | |
67 | %py_build | |
68 | ||
69 | %if %{with tests} | |
70 | nosetests-%{py_ver} tests | |
71 | %endif | |
72 | %endif | |
73 | ||
74 | %if %{with python3} | |
75 | %py3_build | |
76 | ||
77 | %if %{with tests} | |
78 | nosetests-%{py3_ver} tests | |
79 | %endif | |
80 | %endif | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %if %{with python2} | |
86 | %py_install | |
87 | ||
88 | %py_postclean | |
89 | %endif | |
90 | ||
91 | %if %{with python3} | |
92 | %py3_install | |
93 | %endif | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %files | |
100 | %defattr(644,root,root,755) | |
101 | %doc AUTHORS LICENSE README.rst | |
102 | %{py_sitescriptdir}/astor | |
103 | %{py_sitescriptdir}/astor-%{version}-py*.egg-info | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %files -n python3-astor | |
108 | %defattr(644,root,root,755) | |
109 | %doc AUTHORS LICENSE README.rst | |
110 | %{py3_sitescriptdir}/astor | |
111 | %{py3_sitescriptdir}/astor-%{version}-py*.egg-info | |
112 | %endif |