]>
Commit | Line | Data |
---|---|---|
06d5ad30 JR |
1 | # |
2 | # Conditional build: | |
6ec3f4ec JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
7c720dc3 | 5 | %bcond_with tests # unit tests (need git configured for user) |
06d5ad30 JR |
6 | |
7 | %define module PyGitUp | |
6ec3f4ec JB |
8 | Summary: git-up(1) - fetch and rebase all locally-tracked remote branches |
9 | Summary(pl.UTF-8): git-up(1) - pobieranie i rebase wszystkich śledzonych lokalnie zdanych gałęzi | |
06d5ad30 | 10 | Name: python-%{module} |
6ec3f4ec | 11 | Version: 1.6.1 |
ad55a363 | 12 | Release: 7 |
6ec3f4ec | 13 | License: MIT |
06d5ad30 | 14 | Group: Libraries/Python |
6ec3f4ec | 15 | #Source0Download: https://github.com/msiemens/PyGitUp/releases |
2e077a6f | 16 | Source0: https://github.com/msiemens/PyGitUp/archive/v%{version}/%{module}-v%{version}.tar.gz |
6ec3f4ec | 17 | # Source0-md5: 8573a0c48aa0afa6dddae51d1cd204c1 |
710242d7 | 18 | Patch0: click-version.patch |
615730f1 | 19 | URL: https://github.com/msiemens/PyGitUp |
7c720dc3 | 20 | %{?with_tests:BuildRequires: git-core} |
6ec3f4ec JB |
21 | %if %{with python2} |
22 | BuildRequires: python-modules >= 1:2.7 | |
23 | BuildRequires: python-setuptools | |
24 | %if %{with tests} | |
25 | BuildRequires: python-click >= 7.0 | |
7f13615e | 26 | BuildRequires: python-colorama >= 0.3.7 |
6ec3f4ec JB |
27 | BuildRequires: python-git >= 2.1.8 |
28 | BuildRequires: python-nose >= 1.3.7 | |
7f13615e | 29 | BuildRequires: python-six >= 1.10.0 |
5d7881fc | 30 | BuildRequires: python-termcolor >= 1.1.0 |
6ec3f4ec JB |
31 | %endif |
32 | %endif | |
33 | %if %{with python3} | |
34 | BuildRequires: python3-modules >= 1:3.4 | |
35 | BuildRequires: python3-setuptools | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-click >= 7.0 | |
38 | BuildRequires: python3-colorama >= 0.3.7 | |
39 | BuildRequires: python3-git >= 2.1.8 | |
40 | BuildRequires: python3-nose >= 1.3.7 | |
41 | BuildRequires: python3-six >= 1.10.0 | |
42 | BuildRequires: python3-termcolor >= 1.1.0 | |
43 | %endif | |
44 | %endif | |
45 | BuildRequires: rpm-pythonprov | |
46 | BuildRequires: rpmbuild(macros) >= 1.714 | |
47 | Requires: python-modules >= 1:2.7 | |
06d5ad30 JR |
48 | BuildArch: noarch |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
50 | ||
51 | %description | |
6ec3f4ec JB |
52 | git-up(1) - fetch and rebase all locally-tracked remote branches. |
53 | ||
54 | %description -l pl.UTF-8 | |
55 | git-up(1) - pobieranie i rebase wszystkich śledzonych lokalnie zdanych | |
56 | gałęzi. | |
57 | ||
58 | %package -n python3-%{module} | |
59 | Summary: git-up(1) - fetch and rebase all locally-tracked remote branches | |
60 | Summary(pl.UTF-8): git-up(1) - pobieranie i rebase wszystkich śledzonych lokalnie zdanych gałęzi | |
61 | Group: Libraries/Python | |
62 | Requires: python3-modules >= 1:3.4 | |
63 | ||
64 | %description -n python3-%{module} | |
65 | git-up(1) - fetch and rebase all locally-tracked remote branches. | |
66 | ||
67 | %description -n python3-%{module} -l pl.UTF-8 | |
68 | git-up(1) - pobieranie i rebase wszystkich śledzonych lokalnie zdanych | |
69 | gałęzi. | |
06d5ad30 JR |
70 | |
71 | %prep | |
72 | %setup -q -n %{module}-%{version} | |
710242d7 | 73 | %patch0 -p1 |
06d5ad30 JR |
74 | |
75 | %build | |
6ec3f4ec | 76 | %if %{with python2} |
298e403c | 77 | %py_build %{?with_tests:test} |
6ec3f4ec JB |
78 | %endif |
79 | ||
80 | %if %{with python3} | |
81 | %py3_build %{?with_tests:test} | |
82 | %endif | |
06d5ad30 JR |
83 | |
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
6ec3f4ec | 87 | %if %{with python2} |
298e403c | 88 | %py_install |
06d5ad30 | 89 | |
8c43a7cd JR |
90 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/git-up{,-2} |
91 | ||
06d5ad30 JR |
92 | %py_postclean |
93 | ||
6ec3f4ec JB |
94 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/PyGitUp/tests |
95 | %endif | |
96 | ||
8c43a7cd JR |
97 | %if %{with python3} |
98 | %py3_install | |
99 | ||
100 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/PyGitUp/tests | |
101 | %endif | |
102 | ||
06d5ad30 JR |
103 | %clean |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
6ec3f4ec | 106 | %if %{with python2} |
06d5ad30 JR |
107 | %files |
108 | %defattr(644,root,root,755) | |
6ec3f4ec | 109 | %doc LICENCE README.rst |
8c43a7cd | 110 | %attr(755,root,root) %{_bindir}/git-up-2 |
6ec3f4ec JB |
111 | %dir %{py_sitescriptdir}/PyGitUp |
112 | %{py_sitescriptdir}/PyGitUp/*.py[co] | |
113 | %{py_sitescriptdir}/PyGitUp/check-bundler.rb | |
114 | %{py_sitescriptdir}/git_up-%{version}-py*.egg-info | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
118 | %files -n python3-%{module} | |
119 | %defattr(644,root,root,755) | |
120 | %doc LICENCE README.rst | |
8c43a7cd | 121 | %attr(755,root,root) %{_bindir}/git-up |
6ec3f4ec JB |
122 | %dir %{py3_sitescriptdir}/PyGitUp |
123 | %{py3_sitescriptdir}/PyGitUp/*.py | |
124 | %{py3_sitescriptdir}/PyGitUp/__pycache__ | |
125 | %{py3_sitescriptdir}/PyGitUp/check-bundler.rb | |
126 | %{py3_sitescriptdir}/git_up-%{version}-py*.egg-info | |
06d5ad30 | 127 | %endif |