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