]> git.pld-linux.org Git - packages/python-markupsafe.git/blame - python-markupsafe.spec
- switched doc to python2 based sphinx, so python3 is not involved here
[packages/python-markupsafe.git] / python-markupsafe.spec
CommitLineData
d1b3c515
ER
1#
2# Conditional build:
f17806b5 3%bcond_without doc # Sphinx documentation
37cbba9f 4%bcond_without tests # unit tests
d1b3c515 5%bcond_without python2 # CPython 2.x module
60763263 6%bcond_with python3 # CPython 3.x module, built from python3-markupsafe.spec
d1b3c515 7
a8646d2c 8%define module markupsafe
02f65cc7
JB
9Summary: MarkupSafe - a XML/HTML/XHTML Markup safe string for Python 2
10Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 2 bezpieczny pod kątem znaczników XML/HTML/XHTML
a79f2bec 11Name: python-%{module}
f17806b5 12Version: 1.1.1
bfb4c3bc 13Release: 4
a79f2bec 14License: BSD
15Group: Development/Languages/Python
f17806b5 16#Source0Download: https://pypi.org/simple/markupsafe/
4cbda2d2 17Source0: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
f17806b5 18# Source0-md5: 43fd756864fe42063068e092e220c57b
4cbda2d2 19URL: http://www.pocoo.org/projects/markupsafe/#markupsafe
a79f2bec 20BuildRequires: rpm-pythonprov
f17806b5 21BuildRequires: rpmbuild(macros) >= 1.714
d1b3c515 22%if %{with python2}
f17806b5 23BuildRequires: python-devel >= 1:2.7
b15ed0c4 24BuildRequires: python-setuptools
f17806b5
JB
25%if %{with tests}
26BuildRequires: python-pytest
27%endif
d1b3c515
ER
28%endif
29%if %{with python3}
30BuildRequires: python-2to3
f17806b5 31BuildRequires: python3-devel >= 1:3.4
b15ed0c4 32BuildRequires: python3-setuptools
f17806b5
JB
33%if %{with tests}
34BuildRequires: python3-pytest
35%endif
d1b3c515 36%endif
f17806b5 37%if %{with doc}
bdb5d366
JB
38BuildRequires: python-pallets-sphinx-themes >= 1.1.0
39BuildRequires: sphinx-pdg-2 >= 1.8.0
f17806b5
JB
40%endif
41Requires: python-modules >= 1:2.7
a8646d2c
ER
42Provides: python-MarkupSafe = %{version}-%{release}
43Obsoletes: python-MarkupSafe < 0.15-2
a79f2bec 44BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45
46%description
02f65cc7
JB
47MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python.
48
49%description -l pl.UTF-8
50MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego
51pod kątem znaczników XML/HTML/XHTML.
a79f2bec 52
d1b3c515 53%package -n python3-markupsafe
02f65cc7
JB
54Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3
55Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 3 bezpieczny pod kątem znaczników XML/HTML/XHTML
d1b3c515 56Group: Development/Languages
f17806b5 57Requires: python3-modules >= 1:3.4
d1b3c515
ER
58
59%description -n python3-markupsafe
02f65cc7
JB
60MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python.
61
62%description -n python3-markupsafe -l pl.UTF-8
63MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego
64pod kątem znaczników XML/HTML/XHTML.
d1b3c515 65
f17806b5
JB
66%package apidocs
67Summary: API documentation for Python MarkupSafe module
68Summary(pl.UTF-8): Dokumentacja API modułu Pythona MarkupSafe
69Group: Documentation
70
71%description apidocs
72API documentation for Python MarkupSafe module.
73
74%description apidocs -l pl.UTF-8
75Dokumentacja API modułu Pythona MarkupSafe.
76
a79f2bec 77%prep
4cbda2d2 78%setup -q -n MarkupSafe-%{version}
a79f2bec 79
80%build
d1b3c515 81%if %{with python2}
f17806b5
JB
82%py_build
83
84%if %{with tests}
85PYTHONPATH=$(pwd)/$(echo build-2/lib.*) \
86%{__python} -m pytest tests
87%endif
d1b3c515
ER
88%endif
89
90%if %{with python3}
f17806b5
JB
91%py3_build
92
93%if %{with tests}
94PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \
95%{__python3} -m pytest tests
96%endif
97%endif
98
99%if %{with doc}
100%{__make} -C docs html \
bdb5d366 101 SPHINXBUILD=sphinx-build-2
d1b3c515 102%endif
a79f2bec 103
104%install
105rm -rf $RPM_BUILD_ROOT
f17806b5 106
d1b3c515 107%if %{with python2}
e2092c77 108%py_install
a79f2bec 109
4cbda2d2 110%py_postclean
d1b3c515 111# C code errantly gets installed
be775773 112%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c
d1b3c515
ER
113%endif
114
115%if %{with python3}
e2092c77 116%py3_install
d1b3c515 117
d1b3c515 118%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c
d1b3c515 119%endif
a79f2bec 120
121%clean
122rm -rf $RPM_BUILD_ROOT
123
d1b3c515 124%if %{with python2}
a79f2bec 125%files
126%defattr(644,root,root,755)
f17806b5 127%doc CHANGES.rst LICENSE.rst README.rst
933a582b 128%dir %{py_sitedir}/markupsafe
d1b3c515 129%{py_sitedir}/markupsafe/*.py[co]
02f65cc7 130%attr(755,root,root) %{py_sitedir}/markupsafe/_speedups.so
d1b3c515
ER
131%{py_sitedir}/MarkupSafe-%{version}-py*.egg-info
132%endif
133
134%if %{with python3}
135%files -n python3-markupsafe
136%defattr(644,root,root,755)
f17806b5 137%doc CHANGES.rst LICENSE.rst README.rst
d1b3c515
ER
138%dir %{py3_sitedir}/markupsafe
139%{py3_sitedir}/markupsafe/*.py
140%{py3_sitedir}/markupsafe/__pycache__
02f65cc7 141%attr(755,root,root) %{py3_sitedir}/markupsafe/_speedups.cpython-*.so
d1b3c515 142%{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info
a79f2bec 143%endif
f17806b5
JB
144
145%if %{with doc}
146%files apidocs
147%defattr(644,root,root,755)
148%doc docs/_build/html/{_static,*.html,*.js}
149%endif
This page took 0.705246 seconds and 4 git commands to generate.