1 # NOTE: for versions >= 1.1.0 (for python 3.5+) see python3-xmlschema.spec
4 %bcond_without doc # Sphinx documentation
5 %bcond_without tests # unit tests
6 %bcond_without python2 # CPython 2.x module
7 %bcond_with python3 # CPython 3.x module (built from python3-xmlschema.spec)
9 Summary: XML Schema validator and decoder
10 Summary(pl.UTF-8): Biblioteka do sprawdzania poprawności i dekodowania schematów XML
11 Name: python-xmlschema
12 # keep 1.0.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/xmlschema/
18 Source0: https://files.pythonhosted.org/packages/source/x/xmlschema/xmlschema-%{version}.tar.gz
19 # Source0-md5: f3e7f9002aeb9846af68f81c6ec82200
20 URL: https://pypi.org/project/xmlschema/
22 BuildRequires: python-elementpath >= 1.3.0
23 BuildRequires: python-elementpath < 1.4.0
24 BuildRequires: python-modules >= 1:2.7
25 BuildRequires: python-setuptools
28 BuildRequires: python3-elementpath >= 1.3.0
29 BuildRequires: python3-elementpath < 1.4.0
30 BuildRequires: python3-modules >= 1:3.5
31 BuildRequires: python3-setuptools
33 BuildRequires: rpm-pythonprov
34 BuildRequires: rpmbuild(macros) >= 1.714
35 BuildRequires: sed >= 4.0
37 BuildRequires: python3-sphinx_rtd_theme
38 BuildRequires: sphinx-pdg-3
40 Requires: python-modules >= 1:2.7
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 The xmlschema library is an implementation of XML Schema
46 (<http://www.w3.org/2001/XMLSchema>) for Python.
48 %description -l pl.UTF-8
49 Biblioteka xmlschema to implementacja XML Schema
50 (<http://www.w3.org/2001/XMLSchema>) dla Pythona.
52 %package -n python3-xmlschema
53 Summary: XML Schema validator and decoder
54 Summary(pl.UTF-8): Biblioteka do sprawdzania poprawności i dekodowania schematów XML
55 Group: Libraries/Python
56 Requires: python3-modules >= 1:3.5
58 %description -n python3-xmlschema
59 The xmlschema library is an implementation of XML Schema
60 (<http://www.w3.org/2001/XMLSchema>) for Python.
62 %description -n python3-xmlschema -l pl.UTF-8
63 Biblioteka xmlschema to implementacja XML Schema
64 (<http://www.w3.org/2001/XMLSchema>) dla Pythona.
67 Summary: API documentation for Python xmlschema module
68 Summary(pl.UTF-8): Dokumentacja API modułu Pythona xmlschema
72 API documentation for Python xmlschema module.
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API modułu Pythona xmlschema.
78 %setup -q -n xmlschema-%{version}
80 %{__sed} -i -e 's/^SKIP_REMOTE_TESTS =.*/SKIP_REMOTE_TESTS = True/' xmlschema/tests/__init__.py
88 %{__python} xmlschema/tests/test_all.py
97 %{__python3} xmlschema/tests/test_all.py
102 %{__make} -C doc html \
103 SPHINXBUILD=sphinx-build-3
107 rm -rf $RPM_BUILD_ROOT
112 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/xmlschema/tests
119 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/xmlschema/tests
123 rm -rf $RPM_BUILD_ROOT
127 %defattr(644,root,root,755)
128 %doc CHANGELOG.rst LICENSE README.rst
129 %{py_sitescriptdir}/xmlschema
130 %{py_sitescriptdir}/xmlschema-%{version}-py*.egg-info
134 %files -n python3-xmlschema
135 %defattr(644,root,root,755)
136 %doc CHANGELOG.rst LICENSE README.rst
137 %{py3_sitescriptdir}/xmlschema
138 %{py3_sitescriptdir}/xmlschema-%{version}-py*.egg-info
143 %defattr(644,root,root,755)
144 %doc doc/_build/html/{_static,*.html,*.js}