1
0
python-networkx/python-networkx.spec

119 lines
4.0 KiB
RPMSpec

#
# spec file for package python-networkx
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-networkx
Version: 1.11
Release: 0
Summary: Python package for the creation, manipulation,
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://networkx.lanl.gov
Source: https://files.pythonhosted.org/packages/source/n/networkx/networkx-%{version}.tar.gz
BuildRequires: fdupes
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: python-pydot
Recommends: python-pygraphviz
Recommends: python-PyYAML
Recommends: python-pyparsing
Recommends: python-numpy
Recommends: python-matplotlib
Recommends: python-scipy
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics,
and functions of complex networks.
Features:
* Includes standard graph-theoretic and statistical physics functions
* Easy exchange of network algorithms between applications, disciplines, and platforms
* Includes many classic graphs and synthetic networks
* Nodes and edges can be "anything" (e.g. time-series, text, images, XML records)
* 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 "s|#!/usr/bin/env python|#!%__python3|" examples/drawing/unix_email.py
%build
%python_build
%install
%python_install
# 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
%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
%{python_sitelib}/networkx/
%{python_sitelib}/networkx-%{version}-py*.egg-info
%files -n %{name}-doc
%defattr(-,root,root)
%doc LICENSE.txt
%{_docdir}/networkx-%{version}/
%changelog