]> git.pld-linux.org Git - packages/python-FormEncode.git/blame - python-FormEncode.spec
rebuild with python 3.10
[packages/python-FormEncode.git] / python-FormEncode.spec
CommitLineData
d7c20982
JB
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
7450344b 7
d7c20982 8%define module FormEncode
7450344b 9Summary: HTML form validation, generation, and convertion package
b27f05d4 10Summary(pl.UTF-8): Moduł do walidacji, tworzenia i konwersji formularzy HTML
7450344b 11Name: python-%{module}
d7c20982 12Version: 1.3.1
dc50037f 13Release: 3
7450344b 14License: PSF
15Group: Development/Languages/Python
d7c20982
JB
16#Source0Download: https://pypi.org/project/FormEncode/
17Source0: https://files.pythonhosted.org/packages/source/F/FormEncode/%{module}-%{version}.tar.gz
18# Source0-md5: 16fbefb206064eb93a6719f054a19b3b
19Patch0: %{name}-pycountry.patch
7450344b 20URL: http://formencode.org/
d7c20982
JB
21%if %{with python2}
22BuildRequires: python-modules >= 1:2.6
06f1cd37 23BuildRequires: python-setuptools
d7c20982
JB
24%if %{with tests}
25BuildRequires: python-dns
26BuildRequires: python-nose
27BuildRequires: python-pycountry >= 16.10.23
28%endif
29%endif
30%if %{with python3}
31BuildRequires: python3-2to3 >= 1:3.2
32BuildRequires: python3-modules >= 1:3.2
33BuildRequires: python3-setuptools
34%if %{with tests}
35BuildRequires: python3-dns
36BuildRequires: python3-nose
37BuildRequires: python3-pycountry >= 16.10.23
38%endif
39%endif
ecaf0988 40BuildRequires: rpm-pythonprov
d7c20982 41BuildRequires: rpmbuild(macros) >= 1.714
edc83feb 42BuildRequires: sed >= 4.0
d7c20982 43Requires: python-modules >= 1:2.6
7450344b 44BuildArch: noarch
45BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47%description
48FormEncode validates and converts nested structures. It allows for a
49declarative form of defining the validation, and decoupled processes
50for filling and generating forms.
51
b70689e2
JR
52%description -l pl.UTF-8
53FormEncode służy do sprawdzania poprawności i konwersji zagnieżdżonych
d7c20982
JB
54struktur. Pozwala na deklaratywny sposób definiowania reguł
55poprawności i niezależne od nich wypełnianie i generowanie formularzy.
56
57%package -n python3-%{module}
58Summary: HTML form validation, generation, and convertion package
59Summary(pl.UTF-8): Moduł do walidacji, tworzenia i konwersji formularzy HTML
60Group: Libraries/Python
61Requires: python3-modules >= 1:3.2
62
63%description -n python3-%{module}
64FormEncode validates and converts nested structures. It allows for a
65declarative form of defining the validation, and decoupled processes
66for filling and generating forms.
67
68%description -n python3-%{module} -l pl.UTF-8
69FormEncode służy do sprawdzania poprawności i konwersji zagnieżdżonych
70struktur. Pozwala na deklaratywny sposób definiowania reguł
71poprawności i niezależne od nich wypełnianie i generowanie formularzy.
72
73%package apidocs
74Summary: API documentation for Python FormEncode module
75Summary(pl.UTF-8): Dokumentacja API modułu Pythona FormEncode
76Group: Documentation
77
78%description apidocs
79API documentation for Python FormEncode module.
80
81%description apidocs -l pl.UTF-8
82Dokumentacja API modułu Pythona FormEncode.
7450344b 83
84%prep
c8357c7d 85%setup -q -n %{module}-%{version}
d7c20982
JB
86%patch0 -p1
87
88# uses network to validate domains (with one no longer valid anyway)
89%{__rm} formencode/tests/test_email.py
edc83feb
JB
90# validator doctests cover Email and URL validators which include DNS lookups
91%{__sed} -i -e '/^modules / s/, validators//' formencode/tests/test_doctests.py
7450344b 92
93%build
d7c20982 94%if %{with python2}
34134326 95%py_build
7450344b 96
d7c20982
JB
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
7450344b 110%install
111rm -rf $RPM_BUILD_ROOT
7450344b 112
d7c20982
JB
113%if %{with python2}
114%py_install
115
116%{__mv} $RPM_BUILD_ROOT%{py_sitescriptdir}/docs built-docs
06f1cd37 117
d7c20982
JB
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
06f1cd37
AM
121%py_postclean
122
d7c20982
JB
123find $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
137find $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
7450344b 141%clean
142rm -rf $RPM_BUILD_ROOT
143
d7c20982
JB
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
7450344b 168%defattr(644,root,root,755)
d7c20982 169%doc built-docs/*
This page took 0.125215 seconds and 4 git commands to generate.