]>
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 | |
59ffb74c | 10 | Release: 3 |
1b5f8cc0 JP |
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 | |
1b5f8cc0 JP |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
31 | YAML parser/emitter that supports roundtrip preservation of comments, | |
32 | seq/map flow style and map key order. | |
33 | ||
34 | %package -n python3-%{module} | |
35 | Summary: YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style and map key order | |
36 | Group: Libraries/Python | |
37 | Requires: python3-modules | |
38 | ||
39 | %description -n python3-%{module} | |
40 | YAML parser/emitter that supports roundtrip preservation of comments, | |
41 | seq/map flow style and map key order. | |
42 | ||
43 | %prep | |
44 | %setup -q -n %{module}-%{version} | |
45 | ||
46 | %build | |
47 | %if %{with python2} | |
48 | %py_build %{?with_tests:test} | |
49 | %endif | |
50 | ||
51 | %if %{with python3} | |
52 | %py3_build %{?with_tests:test} | |
53 | %endif | |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
57 | ||
58 | %if %{with python2} | |
d3e485aa JP |
59 | install -d $RPM_BUILD_ROOT%{py_sitedir}/ruamel/yaml |
60 | ||
1b5f8cc0 JP |
61 | %py_install |
62 | ||
63 | %py_postclean | |
64 | %endif | |
65 | ||
66 | %if %{with python3} | |
d3e485aa JP |
67 | install -d $RPM_BUILD_ROOT%{py3_sitedir}/ruamel/yaml |
68 | ||
1b5f8cc0 JP |
69 | %py3_install |
70 | %endif | |
71 | ||
72 | %clean | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %if %{with python2} | |
76 | %files | |
77 | %defattr(644,root,root,755) | |
78 | %doc CHANGES README.rst | |
d3e485aa | 79 | %{py_sitescriptdir}/ruamel/yaml |
1b5f8cc0 JP |
80 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info |
81 | %{py_sitescriptdir}/%{module}-%{version}-py*-nspkg.pth | |
d3e485aa | 82 | %dir %{py_sitedir}/ruamel/yaml |
1b5f8cc0 JP |
83 | %endif |
84 | ||
85 | %if %{with python3} | |
86 | %files -n python3-%{module} | |
87 | %defattr(644,root,root,755) | |
88 | %doc CHANGES README.rst | |
d3e485aa | 89 | %{py3_sitescriptdir}/ruamel/yaml |
1b5f8cc0 JP |
90 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info |
91 | %{py3_sitescriptdir}/%{module}-%{version}-py*-nspkg.pth | |
d3e485aa | 92 | %dir %{py3_sitedir}/ruamel/yaml |
1b5f8cc0 | 93 | %endif |