2 %bcond_with tests # unit tests
3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
7 # - 'module' should match the Python import path (first component?)
8 # - 'egg_name' should equal to Python egg name
9 # - 'pypi_name' must match the Python Package Index name
10 %define module dicttoxml
11 %define egg_name dicttoxml
12 %define pypi_name dicttoxml
13 Summary: Converts a Python dictionary or other native data type into a valid XML string
15 Name: python-%{module}
19 Group: Libraries/Python
20 Source0: https://pypi.debian.net/dicttoxml/%{module}-%{version}.tar.gz
21 # Source0-md5: ec5643a048cf32dad3c28db236b923e4
22 URL: https://github.com/quandyfactory/dicttoxml
24 BuildRequires: python-modules >= 1:2.5
25 BuildRequires: python-setuptools
27 #BuildRequires: python-
31 BuildRequires: python3-modules >= 1:3.2
32 BuildRequires: python3-setuptools
34 #BuildRequires: python3-
37 BuildRequires: rpm-pythonprov
38 BuildRequires: rpmbuild(macros) >= 1.714
39 Requires: python-modules >= 1:2.5
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Converts a Python dictionary or other native data type into a valid
47 %package -n python3-%{module}
50 Group: Libraries/Python
51 Requires: python3-modules >= 1:3.2
53 %description -n python3-%{module}
54 Converts a Python dictionary or other native data type into a valid
58 %setup -q -n %{pypi_name}-%{version}
62 %py_build %{?with_tests:test}
66 %py3_build %{?with_tests:test}
70 rm -rf $RPM_BUILD_ROOT
83 rm -rf $RPM_BUILD_ROOT
87 %defattr(644,root,root,755)
89 %{py_sitescriptdir}/%{module}.py*
90 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
94 %files -n python3-%{module}
95 %defattr(644,root,root,755)
97 %{py3_sitescriptdir}/%{module}.py*
98 %{py3_sitescriptdir}/__pycache__/dicttoxml*
99 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info