From a72fc1fc635b91baf6bc47cd24d1e3d3b7dc97c66185d6d2122c61e3c5478d26 Mon Sep 17 00:00:00 2001 From: Yuchen Lin Date: Sat, 12 Aug 2017 18:26:36 +0000 Subject: [PATCH] Accepting request 514815 from devel:languages:python 1 OBS-URL: https://build.opensuse.org/request/show/514815 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-networkx?expand=0&rev=12 --- python-networkx.changes | 5 +++++ python-networkx.spec | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/python-networkx.changes b/python-networkx.changes index ca505a7..b324808 100644 --- a/python-networkx.changes +++ b/python-networkx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 6 04:46:44 UTC 2017 - toddrme2178@gmail.com + +- Fix shebangs + ------------------------------------------------------------------- Thu May 11 03:12:50 UTC 2017 - toddrme2178@gmail.com diff --git a/python-networkx.spec b/python-networkx.spec index 7dd1280..b126743 100644 --- a/python-networkx.spec +++ b/python-networkx.spec @@ -72,13 +72,13 @@ Documentation and examples for %{name}. %prep %setup -q -n networkx-%{version} +sed -i "s|#!/usr/bin/env python|#!%__python3|" examples/drawing/unix_email.py %build %python_build %install %python_install -%python_expand %fdupes %{buildroot}%{$python_sitelib} # Move docs into correct directory if necessary if [ "%{_docdir}" != "%{_datadir}/doc" ] ; then @@ -86,9 +86,24 @@ if [ "%{_docdir}" != "%{_datadir}/doc" ] ; then mv %{buildroot}%{_datadir}/doc/networkx-%{version} %{buildroot}%{_docdir}/ fi +%fdupes %{buildroot}%{_docdir} + # Installation instructions shouldn't be packaged rm %{buildroot}%{_docdir}/networkx-%{version}/INSTALL.txt +%{python_expand pushd %{buildroot}%{$python_sitelib} +# Fix wrong-script-interpreter +find networkx -name '*test*.py' -exec sed -i "s|#!/usr/bin/env python|#!%__$python|" {} \; +find networkx -name '*test*.py' -exec grep -q '#!%__$python' {} \; -exec chmod a+x {} \; +# Deduplicating files can generate a RPMLINT warning for pyc mtime +find networkx -name '*test*.py' -exec $python -m compileall -d %{$python_sitelib} {} \; +find networkx -name '*test*.py' -exec $python -O -m compileall -d %{$python_sitelib} {} \; +rm -f _current_flavor +%fdupes . +popd +} + + %files %{python_files} %defattr(-,root,root) %doc README.rst LICENSE.txt