]> git.pld-linux.org Git - packages/python-defusedxml.git/blob - python-defusedxml.spec
rebuild with tests and docs
[packages/python-defusedxml.git] / python-defusedxml.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
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}
12 Version:        0.7.1
13 Release:        4
14 License:        PSF v2
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
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-modules >= 1:3.5
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       python-modules >= 1:2.7
31 BuildArch:      noarch
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 XML bomb protection for Python stdlib modules.
36
37 %description -l pl.UTF-8
38 Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej
39 Pythona.
40
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
46
47 %description -n python3-%{module}
48 XML bomb protection for Python stdlib modules.
49
50 %description -n python3-%{module} -l pl.UTF-8
51 Zabezpieczenie przed bombami XML dla modułów biblioteki standardowej
52 Pythona.
53
54 %prep
55 %setup -q -n %{module}-%{version}
56 %patch0 -p1
57
58 %build
59 %if %{with python2}
60 %py_build %{?with_tests:test}
61 %endif
62
63 %if %{with python3}
64 %py3_build %{?with_tests:test}
65 %endif
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69
70 %if %{with python2}
71 %py_install
72
73 %py_postclean
74 %endif
75
76 %if %{with python3}
77 %py3_install
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]
89 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
90 %endif
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
This page took 0.055808 seconds and 3 git commands to generate.