Accepting request 494504 from devel:languages:python

1

OBS-URL: https://build.opensuse.org/request/show/494504
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-networkx?expand=0&rev=11
This commit is contained in:
Dominique Leuenberger 2017-05-16 12:43:40 +00:00 committed by Git OBS Bridge
parent 640bcafda5
commit 31d15ec2d6
2 changed files with 47 additions and 34 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 11 03:12:50 UTC 2017 - toddrme2178@gmail.com
- Implement single-spec version.
- Fix source URL.
-------------------------------------------------------------------
Wed Aug 17 08:35:56 UTC 2016 - tbechtold@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package python-networkx
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,6 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-networkx
Version: 1.11
Release: 0
@ -23,39 +24,29 @@ Summary: Python package for the creation, manipulation,
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://networkx.lanl.gov
Source: http://pypi.python.org/packages/source/n/networkx/networkx-%{version}.tar.gz
Source: https://files.pythonhosted.org/packages/source/n/networkx/networkx-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: python-PyYAML
BuildRequires: python-decorator >= 3.4.0
BuildRequires: python-devel
BuildRequires: python-numpy-devel
BuildRequires: python-pydot
BuildRequires: python-pyparsing
BuildRequires: python-setuptools
#don't use non available deps on SLES
%if 0%{?suse_version} && 0%{?suse_version} != 1110 && 0%{?suse_version} != 1315
BuildRequires: python-matplotlib
BuildRequires: python-scipy
%endif
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module decorator >= 3.4.0}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module pydot}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module scipy}
Requires: python-decorator >= 3.4.0
# Recommends: is not understood by redhat's RPM version
%if 0%{?suse_version}
Recommends: python-pydot
Recommends: python-pygraphviz
Recommends: python-PyYAML
Recommends: python-pyparsing
Recommends: python-numpy
%if 0%{?suse_version} && 0%{?suse_version} != 1110 && 0%{?suse_version} != 1315
Recommends: python-matplotlib
Recommends: python-scipy
%endif
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%python_subpackages
%description
NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics,
@ -69,28 +60,44 @@ Features:
* Exploits existing code from high-quality legacy software in C, C++, Fortran, etc.
* Open source (encourages community input)
* Unit-tested
%package -n %{name}-doc
Summary: Documentation for %{name}
Group: Documentation/Other
Provides: %{python_module networkx-doc = %{version}}
%description -n %{name}-doc
Documentation and examples for %{name}.
%prep
%setup -q -n networkx-%{version}
sed -i -e "s@share/doc/networkx-.*@%{_docdir}/%{name}'@g" setup.py
# _docdir contains absolute path, strip /usr/ prefix again
sed -i -e "/^docdirbase/s@/usr/@@" setup.py
find networkx/ examples/ -name "*.py" -exec sed -i -e '/^#!\s\?\/usr\/bin\/\(env\s\)\?python$/d' {} ';'
sed -i 's/\r//' examples/algorithms/hartford_drug.edgelist
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root %{buildroot}
rm -r %{buildroot}%{_docdir}/%{name}/INSTALL.txt # Makes no sense
%fdupes -s %{buildroot}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%files
# Move docs into correct directory if necessary
if [ "%{_docdir}" != "%{_datadir}/doc" ] ; then
mkdir -p %{buildroot}%{_docdir}/
mv %{buildroot}%{_datadir}/doc/networkx-%{version} %{buildroot}%{_docdir}/
fi
# Installation instructions shouldn't be packaged
rm %{buildroot}%{_docdir}/networkx-%{version}/INSTALL.txt
%files %{python_files}
%defattr(-,root,root)
%{_docdir}/%{name}
%doc README.rst LICENSE.txt
%{python_sitelib}/networkx/
%{python_sitelib}/networkx-%{version}-py*.egg-info
%files -n %{name}-doc
%defattr(-,root,root)
%doc LICENSE.txt
%{_docdir}/networkx-%{version}/
%changelog