]> git.pld-linux.org Git - packages/python-wtforms.git/blob - python-wtforms.spec
2962aaa50c27a5e7dc53c04e047f4671eca2593c
[packages/python-wtforms.git] / python-wtforms.spec
1 #
2 # Conditional build:
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
7
8 %define         module  wtforms
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}
12 Version:        2.1
13 Release:        1
14 License:        BSD
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
23 BuildRequires:  unzip
24 %if %{with python2}
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
44 BuildRequires:  python-sqlalchemy
45 %if "%{py_ver}" < "2.7"
46 BuildRequires:  python-ordereddict
47 %endif
48 %endif
49 %endif
50 %if %{with python3}
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
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
75 %endif
76 %endif
77 Requires:       python-modules >= 1:2.6
78 BuildArch:      noarch
79 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81 %description
82 A flexible forms validation and rendering library for Python web
83 development.
84
85 %description -l pl.UTF-8
86 Elastyczna biblioteka do skadania i kontroli poprawności formularzy
87 WWW w Pythonie.
88
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
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
100 Elastyczna biblioteka do skadania i kontroli poprawności formularzy
101 WWW w Pythonie.
102
103 %package apidocs
104 Summary:        API documentation for Python WTForms module
105 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona WTForms
106 Group:          Documentation
107
108 %description apidocs
109 API documentation for Python WTForms module.
110
111 %description apidocs -l pl.UTF-8
112 Dokumentacja API modułu Pythona WTForms.
113
114 %prep
115 %setup -q -n WTForms-%{version}
116 %patch0 -p1
117
118 # disable failing test
119 %{__sed} -i "/OPTIONAL_TESTS/ s/'ext_django\.tests', //" tests/runtests.py
120
121 %build
122 %if %{with python2}
123 %py_build
124
125 %if %{with tests}
126 %{__python} tests/runtests.py
127 %endif
128 %endif
129
130 %if %{with python3}
131 %py3_build
132
133 %if %{with tests}
134 %{__python3} tests/runtests.py
135 %endif
136 %endif
137
138 %if %{with doc}
139 %{__make} -C docs -j1 html
140 %endif
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %py_install
147
148 %py_postclean
149 %endif
150
151 %if %{with python3}
152 %py3_install
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
162 %{py_sitescriptdir}/%{module}
163 %{py_sitescriptdir}/WTForms-%{version}-py*.egg-info
164 %endif
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)
177 %doc docs/_build/html/{_static,*.html,*.js}
178 %endif
This page took 0.072987 seconds and 2 git commands to generate.