]> git.pld-linux.org Git - packages/python-funcparserlib.git/blob - python-funcparserlib.spec
rebuild with tests and docs
[packages/python-funcparserlib.git] / python-funcparserlib.spec
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
7 %define         module  funcparserlib
8 Summary:        Recursive descent parsing library based on functional combinators
9 Summary(pl.UTF-8):      Biblioteka analizy rekurencyjnej oparta na kombinatorach funkcyjnych
10 Name:           python-%{module}
11 Version:        0.3.6
12 Release:        5
13 License:        MIT
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
30 BuildArch:      noarch
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
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.
50
51 %prep
52 %setup -q -n %{module}-%{version}
53
54 %build
55 %if %{with python2}
56 %py_build
57
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
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{with python2}
80 %py_install
81
82 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
83 %py_postclean
84 %endif
85
86 %if %{with python3}
87 %py3_install
88
89 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
90 %endif
91
92 %clean
93 rm -rf $RPM_BUILD_ROOT
94
95 %if %{with python2}
96 %files
97 %defattr(644,root,root,755)
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
109 %endif
This page took 0.119089 seconds and 3 git commands to generate.