- use %python_clone instead of manual copying

- drop shebang and executable from the included test setup.py
  instead of complicated post-install fixing

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pbr?expand=0&rev=76
This commit is contained in:
Jan Matejek 2017-10-30 16:14:51 +00:00 committed by Git OBS Bridge
parent 53561b360b
commit 4dfea91c65
2 changed files with 12 additions and 18 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Oct 30 16:09:24 UTC 2017 - jmatejek@suse.com
- use %python_clone instead of manual copying
- drop shebang and executable from the included test setup.py
instead of complicated post-install fixing
-------------------------------------------------------------------
Tue Aug 8 06:04:36 UTC 2017 - tbechtold@suse.com

View File

@ -67,29 +67,16 @@ information.
# Get rid of ugly build-time deps that require network:
sed -i "s/, 'sphinx\.ext\.intersphinx'//" doc/source/conf.py
# Fix wrong-script-interpreter
sed -i "s|#!/usr/bin/env python|#!/usr/bin/python|" pbr/tests/testpackage/setup.py
# drop interpreter from test setup.py
sed -i "1s|^#!/.*||" pbr/tests/testpackage/setup.py
chmod -x pbr/tests/testpackage/setup.py
%build
%python_build
%install
%{python_expand %$python_install
mv %{buildroot}%{_bindir}/pbr %{buildroot}%{_bindir}/pbr-%{$python_bin_suffix}
}
%prepare_alternative pbr
# Fix wrong-script-interpreter
%python_expand sed -i "s|#!/usr/bin/python|#!%__$python|" %{buildroot}%{$python_sitelib}/pbr/tests/testpackage/setup.py
%if %have_python2
%py_compile %{buildroot}%{python2_sitelib}/pbr/tests/testpackage/
%py_compile -O %{buildroot}%{python2_sitelib}/pbr/tests/testpackage/
%endif
%if %have_python3
%py3_compile %{buildroot}%{python3_sitelib}/pbr/tests/testpackage/
%py3_compile -O %{buildroot}%{python3_sitelib}/pbr/tests/testpackage/
%endif
%python_install
%python_clone -a %{buildroot}%{_bindir}/pbr
%python_expand %fdupes %{buildroot}%{$python_sitelib}