# # Conditional build: %bcond_without doc # don't build doc %bcond_without tests # do not perform "make test" %bcond_without python2 # CPython 2.x module %bcond_without python3 # CPython 3.x module %define module wtforms Summary: A flexible forms validation and rendering library for Python 2 web development Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 2 Name: python-%{module} Version: 2.2.1 Release: 4 License: BSD Group: Development/Languages/Python #Source0Download: https://pypi.org/simple/wtforms/ Source0: https://github.com/wtforms/wtforms/archive/%{version}/%{module}-%{version}.tar.gz # Source0-md5: b43b08c4fc5c8f9fc1b980e939a71811 URL: http://wtforms.simplecodes.com/ BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.710 BuildRequires: unzip %if %{with python2} BuildRequires: python-modules >= 1:2.6 BuildRequires: python-setuptools %if %{with tests} BuildRequires: python-babel >= 1.3 %if %(test -f %{py_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?) BuildRequires: python-babel(with_locale:de_CH) %endif %if %(test -f %{py_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?) BuildRequires: python-babel(with_locale:de_DE) %endif %if %(test -f %{py_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?) BuildRequires: python-babel(with_locale:es_ES) %endif %if %(test -f %{py_sitescriptdir}/babel/locale-data/en_US.dat; echo $?) BuildRequires: python-babel(with_locale:en_US) %endif %if %(test -f %{py_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?) BuildRequires: python-babel(with_locale:hi_IN) %endif BuildRequires: python-sqlalchemy %if "%{py_ver}" < "2.7" BuildRequires: python-ordereddict %endif %endif %endif %if %{with python3} BuildRequires: python3-modules >= 1:3.3 BuildRequires: python3-setuptools %if %{with tests} BuildRequires: python3-babel >= 1.3 %if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_CH.dat; echo $?) BuildRequires: python3-babel(with_locale:de_CH) %endif %if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?) BuildRequires: python3-babel(with_locale:de_DE) %endif %if %(test -f %{py3_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?) BuildRequires: python3-babel(with_locale:es_ES) %endif %if %(test -f %{py3_sitescriptdir}/babel/locale-data/en_US.dat; echo $?) BuildRequires: python3-babel(with_locale:en_US) %endif %if %(test -f %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?) BuildRequires: python3-babel(with_locale:hi_IN) %endif BuildRequires: python3-sqlalchemy BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_CH.dat BuildRequires: %{py3_sitescriptdir}/babel/locale-data/de_DE.dat BuildRequires: %{py3_sitescriptdir}/babel/locale-data/es_ES.dat BuildRequires: %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat %endif %endif Requires: python-modules >= 1:2.6 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description A flexible forms validation and rendering library for Python web development. %description -l pl.UTF-8 Elastyczna biblioteka do skadania i kontroli poprawności formularzy WWW w Pythonie. %package -n python3-%{module} Summary: A flexible forms validation and rendering library for Python 3 web development Summary(pl.UTF-8): Elastyczna biblioteka do generowania i walidacji formularzy WWW w Pythonie 3 Group: Libraries/Python Requires: python3-modules >= 1:3.3 %description -n python3-%{module} A flexible forms validation and rendering library for python web development. %description -n python3-%{module} -l pl.UTF-8 Elastyczna biblioteka do skadania i kontroli poprawności formularzy WWW w Pythonie. %package apidocs Summary: API documentation for Python WTForms module Summary(pl.UTF-8): Dokumentacja API modułu Pythona WTForms Group: Documentation %description apidocs API documentation for Python WTForms module. %description apidocs -l pl.UTF-8 Dokumentacja API modułu Pythona WTForms. %prep %setup -q -n %{module}-%{version} # disable failing test %{__sed} -i "/OPTIONAL_TESTS/ s/'ext_django\.tests', //" tests/runtests.py %build %if %{with python2} %py_build %if %{with tests} %{__python} tests/runtests.py %endif %endif %if %{with python3} %py3_build %if %{with tests} %{__python3} tests/runtests.py %endif %endif %if %{with doc} %{__make} -C docs -j1 html %endif %install rm -rf $RPM_BUILD_ROOT %if %{with python2} %py_install %py_postclean %endif %if %{with python3} %py3_install %endif %clean rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) %doc AUTHORS.rst CHANGES.rst LICENSE.rst README.rst %{py_sitescriptdir}/%{module} %{py_sitescriptdir}/WTForms-%{version}-py*.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) %doc AUTHORS.rst CHANGES.rst LICENSE.rst README.rst %{py3_sitescriptdir}/%{module} %{py3_sitescriptdir}/WTForms-%{version}-py*.egg-info %endif %if %{with doc} %files apidocs %defattr(644,root,root,755) %doc docs/_build/html/{_static,*.html,*.js} %endif