1- %define use_python python3
2- %define use_python_pkg python3
3-
41%if 0%{?suse_version } && 0%{?suse_version } < 1500
52# use python36 on SLE 12 and older
6- %define use_python python3.6
3+ %define %__python3 python3.6
74%define use_python_pkg python36
5+ %else
6+ %define use_python_pkg python3
87%endif
98
109%define completion_dir_bash %{_datadir }/bash-completion/completions
1312%define completion_dir_zsh %{_datadir }/zsh/functions/Completion
1413%define osc_plugin_dir %{_prefix }/lib/osc-plugins
1514# need to override python_sitelib because it is not set as we would expect on many distros
16- %define python_sitelib %(RPM_BUILD_ROOT= %{ use_python } -Ic "import sysconfig; print(sysconfig.get_path('purelib'))")
15+ %define python_sitelib %(RPM_BUILD_ROOT= %__python3 -Ic "import sysconfig; print(sysconfig.get_path('purelib'))")
1716
1817# generate manpages on distros where argparse-manpage >= 3 and python3-Sphinx are available
1918# please note that RHEL build requires packages from CRB and EPEL repositories
@@ -150,7 +149,7 @@ for a general introduction.
150149%autosetup -p1
151150
152151%build
153- %{ use_python } setup.py build
152+ %__python 3 setup.py build
154153
155154# write rpm macros
156155cat << EOF > macros.osc
@@ -174,7 +173,7 @@ sphinx-build -b man doc .
174173%endif
175174
176175%install
177- %{ use_python } setup.py install -O1 --skip-build --force --root %{buildroot } --prefix %{_prefix }
176+ %__python 3 setup.py install -O1 --skip-build --force --root %{buildroot } --prefix %{_prefix }
178177
179178# symlink /usr/bin/git-obs to /usr/libexec/git/obs
180179mkdir -p %{buildroot }%{_libexecdir }/git
@@ -208,7 +207,7 @@ install -Dm0644 oscrc.5 %{buildroot}%{_mandir}/man5/oscrc.5
208207%python3_fix_shebang
209208
210209%check
211- %{ use_python } -m unittest
210+ %__python 3 -m unittest
212211
213212%files
214213%defattr(-,root,root,-)
0 commit comments