]> git.pld-linux.org Git - packages/python3-markupsafe.git/blame - python-markupsafe.spec
use setuptools instead of distribute
[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
02f65cc7
JB
8Summary: MarkupSafe - a XML/HTML/XHTML Markup safe string for Python 2
9Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 2 bezpieczny pod kątem znaczników XML/HTML/XHTML
a79f2bec 10Name: python-%{module}
ba9d2fe0 11Version: 0.23
822388d3 12Release: 3
a79f2bec 13License: BSD
14Group: Development/Languages/Python
ba9d2fe0 15#Source0Download: https://pypi.python.org/pypi/MarkupSafe
02f65cc7 16Source0: https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz
ba9d2fe0 17# Source0-md5: f5ab3deee4c37cd6a922fb81e730da6e
a79f2bec 18URL: http://www.pocoo.org/
a79f2bec 19BuildRequires: rpm-pythonprov
a79f2bec 20BuildRequires: rpmbuild(macros) >= 1.219
d1b3c515
ER
21%if %{with python2}
22BuildRequires: python-devel
b15ed0c4 23BuildRequires: python-setuptools
d1b3c515
ER
24%endif
25%if %{with python3}
26BuildRequires: python-2to3
27BuildRequires: python3-devel
b15ed0c4 28BuildRequires: python3-setuptools
d1b3c515 29%endif
933a582b 30Requires: python-modules
a8646d2c
ER
31Provides: python-MarkupSafe = %{version}-%{release}
32Obsoletes: python-MarkupSafe < 0.15-2
a79f2bec 33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
02f65cc7
JB
36MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python.
37
38%description -l pl.UTF-8
39MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego
40pod kątem znaczników XML/HTML/XHTML.
a79f2bec 41
d1b3c515 42%package -n python3-markupsafe
02f65cc7
JB
43Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3
44Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 3 bezpieczny pod kątem znaczników XML/HTML/XHTML
d1b3c515 45Group: Development/Languages
02f65cc7 46Requires: python3-modules
d1b3c515
ER
47
48%description -n python3-markupsafe
02f65cc7
JB
49MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python.
50
51%description -n python3-markupsafe -l pl.UTF-8
52MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego
53pod kątem znaczników XML/HTML/XHTML.
d1b3c515 54
a79f2bec 55%prep
d1b3c515 56%setup -qc
a8646d2c 57mv MarkupSafe-%{version} py2
d1b3c515
ER
58# for %doc
59cp -p py2/{AUTHORS,LICENSE,README.rst} .
60
61%if %{with python3}
62cp -a py2 py3
632to3 --write --nobackups py3
64%endif
a79f2bec 65
66%build
d1b3c515
ER
67%if %{with python2}
68cd py3
a79f2bec 69# CFLAGS is only for arch packages - remove on noarch packages
be775773
ER
70CC="%{__cc}" \
71CFLAGS="%{rpmcflags}" \
a79f2bec 72%{__python} setup.py build
d1b3c515
ER
73%{?with_tests:%{__python} setup.py test}
74cd ..
75%endif
76
77%if %{with python3}
78cd py3
79CC="%{__cc}" \
80CFLAGS="%{rpmcflags}" \
81%{__python3} setup.py build
82%{?with_tests:%{__python3} setup.py test}
83cd ..
84%endif
a79f2bec 85
86%install
87rm -rf $RPM_BUILD_ROOT
d1b3c515
ER
88%if %{with python2}
89cd py2
a79f2bec 90%{__python} setup.py install \
91 --optimize=2 \
92 --root=$RPM_BUILD_ROOT
93
d1b3c515 94# C code errantly gets installed
be775773 95%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c
a79f2bec 96%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
97%py_comp $RPM_BUILD_ROOT%{py_sitedir}
98%py_postclean
d1b3c515
ER
99cd ..
100%endif
101
102%if %{with python3}
103cd py3
104%{__python3} setup.py install \
105 --optimize=2 \
106 --root=$RPM_BUILD_ROOT
107
108
d1b3c515
ER
109# C code errantly gets installed
110%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c
111cd ..
112%endif
a79f2bec 113
114%clean
115rm -rf $RPM_BUILD_ROOT
116
d1b3c515 117%if %{with python2}
a79f2bec 118%files
119%defattr(644,root,root,755)
d1b3c515 120%doc AUTHORS LICENSE README.rst
933a582b 121%dir %{py_sitedir}/markupsafe
d1b3c515 122%{py_sitedir}/markupsafe/*.py[co]
02f65cc7 123%attr(755,root,root) %{py_sitedir}/markupsafe/_speedups.so
d1b3c515
ER
124%{py_sitedir}/MarkupSafe-%{version}-py*.egg-info
125%endif
126
127%if %{with python3}
128%files -n python3-markupsafe
129%defattr(644,root,root,755)
130%doc AUTHORS LICENSE README.rst
131%dir %{py3_sitedir}/markupsafe
132%{py3_sitedir}/markupsafe/*.py
133%{py3_sitedir}/markupsafe/__pycache__
02f65cc7 134%attr(755,root,root) %{py3_sitedir}/markupsafe/_speedups.cpython-*.so
d1b3c515 135%{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info
a79f2bec 136%endif
This page took 0.126987 seconds and 4 git commands to generate.