]>
Commit | Line | Data |
---|---|---|
e6b6a62d MK |
1 | # |
2 | # Conditional build: | |
27c5a0ad | 3 | %bcond_without doc # don't build doc |
e6b6a62d MK |
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 | |
7 | ||
8 | %define module wtforms | |
27c5a0ad JB |
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 | |
e6b6a62d | 11 | Name: python-%{module} |
27c5a0ad | 12 | Version: 2.1 |
1e99814f | 13 | Release: 3 |
e6b6a62d MK |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
27c5a0ad JB |
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 | |
e6b6a62d MK |
20 | URL: http://wtforms.simplecodes.com/ |
21 | BuildRequires: rpm-pythonprov | |
81c0553a | 22 | BuildRequires: rpmbuild(macros) >= 1.710 |
e6b6a62d MK |
23 | BuildRequires: unzip |
24 | %if %{with python2} | |
27c5a0ad JB |
25 | BuildRequires: python-modules >= 1:2.6 |
26 | BuildRequires: python-setuptools | |
27 | %if %{with tests} | |
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) | |
31 | %endif | |
32 | %if %(test -f %{py_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?) | |
33 | BuildRequires: python-babel(with_locale:de_DE) | |
34 | %endif | |
35 | %if %(test -f %{py_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?) | |
36 | BuildRequires: python-babel(with_locale:es_ES) | |
37 | %endif | |
38 | %if %(test -f %{py_sitescriptdir}/babel/locale-data/en_US.dat; echo $?) | |
39 | BuildRequires: python-babel(with_locale:en_US) | |
40 | %endif | |
41 | %if %(test -f %{py_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?) | |
42 | BuildRequires: python-babel(with_locale:hi_IN) | |
43 | %endif | |
7d4dd796 | 44 | BuildRequires: python-sqlalchemy |
27c5a0ad JB |
45 | %if "%{py_ver}" < "2.7" |
46 | BuildRequires: python-ordereddict | |
47 | %endif | |
48 | %endif | |
e6b6a62d MK |
49 | %endif |
50 | %if %{with python3} | |
27c5a0ad JB |
51 | BuildRequires: python3-modules >= 1:3.3 |
52 | BuildRequires: python3-setuptools | |
53 | %if %{with tests} | |
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) | |
57 | %endif | |
58 | %if %(test -f %{py3_sitescriptdir}/babel/locale-data/de_DE.dat; echo $?) | |
59 | BuildRequires: python3-babel(with_locale:de_DE) | |
60 | %endif | |
61 | %if %(test -f %{py3_sitescriptdir}/babel/locale-data/es_ES.dat; echo $?) | |
62 | BuildRequires: python3-babel(with_locale:es_ES) | |
63 | %endif | |
64 | %if %(test -f %{py3_sitescriptdir}/babel/locale-data/en_US.dat; echo $?) | |
65 | BuildRequires: python3-babel(with_locale:en_US) | |
66 | %endif | |
67 | %if %(test -f %{py3_sitescriptdir}/babel/locale-data/hi_IN.dat; echo $?) | |
68 | BuildRequires: python3-babel(with_locale:hi_IN) | |
69 | %endif | |
7d4dd796 | 70 | BuildRequires: python3-sqlalchemy |
27c5a0ad JB |
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 | |
e6b6a62d | 75 | %endif |
27c5a0ad JB |
76 | %endif |
77 | Requires: python-modules >= 1:2.6 | |
e6b6a62d MK |
78 | BuildArch: noarch |
79 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
80 | ||
81 | %description | |
27c5a0ad | 82 | A flexible forms validation and rendering library for Python web |
e6b6a62d MK |
83 | development. |
84 | ||
85 | %description -l pl.UTF-8 | |
27c5a0ad JB |
86 | Elastyczna biblioteka do skadania i kontroli poprawności formularzy |
87 | WWW w Pythonie. | |
e6b6a62d MK |
88 | |
89 | %package -n python3-%{module} | |
27c5a0ad JB |
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 | |
e6b6a62d | 92 | Group: Libraries/Python |
27c5a0ad | 93 | Requires: python3-modules >= 1:3.3 |
e6b6a62d MK |
94 | |
95 | %description -n python3-%{module} | |
96 | A flexible forms validation and rendering library for python web | |
97 | development. | |
98 | ||
99 | %description -n python3-%{module} -l pl.UTF-8 | |
27c5a0ad JB |
100 | Elastyczna biblioteka do skadania i kontroli poprawności formularzy |
101 | WWW w Pythonie. | |
e6b6a62d MK |
102 | |
103 | %package apidocs | |
27c5a0ad JB |
104 | Summary: API documentation for Python WTForms module |
105 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona WTForms | |
e6b6a62d MK |
106 | Group: Documentation |
107 | ||
108 | %description apidocs | |
27c5a0ad | 109 | API documentation for Python WTForms module. |
e6b6a62d MK |
110 | |
111 | %description apidocs -l pl.UTF-8 | |
27c5a0ad | 112 | Dokumentacja API modułu Pythona WTForms. |
e6b6a62d MK |
113 | |
114 | %prep | |
115 | %setup -q -n WTForms-%{version} | |
27c5a0ad JB |
116 | %patch0 -p1 |
117 | ||
118 | # disable failing test | |
119 | %{__sed} -i "/OPTIONAL_TESTS/ s/'ext_django\.tests', //" tests/runtests.py | |
e6b6a62d MK |
120 | |
121 | %build | |
122 | %if %{with python2} | |
27c5a0ad JB |
123 | %py_build |
124 | ||
125 | %if %{with tests} | |
126 | %{__python} tests/runtests.py | |
127 | %endif | |
e6b6a62d MK |
128 | %endif |
129 | ||
130 | %if %{with python3} | |
27c5a0ad JB |
131 | %py3_build |
132 | ||
133 | %if %{with tests} | |
134 | %{__python3} tests/runtests.py | |
135 | %endif | |
e6b6a62d MK |
136 | %endif |
137 | ||
138 | %if %{with doc} | |
27c5a0ad | 139 | %{__make} -C docs -j1 html |
e6b6a62d MK |
140 | %endif |
141 | ||
142 | %install | |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
145 | %if %{with python2} | |
583220b6 | 146 | %py_install |
e6b6a62d MK |
147 | |
148 | %py_postclean | |
149 | %endif | |
150 | ||
151 | %if %{with python3} | |
583220b6 | 152 | %py3_install |
e6b6a62d MK |
153 | %endif |
154 | ||
155 | %clean | |
156 | rm -rf $RPM_BUILD_ROOT | |
157 | ||
158 | %if %{with python2} | |
159 | %files | |
160 | %defattr(644,root,root,755) | |
161 | %doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md | |
e6b6a62d | 162 | %{py_sitescriptdir}/%{module} |
e6b6a62d MK |
163 | %{py_sitescriptdir}/WTForms-%{version}-py*.egg-info |
164 | %endif | |
e6b6a62d MK |
165 | |
166 | %if %{with python3} | |
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 | |
172 | %endif | |
173 | ||
174 | %if %{with doc} | |
175 | %files apidocs | |
176 | %defattr(644,root,root,755) | |
27c5a0ad | 177 | %doc docs/_build/html/{_static,*.html,*.js} |
e6b6a62d | 178 | %endif |