]>
Commit | Line | Data |
---|---|---|
c82f8135 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
4c4d041c | 7 | %define module funcparserlib |
2a84d318 | 8 | Summary: Recursive descent parsing library based on functional combinators |
c82f8135 | 9 | Summary(pl.UTF-8): Biblioteka analizy rekurencyjnej oparta na kombinatorach funkcyjnych |
5a5ccf8f | 10 | Name: python-%{module} |
c82f8135 | 11 | Version: 0.3.6 |
69f35b4f | 12 | Release: 5 |
4c4d041c | 13 | License: MIT |
c82f8135 JB |
14 | Group: Libraries/Python |
15 | #Source0Download: https://pypi.org/simple/funcparserlib/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/f/funcparserlib/%{module}-%{version}.tar.gz | |
17 | # Source0-md5: 3aba546bdad5d0826596910551ce37c0 | |
18 | URL: https://github.com/vlasovskikh/funcparserlib | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.5 | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-2to3 >= 1:3.2 | |
25 | BuildRequires: python3-modules >= 1:3.2 | |
26 | BuildRequires: python3-setuptools | |
27 | %endif | |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | Requires: python-modules >= 1:2.5 | |
4c4d041c | 30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
c82f8135 JB |
34 | Recursive descent parsing library based on functional combinators. |
35 | ||
36 | %description -l pl.UTF-8 | |
37 | Biblioteka analizy rekurencyjnej oparta na kombinatorach funkcyjnych. | |
38 | ||
39 | %package -n python3-%{module} | |
40 | Summary: Recursive descent parsing library based on functional combinators | |
41 | Summary(pl.UTF-8): Biblioteka analizy rekurencyjnej oparta na kombinatorach funkcyjnych | |
42 | Group: Libraries/Python | |
43 | Requires: python3-modules >= 1:3.2 | |
44 | ||
45 | %description -n python3-%{module} | |
46 | Recursive descent parsing library based on functional combinators. | |
47 | ||
48 | %description -n python3-%{module} -l pl.UTF-8 | |
49 | Biblioteka analizy rekurencyjnej oparta na kombinatorach funkcyjnych. | |
4c4d041c | 50 | |
51 | %prep | |
52 | %setup -q -n %{module}-%{version} | |
4c4d041c | 53 | |
54 | %build | |
c82f8135 | 55 | %if %{with python2} |
3993f435 | 56 | %py_build |
4c4d041c | 57 | |
c82f8135 JB |
58 | %if %{with tests} |
59 | cd build-2/lib | |
60 | %{__python} -m unittest discover | |
61 | cd ../.. | |
62 | %endif | |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_build | |
67 | ||
68 | %if %{with tests} | |
69 | # run tests on 2to3'd sources | |
70 | cd build-3/lib | |
71 | %{__python3} -m unittest discover | |
72 | cd ../.. | |
73 | %endif | |
74 | %endif | |
75 | ||
4c4d041c | 76 | %install |
77 | rm -rf $RPM_BUILD_ROOT | |
4c4d041c | 78 | |
c82f8135 JB |
79 | %if %{with python2} |
80 | %py_install | |
81 | ||
82 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests | |
4c4d041c | 83 | %py_postclean |
c82f8135 JB |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
87 | %py3_install | |
88 | ||
89 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests | |
90 | %endif | |
4c4d041c | 91 | |
4c4d041c | 92 | %clean |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
c82f8135 | 95 | %if %{with python2} |
4c4d041c | 96 | %files |
97 | %defattr(644,root,root,755) | |
c82f8135 JB |
98 | %doc CHANGES LICENSE README doc/*.md |
99 | %{py_sitescriptdir}/%{module} | |
100 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %files -n python3-%{module} | |
105 | %defattr(644,root,root,755) | |
106 | %doc CHANGES LICENSE README doc/*.md | |
107 | %{py3_sitescriptdir}/%{module} | |
108 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
4c4d041c | 109 | %endif |