]>
Commit | Line | Data |
---|---|---|
1b5f8cc0 JP |
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 | %define module ruamel.yaml | |
7 | Summary: YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style and map key order | |
8 | Name: python-%{module} | |
9 | Version: 0.16.6 | |
10 | Release: 1 | |
11 | License: MIT | |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/ruamel.yaml/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/r/ruamel.yaml/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 6a0b7fe48578cf8e4a77d788ac4fe58b | |
16 | URL: https://pypi.org/project/ruamel.yaml/ | |
17 | BuildRequires: rpm-pythonprov | |
18 | BuildRequires: rpmbuild(macros) >= 1.714 | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | Requires: python-modules | |
28 | BuildArch: noarch | |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | YAML parser/emitter that supports roundtrip preservation of comments, | |
33 | seq/map flow style and map key order. | |
34 | ||
35 | %package -n python3-%{module} | |
36 | Summary: YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style and map key order | |
37 | Group: Libraries/Python | |
38 | Requires: python3-modules | |
39 | ||
40 | %description -n python3-%{module} | |
41 | YAML parser/emitter that supports roundtrip preservation of comments, | |
42 | seq/map flow style and map key order. | |
43 | ||
44 | %prep | |
45 | %setup -q -n %{module}-%{version} | |
46 | ||
47 | %build | |
48 | %if %{with python2} | |
49 | %py_build %{?with_tests:test} | |
50 | %endif | |
51 | ||
52 | %if %{with python3} | |
53 | %py3_build %{?with_tests:test} | |
54 | %endif | |
55 | ||
56 | %install | |
57 | rm -rf $RPM_BUILD_ROOT | |
58 | ||
59 | %if %{with python2} | |
60 | %py_install | |
61 | ||
62 | %py_postclean | |
63 | %endif | |
64 | ||
65 | %if %{with python3} | |
66 | %py3_install | |
67 | %endif | |
68 | ||
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %if %{with python2} | |
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc CHANGES README.rst | |
76 | %{py_sitescriptdir}/ruamel | |
77 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
78 | %{py_sitescriptdir}/%{module}-%{version}-py*-nspkg.pth | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %files -n python3-%{module} | |
83 | %defattr(644,root,root,755) | |
84 | %doc CHANGES README.rst | |
85 | %{py3_sitescriptdir}/ruamel | |
86 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
87 | %{py3_sitescriptdir}/%{module}-%{version}-py*-nspkg.pth | |
88 | %endif |