1
0

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
This commit is contained in:
2017-08-12 18:26:36 +00:00
committed by Git OBS Bridge
parent 31d15ec2d6
commit a72fc1fc63
2 changed files with 21 additions and 1 deletions

View File

@@ -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

View File

@@ -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