Skip to content

Commit a4c716e

Browse files
committed
fix(spec): don't use home-grown %use_python but rather semi-standard %__python3
1 parent fef9ed9 commit a4c716e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

contrib/osc.spec

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
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
@@ -13,7 +12,7 @@
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+
%__python3 setup.py build
154153

155154
# write rpm macros
156155
cat << 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+
%__python3 setup.py install -O1 --skip-build --force --root %{buildroot} --prefix %{_prefix}
178177

179178
# symlink /usr/bin/git-obs to /usr/libexec/git/obs
180179
mkdir -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+
%__python3 -m unittest
212211

213212
%files
214213
%defattr(-,root,root,-)

0 commit comments

Comments
 (0)