]> git.pld-linux.org Git - packages/python-xmlschema.git/blob - python-xmlschema.spec
80dd1ac798bee953a644c7c2e5542ba246edf1b9
[packages/python-xmlschema.git] / python-xmlschema.spec
1 # NOTE: for versions >= 1.1.0 (for python 3.5+) see python3-xmlschema.spec
2 #
3 # Conditional build:
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)
8
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
13 Version:        1.0.18
14 Release:        1
15 License:        MIT
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/
21 %if %{with python2}
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
26 %endif
27 %if %{with python3}
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
32 %endif
33 BuildRequires:  rpm-pythonprov
34 BuildRequires:  rpmbuild(macros) >= 1.714
35 BuildRequires:  sed >= 4.0
36 %if %{with doc}
37 BuildRequires:  python3-sphinx_rtd_theme
38 BuildRequires:  sphinx-pdg-3
39 %endif
40 Requires:       python-modules >= 1:2.7
41 BuildArch:      noarch
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 The xmlschema library is an implementation of XML Schema
46 (<http://www.w3.org/2001/XMLSchema>) for Python.
47
48 %description -l pl.UTF-8
49 Biblioteka xmlschema to implementacja XML Schema
50 (<http://www.w3.org/2001/XMLSchema>) dla Pythona.
51
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
57
58 %description -n python3-xmlschema
59 The xmlschema library is an implementation of XML Schema
60 (<http://www.w3.org/2001/XMLSchema>) for Python.
61
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.
65
66 %package apidocs
67 Summary:        API documentation for Python xmlschema module
68 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona xmlschema
69 Group:          Documentation
70
71 %description apidocs
72 API documentation for Python xmlschema module.
73
74 %description apidocs -l pl.UTF-8
75 Dokumentacja API modułu Pythona xmlschema.
76
77 %prep
78 %setup -q -n xmlschema-%{version}
79
80 %{__sed} -i -e 's/^SKIP_REMOTE_TESTS =.*/SKIP_REMOTE_TESTS = True/' xmlschema/tests/__init__.py
81
82 %build
83 %if %{with python2}
84 %py_build
85
86 %if %{with tests}
87 PYTHONPATH=$(pwd) \
88 %{__python} xmlschema/tests/test_all.py
89 %endif
90 %endif
91
92 %if %{with python3}
93 %py3_build
94
95 %if %{with tests}
96 PYTHONPATH=$(pwd) \
97 %{__python3} xmlschema/tests/test_all.py
98 %endif
99 %endif
100
101 %if %{with doc}
102 %{__make} -C doc html \
103         SPHINXBUILD=sphinx-build-3
104 %endif
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108
109 %if %{with python2}
110 %py_install
111
112 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/xmlschema/tests
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118
119 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/xmlschema/tests
120 %endif
121
122 %clean
123 rm -rf $RPM_BUILD_ROOT
124
125 %if %{with python2}
126 %files
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
131 %endif
132
133 %if %{with python3}
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
139 %endif
140
141 %if %{with doc}
142 %files apidocs
143 %defattr(644,root,root,755)
144 %doc doc/_build/html/{_static,*.html,*.js}
145 %endif
This page took 0.066889 seconds and 2 git commands to generate.