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