]>
Commit | Line | Data |
---|---|---|
d1b3c515 ER |
1 | # |
2 | # Conditional build: | |
37cbba9f | 3 | %bcond_without tests # unit tests |
d1b3c515 ER |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
a8646d2c | 7 | %define module markupsafe |
02f65cc7 JB |
8 | Summary: MarkupSafe - a XML/HTML/XHTML Markup safe string for Python 2 |
9 | Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 2 bezpieczny pod kątem znaczników XML/HTML/XHTML | |
a79f2bec | 10 | Name: python-%{module} |
4cbda2d2 | 11 | Version: 1.0 |
f886d7f7 | 12 | Release: 2 |
a79f2bec | 13 | License: BSD |
14 | Group: Development/Languages/Python | |
37cbba9f | 15 | #Source0Download: https://pypi.org/pypi/MarkupSafe/ |
4cbda2d2 JB |
16 | Source0: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz |
17 | # Source0-md5: 2fcedc9284d50e577b5192e8e3578355 | |
18 | URL: http://www.pocoo.org/projects/markupsafe/#markupsafe | |
a79f2bec | 19 | BuildRequires: rpm-pythonprov |
c7cf0f60 | 20 | BuildRequires: rpmbuild(macros) >= 1.710 |
d1b3c515 ER |
21 | %if %{with python2} |
22 | BuildRequires: python-devel | |
b15ed0c4 | 23 | BuildRequires: python-setuptools |
d1b3c515 ER |
24 | %endif |
25 | %if %{with python3} | |
26 | BuildRequires: python-2to3 | |
27 | BuildRequires: python3-devel | |
b15ed0c4 | 28 | BuildRequires: python3-setuptools |
d1b3c515 | 29 | %endif |
933a582b | 30 | Requires: python-modules |
a8646d2c ER |
31 | Provides: python-MarkupSafe = %{version}-%{release} |
32 | Obsoletes: python-MarkupSafe < 0.15-2 | |
a79f2bec | 33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
02f65cc7 JB |
36 | MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python. |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego | |
40 | pod kątem znaczników XML/HTML/XHTML. | |
a79f2bec | 41 | |
d1b3c515 | 42 | %package -n python3-markupsafe |
02f65cc7 JB |
43 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3 |
44 | Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 3 bezpieczny pod kątem znaczników XML/HTML/XHTML | |
d1b3c515 | 45 | Group: Development/Languages |
02f65cc7 | 46 | Requires: python3-modules |
d1b3c515 ER |
47 | |
48 | %description -n python3-markupsafe | |
02f65cc7 JB |
49 | MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python. |
50 | ||
51 | %description -n python3-markupsafe -l pl.UTF-8 | |
52 | MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego | |
53 | pod kątem znaczników XML/HTML/XHTML. | |
d1b3c515 | 54 | |
a79f2bec | 55 | %prep |
4cbda2d2 | 56 | %setup -q -n MarkupSafe-%{version} |
a79f2bec | 57 | |
58 | %build | |
d1b3c515 | 59 | %if %{with python2} |
4cbda2d2 | 60 | %py_build %{?with_tests:test} |
d1b3c515 ER |
61 | %endif |
62 | ||
63 | %if %{with python3} | |
4cbda2d2 | 64 | %py3_build %{?with_tests:test} |
d1b3c515 | 65 | %endif |
a79f2bec | 66 | |
67 | %install | |
68 | rm -rf $RPM_BUILD_ROOT | |
d1b3c515 | 69 | %if %{with python2} |
e2092c77 | 70 | %py_install |
a79f2bec | 71 | |
4cbda2d2 | 72 | %py_postclean |
d1b3c515 | 73 | # C code errantly gets installed |
be775773 | 74 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c |
d1b3c515 ER |
75 | %endif |
76 | ||
77 | %if %{with python3} | |
e2092c77 | 78 | %py3_install |
d1b3c515 | 79 | |
d1b3c515 | 80 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c |
d1b3c515 | 81 | %endif |
a79f2bec | 82 | |
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
d1b3c515 | 86 | %if %{with python2} |
a79f2bec | 87 | %files |
88 | %defattr(644,root,root,755) | |
d1b3c515 | 89 | %doc AUTHORS LICENSE README.rst |
933a582b | 90 | %dir %{py_sitedir}/markupsafe |
d1b3c515 | 91 | %{py_sitedir}/markupsafe/*.py[co] |
02f65cc7 | 92 | %attr(755,root,root) %{py_sitedir}/markupsafe/_speedups.so |
d1b3c515 ER |
93 | %{py_sitedir}/MarkupSafe-%{version}-py*.egg-info |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %files -n python3-markupsafe | |
98 | %defattr(644,root,root,755) | |
99 | %doc AUTHORS LICENSE README.rst | |
100 | %dir %{py3_sitedir}/markupsafe | |
101 | %{py3_sitedir}/markupsafe/*.py | |
102 | %{py3_sitedir}/markupsafe/__pycache__ | |
02f65cc7 | 103 | %attr(755,root,root) %{py3_sitedir}/markupsafe/_speedups.cpython-*.so |
d1b3c515 | 104 | %{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info |
a79f2bec | 105 | %endif |