3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module markupsafe
8 Summary: Implements a XML/HTML/XHTML Markup safe string for Python
13 Group: Development/Languages/Python
14 Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
15 # Source0-md5: 4e7c4d965fe5e033fa2d7bb7746bb186
16 URL: http://www.pocoo.org/
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.219
20 BuildRequires: python-devel
21 BuildRequires: python-distribute
24 BuildRequires: python-2to3
25 BuildRequires: python3-devel
26 BuildRequires: python3-distribute
28 Requires: python-modules
29 Provides: python-MarkupSafe = %{version}-%{release}
30 Obsoletes: python-MarkupSafe < 0.15-2
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Implements a XML/HTML/XHTML Markup safe string for Python.
36 %package -n python3-markupsafe
37 Summary: Implements a XML/HTML/XHTML Markup safe string for Python
38 Group: Development/Languages
40 %description -n python3-markupsafe
41 Implements a XML/HTML/XHTML Markup safe string for Python.
45 mv MarkupSafe-%{version} py2
47 cp -p py2/{AUTHORS,LICENSE,README.rst} .
51 2to3 --write --nobackups py3
57 # CFLAGS is only for arch packages - remove on noarch packages
59 CFLAGS="%{rpmcflags}" \
60 %{__python} setup.py build
61 %{?with_tests:%{__python} setup.py test}
68 CFLAGS="%{rpmcflags}" \
69 %{__python3} setup.py build
70 %{?with_tests:%{__python3} setup.py test}
75 rm -rf $RPM_BUILD_ROOT
78 %{__python} setup.py install \
80 --root=$RPM_BUILD_ROOT
82 # C code errantly gets installed
83 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c
84 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
85 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
92 %{__python3} setup.py install \
94 --root=$RPM_BUILD_ROOT
97 # err the unversioned one is duplicate
98 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/MarkupSafe.egg-info
100 # C code errantly gets installed
101 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c
106 rm -rf $RPM_BUILD_ROOT
110 %defattr(644,root,root,755)
111 %doc AUTHORS LICENSE README.rst
112 %dir %{py_sitedir}/markupsafe
113 %{py_sitedir}/markupsafe/*.py[co]
114 %attr(755,root,root) %{py_sitedir}/markupsafe/*.so
115 %{py_sitedir}/MarkupSafe-%{version}-py*.egg-info
119 %files -n python3-markupsafe
120 %defattr(644,root,root,755)
121 %doc AUTHORS LICENSE README.rst
122 %dir %{py3_sitedir}/markupsafe
123 %{py3_sitedir}/markupsafe/*.py
124 %{py3_sitedir}/markupsafe/__pycache__
125 %attr(755,root,root) %{py3_sitedir}/markupsafe/*.so
126 %{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info