]>
Commit | Line | Data |
---|---|---|
78a30241 AM |
1 | # |
2 | # Conditional build: | |
c6003571 | 3 | %bcond_without tests # unit tests |
78a30241 AM |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module defusedxml | |
321c3bce | 8 | %define pypi_name defusedxml |
78a30241 | 9 | Summary: XML bomb protection for Python stdlib modules |
e92c5070 | 10 | Summary(pl.UTF-8): Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej Pythona |
78a30241 | 11 | Name: python-%{module} |
c6003571 | 12 | Version: 0.7.1 |
53f7e7f6 | 13 | Release: 3 |
e92c5070 | 14 | License: PSF v2 |
78a30241 | 15 | Group: Libraries/Python |
e92c5070 JB |
16 | #Source0Download: https://pypi.org/simple/defusedxml/ |
17 | Source0: https://files.pythonhosted.org/packages/source/d/defusedxml/%{pypi_name}-%{version}.tar.gz | |
c6003571 | 18 | # Source0-md5: a50e7f21aa60a741efe6b1b658dfb3f8 |
e92c5070 JB |
19 | Patch0: python-defusedxml-format_strings.patch |
20 | URL: https://pypi.org/project/defusedxml/ | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
78a30241 | 22 | %if %{with python2} |
e92c5070 | 23 | BuildRequires: python-modules >= 1:2.7 |
0f49ccd6 | 24 | BuildRequires: python-setuptools |
78a30241 AM |
25 | %endif |
26 | %if %{with python3} | |
e92c5070 | 27 | BuildRequires: python3-modules >= 1:3.5 |
9ad999eb | 28 | BuildRequires: python3-setuptools |
78a30241 | 29 | %endif |
e92c5070 | 30 | Requires: python-modules >= 1:2.7 |
78a30241 AM |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | XML bomb protection for Python stdlib modules. | |
36 | ||
e92c5070 JB |
37 | %description -l pl.UTF-8 |
38 | Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej | |
39 | Pythona. | |
40 | ||
78a30241 AM |
41 | %package -n python3-%{module} |
42 | Summary: XML bomb protection for Python stdlib modules | |
e92c5070 | 43 | Summary(pl.UTF-8): Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej Pythona |
78a30241 | 44 | Group: Libraries/Python |
e92c5070 | 45 | Requires: python3-modules >= 1:3.5 |
78a30241 AM |
46 | |
47 | %description -n python3-%{module} | |
48 | XML bomb protection for Python stdlib modules. | |
49 | ||
e92c5070 JB |
50 | %description -n python3-%{module} -l pl.UTF-8 |
51 | Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej | |
52 | Pythona. | |
53 | ||
78a30241 AM |
54 | %prep |
55 | %setup -q -n %{module}-%{version} | |
039e98b0 | 56 | %patch0 -p1 |
78a30241 AM |
57 | |
58 | %build | |
59 | %if %{with python2} | |
0f49ccd6 | 60 | %py_build %{?with_tests:test} |
78a30241 AM |
61 | %endif |
62 | ||
63 | %if %{with python3} | |
0f49ccd6 | 64 | %py3_build %{?with_tests:test} |
78a30241 AM |
65 | %endif |
66 | ||
67 | %install | |
68 | rm -rf $RPM_BUILD_ROOT | |
69 | ||
70 | %if %{with python2} | |
0f49ccd6 | 71 | %py_install |
78a30241 AM |
72 | |
73 | %py_postclean | |
74 | %endif | |
75 | ||
76 | %if %{with python3} | |
0f49ccd6 | 77 | %py3_install |
78a30241 AM |
78 | %endif |
79 | ||
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %if %{with python2} | |
84 | %files | |
85 | %defattr(644,root,root,755) | |
86 | %doc README.txt CHANGES.txt | |
87 | %dir %{py_sitescriptdir}/%{module} | |
88 | %{py_sitescriptdir}/%{module}/*.py[co] | |
78a30241 AM |
89 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
90 | %endif | |
78a30241 AM |
91 | |
92 | %if %{with python3} | |
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 | |
98 | %endif |