]>
Commit | Line | Data |
---|---|---|
e6b6a62d MK |
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 web development | |
10 | Summary(pl.UTF-8): Biblioteka umożliwiająca generację i walidację formularzy html w jezyku python | |
11 | Name: python-%{module} | |
12 | Version: 2.0.1 | |
d12f3430 | 13 | Release: 7 |
e6b6a62d MK |
14 | License: BSD |
15 | Group: Development/Languages/Python | |
16 | Source0: http://pypi.python.org/packages/source/W/WTForms/WTForms-%{version}.zip | |
17 | # Source0-md5: aaac94c137b3cd63efeb3ded51082cde | |
18 | URL: http://wtforms.simplecodes.com/ | |
19 | BuildRequires: rpm-pythonprov | |
81c0553a | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
e6b6a62d MK |
21 | BuildRequires: unzip |
22 | %if %{with python2} | |
23 | BuildRequires: python-distribute | |
7d4dd796 | 24 | BuildRequires: python-sqlalchemy |
e6b6a62d MK |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-distribute | |
28 | BuildRequires: python3-modules | |
7d4dd796 | 29 | BuildRequires: python3-sqlalchemy |
e6b6a62d MK |
30 | %endif |
31 | ||
32 | Requires: python-modules | |
33 | BuildArch: noarch | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | A flexible forms validation and rendering library for python web | |
38 | development. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | Biblioteka umożliwiająca generację i walidację formularzy html w | |
42 | jezyku python | |
43 | ||
44 | %package -n python3-%{module} | |
45 | Summary: - | |
46 | Summary(pl.UTF-8): - | |
47 | Group: Libraries/Python | |
48 | Requires: python3-modules | |
49 | ||
50 | %description -n python3-%{module} | |
51 | A flexible forms validation and rendering library for python web | |
52 | development. | |
53 | ||
54 | %description -n python3-%{module} -l pl.UTF-8 | |
55 | Biblioteka umożliwiająca generację i walidację formularzy html w | |
56 | jezyku python | |
57 | ||
58 | %package apidocs | |
59 | Summary: %{module} API documentation | |
60 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
61 | Group: Documentation | |
62 | ||
63 | %description apidocs | |
64 | API documentation for %{module}. | |
65 | ||
66 | %description apidocs -l pl.UTF-8 | |
67 | Dokumentacja API %{module}. | |
68 | ||
69 | ||
70 | %prep | |
71 | %setup -q -n WTForms-%{version} | |
72 | ||
73 | %build | |
74 | %if %{with python2} | |
583220b6 | 75 | %py_build %{?with_tests:test} |
e6b6a62d MK |
76 | %endif |
77 | ||
78 | %if %{with python3} | |
583220b6 | 79 | %py3_build %{?with_tests:test} |
e6b6a62d MK |
80 | %endif |
81 | ||
82 | %if %{with doc} | |
83 | cd docs | |
84 | %{__make} -j1 html | |
85 | rm -rf _build/html/_sources | |
86 | %endif | |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
583220b6 | 92 | %py_install |
e6b6a62d MK |
93 | |
94 | %py_postclean | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
583220b6 | 98 | %py3_install |
e6b6a62d MK |
99 | %endif |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %if %{with python2} | |
105 | %files | |
106 | %defattr(644,root,root,755) | |
107 | %doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md | |
108 | # change %{py_sitedir} to %{py_sitescriptdir} for 'noarch' packages! | |
109 | %{py_sitescriptdir}/%{module} | |
110 | %if "%{py_ver}" > "2.4" | |
111 | %{py_sitescriptdir}/WTForms-%{version}-py*.egg-info | |
112 | %endif | |
113 | %endif | |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-%{module} | |
117 | %defattr(644,root,root,755) | |
118 | %doc AUTHORS.txt CHANGES.rst LICENSE.txt README.md | |
119 | %{py3_sitescriptdir}/%{module} | |
120 | %{py3_sitescriptdir}/WTForms-%{version}-py*.egg-info | |
121 | %endif | |
122 | ||
123 | %if %{with doc} | |
124 | %files apidocs | |
125 | %defattr(644,root,root,755) | |
126 | %doc docs/_build/html/* | |
127 | %endif | |
128 | ||
129 |