python-networkx/python-networkx.spec

214 lines
7.0 KiB
RPMSpec
Raw Normal View History

2020-03-10 11:56:31 +00:00
Name: python-networkx
Version: 1.11
Release: 14
Summary: Python package for creating and manipulating graphs and networks
License: BSD
URL: http://networkx.github.io/
Source0: https://github.com/networkx/networkx/archive/networkx-1.11.tar.gz
# make importing of drawing and geo subpackages optional
Patch0000: networkx-optional-modules.patch
# Fix sphinx build error
# https://github.com/networkx/networkx/issues/2340
Patch0001: python-networkx-sphinx.patch
BuildArch: noarch
%description
NetworkX is a Python 2 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python2-networkx
Summary: Creates and Manipulates Graphs and Networks
Requires: python2-networkx-core = 1.11-14 python2-networkx-geo = 1.11-14
Requires: python2-networkx-drawing = 1.11-14
%{?python_provide:%python_provide python2-networkx}
%description -n python2-networkx
NetworkX is a Python 2 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python2-networkx-core
Summary: Creates and Manipulates Graphs and Networks
BuildRequires: python2-devel python2-decorator python2-scipy python2-setuptools
BuildRequires: python2-yaml python2-pyparsing python2-nose
Requires: python2-decorator python2-scipy python2-yaml python2-pyparsing
%{?python_provide:%python_provide python2-networkx-core}
%description -n python2-networkx-core
NetworkX is a Python 2 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python2-networkx-geo
Summary: GDAL I/O
Requires: python2-networkx-core = 1.11-14 python2-gdal
BuildRequires: python2-gdal
%{?python_provide:%python_provide python2-networkx-geo}
%description -n python2-networkx-geo
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides GDAL I/O support.
%package -n python2-networkx-drawing
Summary: visual representations for graphs and networks
Requires: python2-networkx-core = 1.11-14
BuildRequires: python2.7dist(gv) python2-matplotlib python2-pydotplus
Requires: python2.7dist(gv) python2-matplotlib python2-pydotplus
%{?python_provide:%python_provide python2-networkx-drawing}
%description -n python2-networkx-drawing
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides support for graph visualizations.
%package -n python3-networkx
Summary: Creates and Manipulates Graphs and Networks
Requires: python3-networkx-core = 1.11-14 python3-networkx-geo = 1.11-14
Requires: python3-networkx-drawing = 1.11-14
%{?python_provide:%python_provide python3-networkx}
%description -n python3-networkx
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python3-networkx-core
Summary: Creates and Manipulates Graphs and Networks
BuildRequires: python3-devel python3-decorator python3-yaml
BuildRequires: python3-scipy python3-pyparsing python3-setuptools
Requires: python3-decorator python3-yaml python3-scipy python3-pyparsing
%{?python_provide:%python_provide python3-networkx-core}
%description -n python3-networkx-core
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python3-networkx-geo
Summary: GDAL I/O
Requires: python3-networkx-core = 1.11-14 gdal-python3
BuildRequires: gdal-python3
%{?python_provide:%python_provide python3-networkx-geo}
%description -n python3-networkx-geo
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides GDAL I/O support.
%package -n python3-networkx-drawing
Summary: visual representations for graphs and networks
Requires: python3-networkx-core = 1.11-14 python3-matplotlib python3-pydotplus
BuildRequires: python3-matplotlib python3-pydotplus
%{?python_provide:%python_provide python3-networkx-drawing}
%description -n python3-networkx-drawing
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides support for graph visualizations.
%package help
Summary: Documentation for networkx
BuildRequires: python2-pandas python2-pydotplus python2-sphinx python2-sphinx_rtd_theme
BuildRequires: python2-sphinxcontrib-bibtex python2-ipython python2-numpydoc
BuildRequires: tex(latex) tex-preview python2-matplotlib
Provides: bundled(jquery) python-networkx-doc = 1.11-14
Obsoletes: python-networkx-doc < 1.11-14
%description help
Documentation for networkx
%prep
%autosetup -n networkx-networkx-%{version} -p1
find examples -type f -perm /0111 | xargs chmod a-x
%build
%py2_build
sed -i 's/^[[:blank:]]*python/&2/' doc/Makefile
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-build-2 -C doc html
mv build build2
mv networkx/*.pyc build2
%py3_build
%install
%py3_install
mv build build3
mv build2 build
mv -f build/*.pyc networkx
%py2_install
mv $RPM_BUILD_ROOT%{_docdir}/networkx-1.11 ./installed-docs
rm -f installed-docs/INSTALL.txt
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python2_sitelib}`; do
sed 's|/usr/bin/env python|%{_bindir}/python2|' $f > $f.new
touch -r $f $f.new
chmod a+x $f.new
mv -f $f.new $f
done
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python3_sitelib}`; do
sed 's|/usr/bin/env python|%{_bindir}/python3|' $f > $f.new
touch -r $f $f.new
chmod a+x $f.new
mv -f $f.new $f
done
%clean
rm -fr %{buildroot}
rm -f /tmp/tmp??????
%check
mkdir site-packages
mv networkx site-packages
PYTHONPATH=$PWD/site-packages python2 -c "import networkx; networkx.test()"
%files -n python2-networkx
%doc README.rst LICENSE.txt
%files -n python2-networkx-core
%doc installed-docs/*
%{python2_sitelib}/*
%exclude %{python2_sitelib}/networkx/drawing/
%exclude %{python2_sitelib}/networkx/readwrite/nx_shp.py*
%files -n python2-networkx-drawing
%{python2_sitelib}/networkx/drawing
%files -n python2-networkx-geo
%{python2_sitelib}/networkx/readwrite/nx_shp.py*
%files -n python3-networkx
%doc README.rst LICENSE.txt
%files -n python3-networkx-core
%doc installed-docs/*
%{python3_sitelib}/*
%exclude %{python3_sitelib}/networkx/drawing/
%exclude %{python3_sitelib}/networkx/readwrite/nx_shp.py
%exclude %{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
%files -n python3-networkx-drawing
%{python3_sitelib}/networkx/drawing
%files -n python3-networkx-geo
%{python3_sitelib}/networkx/readwrite/nx_shp.py
%{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
%files help
%doc doc/build/html/*
%changelog
* Tue May 10 2020 liangdong <liangdong10@huawei.com> - 1.11-14
- Package init