Blame SPECS/python-networkx.spec

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