]>
Commit | Line | Data |
---|---|---|
09518369 | 1 | # |
7e2ccfff | 2 | # Conditional build: |
5f5a14ac | 3 | %bcond_without doc # Sphinx documentation |
069130bc | 4 | %bcond_with tests # unit tests (some using network) |
5f5a14ac JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
09518369 | 7 | |
e99f893a | 8 | %define module pyquery |
f9c3689f MK |
9 | Summary: A jquery-like library for Python |
10 | Summary(pl.UTF-8): Podobna do jquery biblioteka dla Pythona | |
4614e422 | 11 | Name: python-%{module} |
b3b690f6 JB |
12 | Version: 1.4.1 |
13 | Release: 1 | |
4614e422 | 14 | License: BSD |
5f5a14ac JB |
15 | Group: Libraries/Python |
16 | #Source0Download: https://pypi.org/simple/pyquery/ | |
17 | Source0: http://files.pythonhosted.org/packages/source/p/pyquery/%{module}-%{version}.tar.gz | |
b3b690f6 | 18 | # Source0-md5: 7445c6de6db6618bf0670f624f2a82d4 |
5f5a14ac | 19 | URL: http://pypi.org/project/pyquery/ |
4614e422 | 20 | BuildRequires: rpm-pythonprov |
5f5a14ac | 21 | BuildRequires: rpmbuild(macros) >= 1.714 |
7e2ccfff | 22 | %if %{with python2} |
5f5a14ac | 23 | BuildRequires: python-devel >= 1:2.7 |
7e2ccfff | 24 | BuildRequires: python-setuptools |
d253b950 | 25 | %if %{with tests} |
09518369 | 26 | BuildRequires: python-WebOb |
5f5a14ac JB |
27 | BuildRequires: python-cssselect > 0.7.9 |
28 | BuildRequires: python-lxml >= 2.1 | |
29 | BuildRequires: python-nose | |
09518369 | 30 | BuildRequires: python-webtest |
d253b950 | 31 | %endif |
7e2ccfff AM |
32 | %endif |
33 | %if %{with python3} | |
b3b690f6 | 34 | BuildRequires: python3-devel >= 1:3.5 |
7e2ccfff | 35 | BuildRequires: python3-setuptools |
d253b950 | 36 | %if %{with tests} |
09518369 | 37 | BuildRequires: python3-WebOb |
5f5a14ac JB |
38 | BuildRequires: python3-cssselect > 0.7.9 |
39 | BuildRequires: python3-lxml >= 2.1 | |
40 | BuildRequires: python3-nose | |
09518369 | 41 | BuildRequires: python3-webtest |
d253b950 | 42 | %endif |
7e2ccfff | 43 | %endif |
5f5a14ac JB |
44 | %if %{with doc} |
45 | BuildRequires: sphinx-pdg | |
46 | %endif | |
47 | Requires: python-modules >= 1:2.7 | |
5f76d904 | 48 | BuildArch: noarch |
4614e422 | 49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
50 | ||
51 | %description | |
52 | Pyquery allows you to make jquery queries on xml documents. The API is | |
53 | as much as possible the similar to jquery. pyquery uses lxml for fast | |
54 | xml and html manipulation. | |
55 | ||
56 | %description -l pl.UTF-8 | |
f9c3689f | 57 | Pyquery pozwala na wykonywanie zapytań jquery na dokumentach XML. |
7e2ccfff AM |
58 | Interfejs jest jak to tylko możliwe podobny do jquery. Pyquery używa |
59 | lxml do szybkiej manipulacji plików XML i HTML. | |
60 | ||
61 | %package -n python3-%{module} | |
62 | Summary: A jquery-like library for Python | |
63 | Summary(pl.UTF-8): Podobna do jquery biblioteka dla Pythona | |
64 | Group: Libraries/Python | |
b3b690f6 | 65 | Requires: python3-modules >= 1:3.5 |
7e2ccfff AM |
66 | |
67 | %description -n python3-%{module} | |
68 | Pyquery allows you to make jquery queries on xml documents. The API is | |
69 | as much as possible the similar to jquery. pyquery uses lxml for fast | |
70 | xml and html manipulation. | |
71 | ||
72 | %description -n python3-%{module} -l pl.UTF-8 | |
73 | Pyquery pozwala na wykonywanie zapytań jquery na dokumentach XML. | |
74 | Interfejs jest jak to tylko możliwe podobny do jquery. Pyquery używa | |
75 | lxml do szybkiej manipulacji plików XML i HTML. | |
4614e422 | 76 | |
5f5a14ac JB |
77 | %package apidocs |
78 | Summary: API documentation for Python pyquery module | |
79 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pyquery | |
80 | Group: Documentation | |
81 | ||
82 | %description apidocs | |
83 | API documentation for Python pyquery module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API modułu Pythona pyquery. | |
87 | ||
4614e422 | 88 | %prep |
89 | %setup -q -n %{module}-%{version} | |
90 | ||
91 | %build | |
7e2ccfff | 92 | %if %{with python2} |
5f5a14ac JB |
93 | %py_build |
94 | ||
95 | %if %{with tests} | |
96 | nosetests-%{py_ver} tests | |
97 | %endif | |
7e2ccfff AM |
98 | %endif |
99 | ||
100 | %if %{with python3} | |
5f5a14ac JB |
101 | %py3_build |
102 | ||
103 | %if %{with tests} | |
104 | nosetests-%{py3_ver} tests | |
105 | %endif | |
106 | %endif | |
107 | ||
108 | %if %{with doc} | |
109 | PYTHONPATH=$(pwd) \ | |
110 | %{__make} -C docs html \ | |
111 | SPHINXBUILD=sphinx-build | |
7e2ccfff | 112 | %endif |
4614e422 | 113 | |
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
4614e422 | 116 | |
7e2ccfff | 117 | %if %{with python2} |
08122cf1 | 118 | %py_install |
4614e422 | 119 | |
4614e422 | 120 | %py_postclean |
7e2ccfff AM |
121 | %endif |
122 | ||
123 | %if %{with python3} | |
08122cf1 | 124 | %py3_install |
7e2ccfff | 125 | %endif |
4614e422 | 126 | |
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
7e2ccfff | 130 | %if %{with python2} |
4614e422 | 131 | %files |
132 | %defattr(644,root,root,755) | |
5f5a14ac JB |
133 | %doc CHANGES.rst LICENSE.txt README.rst |
134 | %{py_sitescriptdir}/pyquery | |
135 | %{py_sitescriptdir}/pyquery-%{version}-py*.egg-info | |
4614e422 | 136 | %endif |
7e2ccfff AM |
137 | |
138 | %if %{with python3} | |
139 | %files -n python3-%{module} | |
140 | %defattr(644,root,root,755) | |
5f5a14ac JB |
141 | %doc CHANGES.rst LICENSE.txt README.rst |
142 | %{py3_sitescriptdir}/pyquery | |
143 | %{py3_sitescriptdir}/pyquery-%{version}-py*.egg-info | |
144 | %endif | |
145 | ||
146 | %if %{with doc} | |
147 | %files apidocs | |
148 | %defattr(644,root,root,755) | |
e99f893a | 149 | %doc docs/_build/html/{_static,*.html,*.js} |
7e2ccfff | 150 | %endif |