]>
Commit | Line | Data |
---|---|---|
7cdfb220 AM |
1 | # Conditional build: |
2 | %bcond_with tests # unit tests | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | # NOTES: | |
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 | |
14 | Summary(pl.UTF-8): - | |
15 | Name: python-%{module} | |
c59c98a9 | 16 | Version: 1.7.4 |
e5f61461 | 17 | Release: 3 |
7cdfb220 AM |
18 | License: GPL v2+ |
19 | Group: Libraries/Python | |
c59c98a9 AM |
20 | Source0: https://pypi.debian.net/dicttoxml/%{module}-%{version}.tar.gz |
21 | # Source0-md5: ec5643a048cf32dad3c28db236b923e4 | |
7cdfb220 AM |
22 | URL: https://github.com/quandyfactory/dicttoxml |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules >= 1:2.5 | |
25 | BuildRequires: python-setuptools | |
26 | %if %{with tests} | |
27 | #BuildRequires: python- | |
28 | %endif | |
29 | %endif | |
30 | %if %{with python3} | |
31 | BuildRequires: python3-modules >= 1:3.2 | |
32 | BuildRequires: python3-setuptools | |
33 | %if %{with tests} | |
34 | #BuildRequires: python3- | |
35 | %endif | |
36 | %endif | |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | Requires: python-modules >= 1:2.5 | |
40 | BuildArch: noarch | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | Converts a Python dictionary or other native data type into a valid | |
45 | XML string. | |
46 | ||
47 | %package -n python3-%{module} | |
48 | Summary: - | |
49 | Summary(pl.UTF-8): - | |
50 | Group: Libraries/Python | |
51 | Requires: python3-modules >= 1:3.2 | |
52 | ||
53 | %description -n python3-%{module} | |
54 | Converts a Python dictionary or other native data type into a valid | |
55 | XML string. | |
56 | ||
57 | %prep | |
58 | %setup -q -n %{pypi_name}-%{version} | |
59 | ||
60 | %build | |
61 | %if %{with python2} | |
62 | %py_build %{?with_tests:test} | |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_build %{?with_tests:test} | |
67 | %endif | |
68 | ||
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %if %{with python2} | |
73 | %py_install | |
74 | ||
75 | %py_postclean | |
76 | %endif | |
77 | ||
78 | %if %{with python3} | |
79 | %py3_install | |
80 | %endif | |
81 | ||
82 | %clean | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %if %{with python2} | |
86 | %files | |
87 | %defattr(644,root,root,755) | |
88 | %doc README.markdown | |
89 | %{py_sitescriptdir}/%{module}.py* | |
90 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
91 | %endif | |
92 | ||
93 | %if %{with python3} | |
94 | %files -n python3-%{module} | |
95 | %defattr(644,root,root,755) | |
96 | %doc README.markdown | |
97 | %{py3_sitescriptdir}/%{module}.py* | |
98 | %{py3_sitescriptdir}/__pycache__/dicttoxml* | |
99 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
100 | %endif |