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