]>
Commit | Line | Data |
---|---|---|
283903ce | 1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # unit tests (FIXME) | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module (built from python3-versioneer.spec) | |
6 | ||
7 | Summary: Easy VCS-based management of project version strings | |
8 | Summary(pl.UTF-8): Łatwe, oparte o VCS zarządzanie łańcuchami wersji projektu | |
9 | Name: python-versioneer | |
10 | # keep 0.18 here for python2 support | |
11 | Version: 0.18 | |
12 | Release: 1 | |
13 | License: Public Domain | |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/versioneer/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/v/versioneer/versioneer-%{version}.tar.gz | |
17 | # Source0-md5: c8000ed8adf127cc95fa2584e9810115 | |
18 | URL: https://pypi.org/project/versioneer/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.6 | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-modules >= 1:3.2 | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | BuildRequires: rpm-pythonprov | |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | Requires: python-modules >= 1:2.6 | |
30 | BuildArch: noarch | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | Versioneer is a tool to automatically update version strings (in | |
35 | setup.py and the conventional "from PROJECT import _version" pattern) | |
36 | by asking your version-control system about the current tree. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Versioneer to narzędzie do automatycznego uaktualniania łańcuchów | |
40 | wersji (w setup.py oraz konwencjonalnym wzorcu "from PROJECT import | |
41 | _version), odpytując system kontroli wersji o bieżące drzewo. | |
42 | ||
43 | %package -n python3-versioneer | |
44 | Summary: Easy VCS-based management of project version strings | |
45 | Summary(pl.UTF-8): Łatwe, oparte o VCS zarządzanie łańcuchami wersji projektu | |
46 | Group: Libraries/Python | |
47 | Requires: python3-modules >= 1:3.2 | |
48 | ||
49 | %description -n python3-versioneer | |
50 | Versioneer is a tool to automatically update version strings (in | |
51 | setup.py and the conventional "from PROJECT import _version" pattern) | |
52 | by asking your version-control system about the current tree. | |
53 | ||
54 | %description -n python3-versioneer -l pl.UTF-8 | |
55 | Versioneer to narzędzie do automatycznego uaktualniania łańcuchów | |
56 | wersji (w setup.py oraz konwencjonalnym wzorcu "from PROJECT import | |
57 | _version), odpytując system kontroli wersji o bieżące drzewo. | |
58 | ||
59 | %prep | |
60 | %setup -q -n versioneer-%{version} | |
61 | ||
62 | %build | |
63 | %if %{with python2} | |
64 | %py_build | |
65 | ||
66 | %if %{with tests} | |
67 | # FIXME: how to unpack versioneer.py for tests? | |
68 | %{__python} -m unittest discover -s test | |
69 | %endif | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
73 | %py3_build | |
74 | ||
75 | %if %{with tests} | |
76 | # FIXME: how to unpack versioneer.py for tests? | |
77 | %{__python3} -m unittest discover -s test | |
78 | %endif | |
79 | %endif | |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
85 | %py_install | |
86 | ||
87 | %py_postclean | |
88 | ||
89 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/versioneer{,-2} | |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %py3_install | |
94 | ||
95 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/versioneer{,-3} | |
96 | ln -sf versioneer-3 $RPM_BUILD_ROOT%{_bindir}/versioneer | |
97 | %endif | |
98 | ||
99 | %clean | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %files | |
104 | %defattr(644,root,root,755) | |
105 | %doc README.md details.md developers.md | |
106 | %attr(755,root,root) %{_bindir}/versioneer-2 | |
107 | %{py_sitescriptdir}/versioneer.py[co] | |
108 | %{py_sitescriptdir}/versioneer-%{version}-py*.egg-info | |
109 | %endif | |
110 | ||
111 | %if %{with python3} | |
112 | %files -n python3-versioneer | |
113 | %defattr(644,root,root,755) | |
114 | %doc README.md details.md developers.md | |
115 | %attr(755,root,root) %{_bindir}/versioneer | |
116 | %attr(755,root,root) %{_bindir}/versioneer-3 | |
117 | %{py3_sitescriptdir}/versioneer.py | |
118 | %{py3_sitescriptdir}/__pycache__/versioneer.cpython-*.py[co] | |
119 | %{py3_sitescriptdir}/versioneer-%{version}-py*.egg-info | |
120 | %endif |