Blame SPECS/python-networkx.spec

17c848
%if 0%{?fedora} || 0%{?rhel} > 7
17c848
# Enable python3 build by default
17c848
%bcond_without python3
17c848
%else
17c848
%bcond_with python3
17c848
%endif
17c848
17c848
%if 0%{?rhel} > 7
17c848
# Disable python2 build by default
17c848
%bcond_with python2
17c848
%bcond_with docs
17c848
%else
17c848
%bcond_without python2
17c848
%bcond_without docs
17c848
%endif
17c848
17c848
%if 0%{?fedora} || 0%{?rhel} > 7
17c848
%global with_gdal 0
17c848
%endif
17c848
17c848
%global srcname networkx
17c848
17c848
Name:           python-%{srcname}
17c848
Version:        1.11
17c848
Release:        16.1%{?dist}
17c848
Summary:        Creates and Manipulates Graphs and Networks
17c848
License:        BSD
17c848
URL:            http://networkx.github.io/
17c848
Source0:        https://github.com/networkx/networkx/archive/%{srcname}-%{version}.tar.gz
17c848
Patch0:         %{srcname}-optional-modules.patch
17c848
# Fix sphinx build error
17c848
# https://github.com/networkx/networkx/issues/2340
17c848
Patch3:         python-networkx-sphinx.patch
17c848
BuildArch:      noarch
17c848
17c848
%description
17c848
NetworkX is a Python package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
%if %{with python2}
17c848
%package -n python2-%{srcname}
17c848
Summary:        Creates and Manipulates Graphs and Networks
17c848
Requires:       python2-%{srcname}-core = %{version}-%{release}
17c848
%if 0%{?with_gdal}
17c848
Requires:       python2-%{srcname}-geo = %{version}-%{release}
17c848
Requires:       python2-%{srcname}-drawing = %{version}-%{release}
17c848
%endif # with gdal
17c848
17c848
%{?python_provide:%python_provide python2-%{srcname}}
17c848
17c848
%description -n python2-%{srcname}
17c848
NetworkX is a Python 2 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
%package -n python2-%{srcname}-core
17c848
Summary:        Creates and Manipulates Graphs and Networks
17c848
BuildRequires:  python2-devel
17c848
BuildRequires:  python2-decorator
17c848
BuildRequires:  python2-scipy
17c848
BuildRequires:  python2-setuptools
17c848
BuildRequires:  python2-yaml
17c848
BuildRequires:  python2-pyparsing
17c848
BuildRequires:  python2-nose
17c848
17c848
Requires:       python2-decorator
17c848
Requires:       python2-scipy
17c848
Requires:       python2-yaml
17c848
Requires:       python2-pyparsing
17c848
17c848
%{?python_provide:%python_provide python2-%{srcname}-core}
17c848
17c848
%description -n python2-%{srcname}-core
17c848
NetworkX is a Python 2 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
17c848
%if 0%{?with_gdal}
17c848
17c848
%package -n python2-%{srcname}-geo
17c848
Summary:        GDAL I/O
17c848
Requires:       python2-%{srcname}-core = %{version}-%{release}
17c848
BuildRequires:  python2-gdal
17c848
Requires:       python2-gdal
17c848
17c848
%{?python_provide:%python_provide python2-%{srcname}-geo}
17c848
17c848
%description -n python2-%{srcname}-geo
17c848
NetworkX is a Python 3 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
This package provides GDAL I/O support.
17c848
17c848
17c848
%package -n python2-%{srcname}-drawing
17c848
Summary:        visual representations for graphs and networks
17c848
Requires:       python2-%{srcname}-core = %{version}-%{release}
17c848
BuildRequires:  python2-graphviz
17c848
BuildRequires:  python2-matplotlib
17c848
BuildRequires:  python2-pydotplus
17c848
Requires:       python2-graphviz
17c848
Requires:       python2-matplotlib
17c848
Requires:       python2-pydotplus
17c848
17c848
%{?python_provide:%python_provide python2-%{srcname}-drawing}
17c848
17c848
%description -n python2-%{srcname}-drawing
17c848
NetworkX is a Python 2 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
This package provides support for graph visualizations.
17c848
17c848
%endif # with gdal
17c848
%endif # with python2
17c848
17c848
17c848
%if %{with python3}
17c848
%package -n python3-%{srcname}
17c848
Summary:        Creates and Manipulates Graphs and Networks
17c848
Requires:       python3-%{srcname}-core = %{version}-%{release}
17c848
%if 0%{?with_gdal}
17c848
Requires:       python3-%{srcname}-geo = %{version}-%{release}
17c848
Requires:       python3-%{srcname}-drawing = %{version}-%{release}
17c848
%endif
17c848
17c848
%{?python_provide:%python_provide python3-%{srcname}}
17c848
17c848
%description -n python3-%{srcname}
17c848
NetworkX is a Python 3 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
%package -n python3-%{srcname}-core
17c848
Summary:        Creates and Manipulates Graphs and Networks
17c848
BuildRequires:  python3-devel
17c848
BuildRequires:  python3-setuptools
17c848
Requires:       python3-decorator
17c848
Requires:       python3-yaml
17c848
Requires:       python3-scipy
17c848
Requires:       python3-pyparsing
17c848
17c848
%{?python_provide:%python_provide python3-%{srcname}-core}
17c848
17c848
%description -n python3-%{srcname}-core
17c848
NetworkX is a Python 3 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
%if 0%{?with_gdal}
17c848
%package -n python3-%{srcname}-geo
17c848
Summary:        GDAL I/O
17c848
Requires:       python3-%{srcname}-core = %{version}-%{release}
17c848
BuildRequires:  gdal-python3
17c848
Requires:       gdal-python3
17c848
17c848
%{?python_provide:%python_provide python3-%{srcname}-geo}
17c848
17c848
%description -n python3-%{srcname}-geo
17c848
NetworkX is a Python 3 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
This package provides GDAL I/O support.
17c848
17c848
%package -n python3-%{srcname}-drawing
17c848
Summary:        visual representations for graphs and networks
17c848
Requires:       python3-%{srcname}-core = %{version}-%{release}
17c848
BuildRequires:  python3-matplotlib
17c848
BuildRequires:  python3-pydotplus
17c848
Requires:       python3-matplotlib
17c848
Requires:       python3-pydotplus
17c848
17c848
%{?python_provide:%python_provide python3-%{srcname}-drawing}
17c848
17c848
%description -n python3-%{srcname}-drawing
17c848
NetworkX is a Python 3 package for the creation, manipulation, and
17c848
study of the structure, dynamics, and functions of complex networks.
17c848
17c848
This package provides support for graph visualizations.
17c848
%endif
17c848
17c848
%endif # with python3
17c848
17c848
17c848
%if %{with docs}
17c848
%package doc
17c848
Summary:        Documentation for networkx
17c848
17c848
BuildRequires:  python2-pydotplus
17c848
BuildRequires:  python2-sphinx
17c848
BuildRequires:  python2-sphinx_rtd_theme
17c848
BuildRequires:  tex(latex)
17c848
BuildRequires:  tex-preview
17c848
BuildRequires:  python2-matplotlib
17c848
Provides:       bundled(jquery)
17c848
17c848
17c848
%description doc
17c848
Documentation for networkx
17c848
%endif # with docs
17c848
17c848
17c848
%prep
17c848
%setup -q -n %{srcname}-%{srcname}-%{version}
17c848
%patch0 -p1
17c848
%patch3 -p1 -b .sphinx
17c848
17c848
# Fix permissions
17c848
find examples -type f -perm /0111 -exec chmod a-x {} +
17c848
17c848
%build
17c848
%if %{with python2}
17c848
%py2_build
17c848
%endif # with python2
17c848
17c848
# Documentation build
17c848
# Conditionalize it since it requires python2 for now
17c848
%if %{with docs}
17c848
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-build -C doc html
17c848
%endif # with docs
17c848
17c848
%if %{with python3}
17c848
# Setup for python3
17c848
%if %{with python2}
17c848
mv build build2
17c848
mv networkx/*.pyc build2
17c848
%endif # with python2
17c848
# Build for python3
17c848
%py3_build
17c848
%endif # with python3
17c848
17c848
%install
17c848
%if %{with python3}
17c848
# Install the python3 version
17c848
%py3_install
17c848
%endif # with python3
17c848
17c848
%if %{with python2}
17c848
# Setup for python2
17c848
mv build build3
17c848
mv build2 build
17c848
mv -f build/*.pyc networkx
17c848
17c848
# Install the python2 version
17c848
%py2_install
17c848
17c848
# Fix permissions and binary paths
17c848
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python2_sitelib}`; do
17c848
  sed 's|/usr/bin/env python|%{_bindir}/python2|' $f > $f.new
17c848
  touch -r $f $f.new
17c848
  chmod a+x $f.new
17c848
  mv -f $f.new $f
17c848
done
17c848
%endif # with python2
17c848
17c848
%if %{with python3}
17c848
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python3_sitelib}`; do
17c848
  sed 's|/usr/bin/env python|%{__python3}|' $f > $f.new
17c848
  touch -r $f $f.new
17c848
  chmod a+x $f.new
17c848
  mv -f $f.new $f
17c848
done
17c848
%endif # with python3
17c848
17c848
#if %{with docs}
17c848
mv $RPM_BUILD_ROOT%{_docdir}/networkx-%{version} ./installed-docs
17c848
rm -f installed-docs/INSTALL.txt
17c848
#endif # with docs
17c848
17c848
%clean
17c848
rm -fr %{buildroot}
17c848
rm -f /tmp/tmp??????
17c848
17c848
%check
17c848
%if %{with python2}
17c848
mkdir site-packages
17c848
mv networkx site-packages
17c848
PYTHONPATH=$PWD/site-packages %{__python2} -c "import networkx; networkx.test()"
17c848
%endif # with python2
17c848
17c848
%if %{with python2}
17c848
%files -n python2-%{srcname}
17c848
%doc README.rst
17c848
%license LICENSE.txt
17c848
17c848
%files -n python2-%{srcname}-core
17c848
%doc installed-docs/*
17c848
%{python2_sitelib}/*
17c848
%exclude %{python2_sitelib}/networkx/drawing/
17c848
%if 0%{?with_gdal}
17c848
%exclude %{python2_sitelib}/networkx/readwrite/nx_shp.py*
17c848
%endif # with gdal
17c848
17c848
%if 0%{?with_gdal}
17c848
%files -n python2-%{srcname}-drawing
17c848
%{python2_sitelib}/networkx/drawing
17c848
17c848
%files -n python2-%{srcname}-geo
17c848
%{python2_sitelib}/networkx/readwrite/nx_shp.py*
17c848
%endif # with gdal
17c848
%endif # with python2
17c848
17c848
%if %{with python3}
17c848
%files -n python3-networkx
17c848
%doc README.rst
17c848
%license LICENSE.txt
17c848
17c848
%files -n python3-networkx-core
17c848
%doc installed-docs/*
17c848
%{python3_sitelib}/*
17c848
%exclude %{python3_sitelib}/networkx/drawing/
17c848
%if 0%{?with_gdal}
17c848
%exclude %{python3_sitelib}/networkx/readwrite/nx_shp.py
17c848
%exclude %{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
17c848
%endif # with gdal
17c848
17c848
%if 0%{?with_gdal}
17c848
%files -n python3-networkx-drawing
17c848
%{python3_sitelib}/networkx/drawing
17c848
17c848
%files -n python3-networkx-geo
17c848
%{python3_sitelib}/networkx/readwrite/nx_shp.py
17c848
%{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
17c848
%endif # with gdal
17c848
%endif # with python3
17c848
17c848
%if %{with docs}
17c848
%files doc
17c848
%doc doc/build/html/*
17c848
%endif # with docs
17c848
17c848
17c848
%changelog
17c848
* Tue Oct 22 2019 Petr Lautrbach <plautrba@redhat.com> - 1.11-16.1
17c848
- Build dependencies cleanup
17c848
17c848
* Thu Jan 17 2019 Lon Hohberger <lon@redhat.com> - 1.11-15
17c848
- Fix gdal requires block
17c848
17c848
* Wed Jun 13 2018 Petr Viktorin <pviktori@redhat.com> - 1.11-14
17c848
- Don't build the geo subpackage
17c848
17c848
* Thu Jun 07 2018 Tomas Orsava <torsava@redhat.com> - 1.11-13
17c848
- Switch hardcoded python3 shebangs into the %%{__python3} macro
17c848
17c848
* Tue Apr 17 2018 LumĂ­r Balhar <lbalhar@redhat.com> - 1.11-12
17c848
- Build dependencies cleanup
17c848
17c848
* Wed Apr 11 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.11-11
17c848
- Conditionalize the Python 2 subpackage and don't build it on EL > 7
17c848
17c848
* Fri Mar 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.11-10
17c848
- Update Python 2 dependency declarations to new packaging standards
17c848
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
17c848
17c848
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-9
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
17c848
17c848
* Thu Dec 07 2017 Merlin Mathesius <mmathesi@redhat.com> - 1.11-8
17c848
- Cleanup spec file conditionals
17c848
17c848
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-7
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
17c848
17c848
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-6
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
17c848
17c848
* Fri Dec 23 2016 Orion Poplawski <orion@cora.nwra.com> - 1.11-5
17c848
- Add patch to fix sphinx build
17c848
17c848
* Mon Dec 19 2016 Miro HronÄŤok <mhroncok@redhat.com> - 1.11-5
17c848
- Rebuild for Python 3.6
17c848
17c848
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11-4
17c848
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
17c848
17c848
* Thu Apr 14 2016 Jerry James <loganjerry@gmail.com> - 1.11-3
17c848
- Change pydot dependencies to pydotplus (bz 1326957)
17c848
17c848
* Sat Apr  2 2016 Jerry James <loganjerry@gmail.com> - 1.11-2
17c848
- Fix gdal and pydot dependencies
17c848
17c848
* Sat Mar  5 2016 Jerry James <loganjerry@gmail.com> - 1.11-1
17c848
- New upstream version
17c848
- Drop upstreamed -numpy patch
17c848
17c848
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-2
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
17c848
17c848
* Mon Feb  1 2016 Jerry James <loganjerry@gmail.com> - 1.10-1
17c848
- Comply with latest python packaging guidelines (bz 1301767)
17c848
17c848
* Tue Dec  1 2015 Jerry James <loganjerry@gmail.com> - 1.10-1
17c848
- New upstream version
17c848
- Update URLs
17c848
- Add -numpy patch to fix test failure
17c848
17c848
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.1-5
17c848
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
17c848
17c848
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.1-4
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
17c848
17c848
* Sat Feb 21 2015 Jerry James <loganjerry@gmail.com> - 1.9.1-3
17c848
- Note bundled jquery
17c848
17c848
* Tue Oct  7 2014 Jerry James <loganjerry@gmail.com> - 1.9.1-2
17c848
- Fix python3-networkx-drawing subpackage (bz 1149980)
17c848
- Fix python(3)-geo subpackage
17c848
17c848
* Mon Sep 22 2014 Jerry James <loganjerry@gmail.com> - 1.9.1-1
17c848
- New upstream version
17c848
- Fix license handling
17c848
17c848
* Thu Jul 10 2014 Jerry James <loganjerry@gmail.com> - 1.9-2
17c848
- BR python-setuptools
17c848
17c848
* Tue Jul  8 2014 Jerry James <loganjerry@gmail.com> - 1.9-1
17c848
- New upstream version
17c848
- Drop upstreamed -test-rounding-fix patch
17c848
- Upstream no longer bundles python-decorator; drop the workaround
17c848
17c848
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-14
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
17c848
17c848
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.8.1-13
17c848
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
17c848
17c848
* Thu Mar 13 2014 Pádraig Brady <pbrady@redhat.com> - 1.8.1-12
17c848
- Split to subpackages and support EL6 and EL7
17c848
17c848
* Thu Oct  3 2013 Jerry James <loganjerry@gmail.com> - 1.8.1-2
17c848
- Update project and source URLs
17c848
17c848
* Fri Aug  9 2013 Jerry James <loganjerry@gmail.com> - 1.8.1-1
17c848
- New upstream version
17c848
17c848
* Mon Jul 29 2013 Jerry James <loganjerry@gmail.com> - 1.8-1
17c848
- New upstream version
17c848
- Add tex-preview BR for documentation
17c848
17c848
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7-2
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
17c848
17c848
* Mon Aug  6 2012 Jerry James <loganjerry@gmail.com> - 1.7-1
17c848
- New upstream version
17c848
17c848
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-3
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
17c848
17c848
* Tue Jan 10 2012 Jerry James <loganjerry@gmail.com> - 1.6-2
17c848
- Mass rebuild for Fedora 17
17c848
17c848
* Mon Nov 28 2011 Jerry James <loganjerry@gmail.com> - 1.6-1
17c848
- New upstream version
17c848
- Do not use bundled python-decorator
17c848
- Remove Requires: ipython, needed by one example only
17c848
- Clean junk files left in /tmp
17c848
17c848
* Wed Jun 22 2011 Jerry James <loganjerry@gmail.com> - 1.5-1
17c848
- New upstream version
17c848
- Drop defattr
17c848
- Build documentation
17c848
17c848
* Sat Apr 23 2011 Jerry James <loganjerry@gmail.com> - 1.4-1
17c848
- New upstream version
17c848
- Build for both python2 and python3
17c848
- Drop BuildRoot, clean script, and clean at start of install script
17c848
17c848
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-3
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
17c848
17c848
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.0.1-2
17c848
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
17c848
17c848
* Wed Jan 20 2010 Conrad Meyer <konrad@tylerc.org> - 1.0.1-1
17c848
- Bump version to 1.0.1.
17c848
- License changed LGPLv2+ -> BSD.
17c848
17c848
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.99-4
17c848
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
17c848
17c848
* Tue Mar 24 2009 Conrad Meyer <konrad@tylerc.org> - 0.99-3
17c848
- Replace __python macros with direct python invocations.
17c848
- Disable checks for now.
17c848
- Replace a define with global.
17c848
17c848
* Thu Mar 12 2009 Conrad Meyer <konrad@tylerc.org> - 0.99-2
17c848
- License is really LGPLv2+.
17c848
- Include license as documentation.
17c848
- Add a check section to run tests.
17c848
17c848
* Sat Dec 13 2008 Conrad Meyer <konrad@tylerc.org> - 0.99-1
17c848
- Initial package.