3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module defusedxml
8 %define pypi_name defusedxml
9 Summary: XML bomb protection for Python stdlib modules
10 Summary(pl.UTF-8): Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej Pythona
11 Name: python-%{module}
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/defusedxml/
17 Source0: https://files.pythonhosted.org/packages/source/d/defusedxml/%{pypi_name}-%{version}.tar.gz
18 # Source0-md5: a50e7f21aa60a741efe6b1b658dfb3f8
19 Patch0: python-defusedxml-format_strings.patch
20 URL: https://pypi.org/project/defusedxml/
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools
27 BuildRequires: python3-modules >= 1:3.5
28 BuildRequires: python3-setuptools
30 Requires: python-modules >= 1:2.7
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 XML bomb protection for Python stdlib modules.
37 %description -l pl.UTF-8
38 Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej
41 %package -n python3-%{module}
42 Summary: XML bomb protection for Python stdlib modules
43 Summary(pl.UTF-8): Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej Pythona
44 Group: Libraries/Python
45 Requires: python3-modules >= 1:3.5
47 %description -n python3-%{module}
48 XML bomb protection for Python stdlib modules.
50 %description -n python3-%{module} -l pl.UTF-8
51 Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej
55 %setup -q -n %{module}-%{version}
60 %py_build %{?with_tests:test}
64 %py3_build %{?with_tests:test}
68 rm -rf $RPM_BUILD_ROOT
81 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %doc README.txt CHANGES.txt
87 %dir %{py_sitescriptdir}/%{module}
88 %{py_sitescriptdir}/%{module}/*.py[co]
89 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
93 %files -n python3-%{module}
94 %defattr(644,root,root,755)
95 %doc README.txt CHANGES.txt
96 %{py3_sitescriptdir}/%{module}
97 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info