renamed to python-markupsafe
[packages/python3-markupsafe.git] / python-markupsafe.spec
CommitLineData
d1b3c515
ER
1#
2# Conditional build:
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
6
a8646d2c 7%define module markupsafe
a79f2bec 8Summary: Implements a XML/HTML/XHTML Markup safe string for Python
a79f2bec 9Name: python-%{module}
bcfd65ee 10Version: 0.15
d1b3c515 11Release: 2
a79f2bec 12License: BSD
13Group: Development/Languages/Python
a8646d2c 14Source0: http://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
bcfd65ee 15# Source0-md5: 4e7c4d965fe5e033fa2d7bb7746bb186
a79f2bec 16URL: http://www.pocoo.org/
a79f2bec 17BuildRequires: rpm-pythonprov
a79f2bec 18BuildRequires: rpmbuild(macros) >= 1.219
d1b3c515
ER
19%if %{with python2}
20BuildRequires: python-devel
21BuildRequires: python-distribute
22%endif
23%if %{with python3}
24BuildRequires: python-2to3
25BuildRequires: python3-devel
26BuildRequires: python3-distribute
27%endif
933a582b 28Requires: python-modules
a8646d2c
ER
29Provides: python-MarkupSafe = %{version}-%{release}
30Obsoletes: python-MarkupSafe < 0.15-2
a79f2bec 31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34Implements a XML/HTML/XHTML Markup safe string for Python.
35
d1b3c515
ER
36%package -n python3-markupsafe
37Summary: Implements a XML/HTML/XHTML Markup safe string for Python
38Group: Development/Languages
39
40%description -n python3-markupsafe
41Implements a XML/HTML/XHTML Markup safe string for Python.
42
a79f2bec 43%prep
d1b3c515 44%setup -qc
a8646d2c 45mv MarkupSafe-%{version} py2
d1b3c515
ER
46# for %doc
47cp -p py2/{AUTHORS,LICENSE,README.rst} .
48
49%if %{with python3}
50cp -a py2 py3
512to3 --write --nobackups py3
52%endif
a79f2bec 53
54%build
d1b3c515
ER
55%if %{with python2}
56cd py3
a79f2bec 57# CFLAGS is only for arch packages - remove on noarch packages
be775773
ER
58CC="%{__cc}" \
59CFLAGS="%{rpmcflags}" \
a79f2bec 60%{__python} setup.py build
d1b3c515
ER
61%{?with_tests:%{__python} setup.py test}
62cd ..
63%endif
64
65%if %{with python3}
66cd py3
67CC="%{__cc}" \
68CFLAGS="%{rpmcflags}" \
69%{__python3} setup.py build
70%{?with_tests:%{__python3} setup.py test}
71cd ..
72%endif
a79f2bec 73
74%install
75rm -rf $RPM_BUILD_ROOT
d1b3c515
ER
76%if %{with python2}
77cd py2
a79f2bec 78%{__python} setup.py install \
79 --optimize=2 \
80 --root=$RPM_BUILD_ROOT
81
d1b3c515 82# C code errantly gets installed
be775773 83%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c
a79f2bec 84%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
85%py_comp $RPM_BUILD_ROOT%{py_sitedir}
86%py_postclean
d1b3c515
ER
87cd ..
88%endif
89
90%if %{with python3}
91cd py3
92%{__python3} setup.py install \
93 --optimize=2 \
94 --root=$RPM_BUILD_ROOT
95
96
97# err the unversioned one is duplicate
98%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/MarkupSafe.egg-info
99
100# C code errantly gets installed
101%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c
102cd ..
103%endif
a79f2bec 104
105%clean
106rm -rf $RPM_BUILD_ROOT
107
d1b3c515 108%if %{with python2}
a79f2bec 109%files
110%defattr(644,root,root,755)
d1b3c515 111%doc AUTHORS LICENSE README.rst
933a582b 112%dir %{py_sitedir}/markupsafe
d1b3c515 113%{py_sitedir}/markupsafe/*.py[co]
a79f2bec 114%attr(755,root,root) %{py_sitedir}/markupsafe/*.so
d1b3c515
ER
115%{py_sitedir}/MarkupSafe-%{version}-py*.egg-info
116%endif
117
118%if %{with python3}
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
a79f2bec 127%endif
This page took 0.054564 seconds and 4 git commands to generate.