1 | %global with_python3 0 |
---|
2 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} |
---|
3 | |
---|
4 | Name: python-markupsafe |
---|
5 | Version: 0.9.2 |
---|
6 | Release: 1%{?_dist_release} |
---|
7 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python |
---|
8 | |
---|
9 | Group: Development/Languages |
---|
10 | License: BSD |
---|
11 | URL: http://pypi.python.org/pypi/MarkupSafe |
---|
12 | Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz |
---|
13 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
14 | |
---|
15 | BuildRequires: python-devel python-setuptools |
---|
16 | |
---|
17 | %if 0%{?with_python3} |
---|
18 | BuildRequires: python3-devel python3-setuptools |
---|
19 | # For /usr/bin/2to3 |
---|
20 | BuildRequires: python-tools |
---|
21 | %endif # if with_python3 |
---|
22 | |
---|
23 | |
---|
24 | %description |
---|
25 | A library for safe markup escaping. |
---|
26 | |
---|
27 | %if 0%{?with_python3} |
---|
28 | %package -n python3-markupsafe |
---|
29 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python |
---|
30 | Group: Development/Languages |
---|
31 | |
---|
32 | %description -n python3-markupsafe |
---|
33 | A library for safe markup escaping. |
---|
34 | %endif #if with_python3 |
---|
35 | |
---|
36 | %prep |
---|
37 | %setup -q -n MarkupSafe-%{version} |
---|
38 | |
---|
39 | %if 0%{?with_python3} |
---|
40 | %__rm -rf %{py3dir} |
---|
41 | %__cp -a . %{py3dir} |
---|
42 | 2to3 --write --nobackups %{py3dir} |
---|
43 | %endif # with_python3 |
---|
44 | |
---|
45 | %build |
---|
46 | CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build |
---|
47 | |
---|
48 | %if 0%{?with_python3} |
---|
49 | pushd %{py3dir} |
---|
50 | CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build |
---|
51 | popd |
---|
52 | %endif # with_python3 |
---|
53 | |
---|
54 | |
---|
55 | %install |
---|
56 | %__rm -rf $RPM_BUILD_ROOT |
---|
57 | %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT |
---|
58 | # C code errantly gets installed |
---|
59 | %__rm $RPM_BUILD_ROOT/%{python_sitearch}/markupsafe/*.c |
---|
60 | |
---|
61 | %if 0%{?with_python3} |
---|
62 | pushd %{py3dir} |
---|
63 | %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT |
---|
64 | %__rm $RPM_BUILD_ROOT/%{python3_sitearch}/markupsafe/*.c |
---|
65 | popd |
---|
66 | %endif # with_python3 |
---|
67 | |
---|
68 | |
---|
69 | %check |
---|
70 | %{__python} setup.py test |
---|
71 | |
---|
72 | %if 0%{?with_python3} |
---|
73 | pushd %{py3dir} |
---|
74 | %{__python3} setup.py test |
---|
75 | popd |
---|
76 | %endif # with_python3 |
---|
77 | |
---|
78 | %clean |
---|
79 | %__rm -rf $RPM_BUILD_ROOT |
---|
80 | |
---|
81 | |
---|
82 | %files |
---|
83 | %defattr(-,root,root,-) |
---|
84 | %doc AUTHORS LICENSE README.rst |
---|
85 | %{python_sitearch}/* |
---|
86 | |
---|
87 | %if 0%{?with_python3} |
---|
88 | %files -n python3-markupsafe |
---|
89 | %defattr(-,root,root,-) |
---|
90 | %doc AUTHORS LICENSE README.rst |
---|
91 | %{python3_sitearch}/* |
---|
92 | %endif # with_python3 |
---|
93 | |
---|
94 | |
---|
95 | %changelog |
---|
96 | * Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 0.9.2-1 |
---|
97 | - initial build based on Fedora development |
---|
98 | |
---|
99 | * Fri Jul 23 2010 David Malcolm <dmalcolm@redhat.com> - 0.9.2-4 |
---|
100 | - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild |
---|
101 | |
---|
102 | * Thu Jun 24 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-3 |
---|
103 | - Fix missing setuptools BuildRequires. |
---|
104 | |
---|
105 | * Thu Jun 24 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-2 |
---|
106 | - Fixed sitearch and python3 definitions to work better with older Fedora/RHEL. |
---|
107 | |
---|
108 | * Wed Jun 23 2010 Kyle VanderBeek <kylev@kylev.com> - 0.9.2-1 |
---|
109 | - Initial version. |
---|