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