]> git.pld-linux.org Git - packages/python-FormEncode.git/blob - python-FormEncode.spec
rebuild with python 3.10
[packages/python-FormEncode.git] / python-FormEncode.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define module  FormEncode
9 Summary:        HTML form validation, generation, and convertion package
10 Summary(pl.UTF-8):      Moduł do walidacji, tworzenia i konwersji formularzy HTML
11 Name:           python-%{module}
12 Version:        1.3.1
13 Release:        3
14 License:        PSF
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/project/FormEncode/
17 Source0:        https://files.pythonhosted.org/packages/source/F/FormEncode/%{module}-%{version}.tar.gz
18 # Source0-md5:  16fbefb206064eb93a6719f054a19b3b
19 Patch0:         %{name}-pycountry.patch
20 URL:            http://formencode.org/
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.6
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-dns
26 BuildRequires:  python-nose
27 BuildRequires:  python-pycountry >= 16.10.23
28 %endif
29 %endif
30 %if %{with python3}
31 BuildRequires:  python3-2to3 >= 1:3.2
32 BuildRequires:  python3-modules >= 1:3.2
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-dns
36 BuildRequires:  python3-nose
37 BuildRequires:  python3-pycountry >= 16.10.23
38 %endif
39 %endif
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  rpmbuild(macros) >= 1.714
42 BuildRequires:  sed >= 4.0
43 Requires:       python-modules >= 1:2.6
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 FormEncode validates and converts nested structures. It allows for a
49 declarative form of defining the validation, and decoupled processes
50 for filling and generating forms.
51
52 %description -l pl.UTF-8
53 FormEncode służy do sprawdzania poprawności i konwersji zagnieżdżonych
54 struktur. Pozwala na deklaratywny sposób definiowania reguł
55 poprawności i niezależne od nich wypełnianie i generowanie formularzy.
56
57 %package -n python3-%{module}
58 Summary:        HTML form validation, generation, and convertion package
59 Summary(pl.UTF-8):      Moduł do walidacji, tworzenia i konwersji formularzy HTML
60 Group:          Libraries/Python
61 Requires:       python3-modules >= 1:3.2
62
63 %description -n python3-%{module}
64 FormEncode validates and converts nested structures. It allows for a
65 declarative form of defining the validation, and decoupled processes
66 for filling and generating forms.
67
68 %description -n python3-%{module} -l pl.UTF-8
69 FormEncode służy do sprawdzania poprawności i konwersji zagnieżdżonych
70 struktur. Pozwala na deklaratywny sposób definiowania reguł
71 poprawności i niezależne od nich wypełnianie i generowanie formularzy.
72
73 %package apidocs
74 Summary:        API documentation for Python FormEncode module
75 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona FormEncode
76 Group:          Documentation
77
78 %description apidocs
79 API documentation for Python FormEncode module.
80
81 %description apidocs -l pl.UTF-8
82 Dokumentacja API modułu Pythona FormEncode.
83
84 %prep
85 %setup -q -n %{module}-%{version}
86 %patch0 -p1
87
88 # uses network to validate domains (with one no longer valid anyway)
89 %{__rm} formencode/tests/test_email.py
90 # validator doctests cover Email and URL validators which include DNS lookups
91 %{__sed} -i -e '/^modules / s/, validators//' formencode/tests/test_doctests.py
92
93 %build
94 %if %{with python2}
95 %py_build
96
97 %if %{with tests}
98 %{__python} -m nose build-2/lib/formencode/tests
99 %endif
100 %endif
101
102 %if %{with python3}
103 %py3_build
104
105 %if %{with tests}
106 %{__python3} -m nose build-3/lib/formencode/tests
107 %endif
108 %endif
109
110 %install
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %py_install
115
116 %{__mv} $RPM_BUILD_ROOT%{py_sitescriptdir}/docs built-docs
117
118 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/formencode/tests
119 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/formencode/i18n/FormEncode.pot
120 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/formencode/i18n/*/LC_MESSAGES/FormEncode.po
121 %py_postclean
122
123 find $RPM_BUILD_ROOT%{py_sitescriptdir}/formencode/i18n -type d -maxdepth 1 | \
124         %{__sed} -ne "s,$RPM_BUILD_ROOT\(.*i18n/\([a-z]\+\(_[A-Z][A-Z]\)\?\).*\),%%lang(\2) \1,p" > py2.lang
125 %endif
126
127 %if %{with python3}
128 %py3_install
129
130 %{__rm} -rf built-docs
131 %{__mv} $RPM_BUILD_ROOT%{py3_sitescriptdir}/docs built-docs
132
133 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/formencode/tests
134 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/formencode/i18n/FormEncode.pot
135 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/formencode/i18n/*/LC_MESSAGES/FormEncode.po
136
137 find $RPM_BUILD_ROOT%{py3_sitescriptdir}/formencode/i18n -type d -maxdepth 1 | \
138         %{__sed} -ne "s,$RPM_BUILD_ROOT\(.*i18n/\([a-z]\+\(_[A-Z][A-Z]\)\?\).*\),%%lang(\2) \1,p" > py3.lang
139 %endif
140
141 %clean
142 rm -rf $RPM_BUILD_ROOT
143
144 %if %{with python2}
145 %files -f py2.lang
146 %defattr(644,root,root,755)
147 %doc README.rst
148 %dir %{py_sitescriptdir}/formencode
149 %{py_sitescriptdir}/formencode/*.py[co]
150 %dir %{py_sitescriptdir}/formencode/i18n
151 %{py_sitescriptdir}/formencode/javascript
152 %{py_sitescriptdir}/FormEncode-%{version}-py*.egg-info
153 %endif
154
155 %if %{with python3}
156 %files -n python3-%{module} -f py3.lang
157 %defattr(644,root,root,755)
158 %doc README.rst
159 %dir %{py3_sitescriptdir}/formencode
160 %{py3_sitescriptdir}/formencode/*.py
161 %{py3_sitescriptdir}/formencode/__pycache__
162 %dir %{py3_sitescriptdir}/formencode/i18n
163 %{py3_sitescriptdir}/formencode/javascript
164 %{py3_sitescriptdir}/FormEncode-%{version}-py*.egg-info
165 %endif
166
167 %files apidocs
168 %defattr(644,root,root,755)
169 %doc built-docs/*
This page took 0.094366 seconds and 3 git commands to generate.