3 %bcond_without doc # don't build doc
4 %bcond_without tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 Summary: A flexible forms validation and rendering library for Python 2 web development
10 Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 2
11 Name: python-%{module}
15 Group: Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/wtforms/
17 Source0: https://files.pythonhosted.org/packages/source/W/WTForms/WTForms-%{version}.zip
18 # Source0-md5: 6938a541fafd1a1ae2f6b9b88588eef2
19 Patch0: %{name}-tests.patch
20 URL: http://wtforms.simplecodes.com/
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.710
25 BuildRequires: python-modules >= 1:2.6
26 BuildRequires: python-setuptools
28 BuildRequires: python-babel >= 1.3
29 %if %(test -f %{py_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?)
30 BuildRequires: python-babel(with_locale:de_CH)
32 %if %(test -f %{py_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?)
33 BuildRequires: python-babel(with_locale:de_DE)
35 %if %(test -f %{py_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?)
36 BuildRequires: python-babel(with_locale:es_ES)
38 %if %(test -f %{py_sitescriptdir}/babel/locale-data/en_US.dat; echo $?)
39 BuildRequires: python-babel(with_locale:en_US)
41 %if %(test -f %{py_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?)
42 BuildRequires: python-babel(with_locale:hi_IN)
44 BuildRequires: python-sqlalchemy
45 %if "%{py_ver}" < "2.7"
46 BuildRequires: python-ordereddict
51 BuildRequires: python3-modules >= 1:3.3
52 BuildRequires: python3-setuptools
54 BuildRequires: python3-babel >= 1.3
55 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?)
56 BuildRequires: python3-babel(with_locale:de_CH)
58 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?)
59 BuildRequires: python3-babel(with_locale:de_DE)
61 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?)
62 BuildRequires: python3-babel(with_locale:es_ES)
64 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/en_US.dat; echo $?)
65 BuildRequires: python3-babel(with_locale:en_US)
67 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?)
68 BuildRequires: python3-babel(with_locale:hi_IN)
70 BuildRequires: python3-sqlalchemy
71 BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_CH.dat
72 BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_DE.dat
73 BuildRequires: %{py3_sitescriptdir}/babel/locale-data/es_ES.dat
74 BuildRequires: %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat
77 Requires: python-modules >= 1:2.6
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 A flexible forms validation and rendering library for Python web
85 %description -l pl.UTF-8
86 Elastyczna biblioteka do skadania i kontroli poprawności formularzy
89 %package -n python3-%{module}
90 Summary: A flexible forms validation and rendering library for Python 3 web development
91 Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 3
92 Group: Libraries/Python
93 Requires: python3-modules >= 1:3.3
95 %description -n python3-%{module}
96 A flexible forms validation and rendering library for python web
99 %description -n python3-%{module} -l pl.UTF-8
100 Elastyczna biblioteka do skadania i kontroli poprawności formularzy
104 Summary: API documentation for Python WTForms module
105 Summary(pl.UTF-8): Dokumentacja API modułu Pythona WTForms
109 API documentation for Python WTForms module.
111 %description apidocs -l pl.UTF-8
112 Dokumentacja API modułu Pythona WTForms.
115 %setup -q -n WTForms-%{version}
118 # disable failing test
119 %{__sed} -i "/OPTIONAL_TESTS/ s/'ext_django\.tests', //" tests/runtests.py
126 %{__python} tests/runtests.py
134 %{__python3} tests/runtests.py
139 %{__make} -C docs -j1 html
143 rm -rf $RPM_BUILD_ROOT
156 rm -rf $RPM_BUILD_ROOT
160 %defattr(644,root,root,755)
161 %doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md
162 %{py_sitescriptdir}/%{module}
163 %{py_sitescriptdir}/WTForms-%{version}-py*.egg-info
167 %files -n python3-%{module}
168 %defattr(644,root,root,755)
169 %doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md
170 %{py3_sitescriptdir}/%{module}
171 %{py3_sitescriptdir}/WTForms-%{version}-py*.egg-info
176 %defattr(644,root,root,755)
177 %doc docs/_build/html/{_static,*.html,*.js}