]>
Commit | Line | Data |
---|---|---|
274a0101 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # unit tests (test data not included in release tarballs) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Parser for Coffeescript Object Notation (CSON) | |
8 | Summary(pl.UTF-8): Parser formatu CSON (Coffeescript Object Notation) | |
9 | Name: python-cson | |
10 | Version: 0.8 | |
c1985ec6 | 11 | Release: 3 |
274a0101 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/cson/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/c/cson/cson-%{version}.tar.gz | |
16 | # Source0-md5: 02f738b7f765e88b4222fe2126a685db | |
17 | URL: https://pypi.org/project/cson/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.7 | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | BuildRequires: python-pytest | |
23 | BuildRequires: python-speg | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.5 | |
28 | BuildRequires: python3-setuptools | |
29 | %if %{with tests} | |
30 | BuildRequires: python3-pytest | |
31 | BuildRequires: python3-speg | |
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 | A Python parser for the Coffeescript Object Notation (CSON). | |
42 | ||
43 | %description -l pl.UTF-8 | |
44 | Pythonowy parser formatu CSON (Coffeescript Object Notation - notacji | |
45 | obiektów z języka Coffeescript). | |
46 | ||
47 | %package -n python3-cson | |
48 | Summary: Parser for Coffeescript Object Notation (CSON) | |
49 | Summary(pl.UTF-8): Parser formatu CSON (Coffeescript Object Notation) | |
50 | Group: Libraries/Python | |
51 | Requires: python3-modules >= 1:3.5 | |
52 | ||
53 | %description -n python3-cson | |
54 | A Python parser for the Coffeescript Object Notation (CSON). | |
55 | ||
56 | %description -n python3-cson -l pl.UTF-8 | |
57 | Pythonowy parser formatu CSON (Coffeescript Object Notation - notacji | |
58 | obiektów z języka Coffeescript). | |
59 | ||
60 | %prep | |
61 | %setup -q -n cson-%{version} | |
62 | ||
63 | %build | |
64 | %if %{with python2} | |
65 | %py_build | |
66 | ||
67 | %if %{with tests} | |
68 | %{__python} -m pytest test | |
69 | %endif | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
73 | %py3_build | |
74 | ||
75 | %if %{with tests} | |
76 | %{__python3} -m pytest test | |
77 | %endif | |
78 | %endif | |
79 | ||
80 | %install | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %if %{with python2} | |
84 | %py_install | |
85 | ||
86 | %py_postclean | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_install | |
91 | %endif | |
92 | ||
93 | %clean | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %if %{with python2} | |
97 | %files | |
98 | %defattr(644,root,root,755) | |
99 | %doc README.md | |
100 | %{py_sitescriptdir}/cson | |
101 | %{py_sitescriptdir}/cson-%{version}-py*.egg-info | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %files -n python3-cson | |
106 | %defattr(644,root,root,755) | |
107 | %doc README.md | |
108 | %{py3_sitescriptdir}/cson | |
109 | %{py3_sitescriptdir}/cson-%{version}-py*.egg-info | |
110 | %endif |