]>
Commit | Line | Data |
---|---|---|
6054ec1c JB |
1 | # TODO: run tests using nose2 instead of nose (following upstream) |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without doc # Sphinx documentation | |
5 | %bcond_without tests # unit tests | |
ef549ff4 JP |
6 | %bcond_without python2 # CPython 2.x module |
7 | %bcond_without python3 # CPython 3.x module | |
8 | ||
9 | %define module semantic_version | |
10 | Summary: A library implementing the 'SemVer' scheme | |
6054ec1c | 11 | Summary(pl.UTF-8): Biblioteka implementująca schemat "SemVer" |
ef549ff4 | 12 | Name: python-%{module} |
6054ec1c | 13 | Version: 2.9.0 |
db33183e | 14 | Release: 3 |
ef549ff4 JP |
15 | License: BSD |
16 | Group: Libraries/Python | |
17 | #Source0Download: https://pypi.org/simple/semantic-version/ | |
18 | Source0: https://files.pythonhosted.org/packages/source/s/semantic-version/%{module}-%{version}.tar.gz | |
6054ec1c | 19 | # Source0-md5: 1c79ce65c87479473223a642d2cbc3c2 |
ef549ff4 JP |
20 | URL: https://pypi.org/project/semantic-version/ |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.7 | |
23 | BuildRequires: python-setuptools | |
6054ec1c JB |
24 | %if %{with nose} |
25 | BuildRequires: python-nose | |
26 | %endif | |
ef549ff4 JP |
27 | %endif |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.4 | |
30 | BuildRequires: python3-setuptools | |
6054ec1c JB |
31 | %if %{with nose} |
32 | BuildRequires: python3-nose | |
33 | %endif | |
ef549ff4 JP |
34 | %endif |
35 | BuildRequires: rpm-pythonprov | |
36 | BuildRequires: rpmbuild(macros) >= 1.714 | |
9e83c846 JB |
37 | %if %{with doc} |
38 | BuildRequires: python3-sphinx_rtd_theme | |
39 | BuildRequires: sphinx-pdg-3 | |
40 | %endif | |
ef549ff4 JP |
41 | Requires: python-modules >= 1:2.7 |
42 | BuildArch: noarch | |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
45 | %description | |
6054ec1c | 46 | This small Python library provides a few tools to handle SemVer in |
ef549ff4 JP |
47 | Python. It follows strictly the 2.0.0 version of the SemVer scheme. |
48 | ||
6054ec1c JB |
49 | %description -l pl.UTF-8 |
50 | Ta mała biblioteka Pythona dostarcza kilka narzędzi do obsługi SemVer | |
51 | w Pythonie. Jest ściśle zgodna z wersją 2.0.0 schematu SemVer. | |
52 | ||
ef549ff4 JP |
53 | %package -n python3-%{module} |
54 | Summary: A library implementing the 'SemVer' scheme | |
6054ec1c | 55 | Summary(pl.UTF-8): Biblioteka implementująca schemat "SemVer" |
ef549ff4 JP |
56 | Group: Libraries/Python |
57 | Requires: python3-modules >= 1:3.4 | |
58 | ||
59 | %description -n python3-%{module} | |
6054ec1c | 60 | This small Python library provides a few tools to handle SemVer in |
ef549ff4 JP |
61 | Python. It follows strictly the 2.0.0 version of the SemVer scheme. |
62 | ||
6054ec1c JB |
63 | %description -n python3-%{module} -l pl.UTF-8 |
64 | Ta mała biblioteka Pythona dostarcza kilka narzędzi do obsługi SemVer | |
65 | w Pythonie. Jest ściśle zgodna z wersją 2.0.0 schematu SemVer. | |
66 | ||
67 | %package apidocs | |
68 | Summary: API documentation for Python semantic_version module | |
69 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona semantic_version | |
70 | Group: Documentation | |
71 | ||
72 | %description apidocs | |
73 | API documentation for Python semantic_version module. | |
74 | ||
75 | %description apidocs -l pl.UTF-8 | |
76 | Dokumentacja API modułu Pythona semantic_version. | |
77 | ||
ef549ff4 JP |
78 | %prep |
79 | %setup -q -n %{module}-%{version} | |
80 | ||
81 | %build | |
82 | %if %{with python2} | |
83 | %py_build | |
6054ec1c JB |
84 | |
85 | %if %{with tests} | |
86 | PYTHONPATH=$(pwd) \ | |
87 | nosetests-%{py_ver} tests | |
88 | %endif | |
ef549ff4 JP |
89 | %endif |
90 | ||
91 | %if %{with python3} | |
92 | %py3_build | |
6054ec1c JB |
93 | |
94 | %if %{with tests} | |
95 | PYTHONPATH=$(pwd) \ | |
96 | nosetests-%{py3_ver} tests | |
97 | %endif | |
98 | %endif | |
99 | ||
100 | %if %{with doc} | |
101 | %{__make} -C docs html \ | |
9e83c846 | 102 | SPHINXBUILD=sphinx-build-3 |
ef549ff4 JP |
103 | %endif |
104 | ||
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %py_install | |
110 | ||
111 | %py_postclean | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %py3_install | |
116 | %endif | |
117 | ||
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
6054ec1c | 124 | %doc CREDITS ChangeLog LICENSE README.rst |
ef549ff4 JP |
125 | %{py_sitescriptdir}/%{module} |
126 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %files -n python3-%{module} | |
131 | %defattr(644,root,root,755) | |
6054ec1c | 132 | %doc CREDITS ChangeLog LICENSE README.rst |
ef549ff4 JP |
133 | %{py3_sitescriptdir}/%{module} |
134 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
135 | %endif | |
6054ec1c JB |
136 | |
137 | %if %{with doc} | |
138 | %files apidocs | |
139 | %defattr(644,root,root,755) | |
140 | %doc docs/_build/html/{_static,*.html,*.js} | |
141 | %endif |