Vedran Miletić fc659b5
Name:           python-pygraphviz
663bdc4
Version:        1.11
ddf8f94
Release:        %autorelease
cc9084a
Summary:        Create and Manipulate Graphs and Networks
Vedran Miletić fc659b5
License:        BSD
Vedran Miletić fc659b5
URL:            http://networkx.lanl.gov/pygraphviz/
8b5d68f
Source0:        https://github.com/pygraphviz/pygraphviz/archive/pygraphviz-%{version}.tar.gz
407ff7b
Patch0:         pygraphviz-pygraphviz-1.11-Remove-outdated-pystrings.swg-508.patch
Vedran Miletić fc659b5
db41b0e
BuildRequires:  make
07e5317
BuildRequires:  gcc
eac4b12
BuildRequires:  python3-devel
8b5d68f
BuildRequires:  python3dist(setuptools)
8b5d68f
BuildRequires:  python3dist(sphinx)
038f13c
BuildRequires:  python3dist(pytest)
db41b0e
BuildRequires:  python3dist(sphinx-rtd-theme)
db41b0e
BuildRequires:  python3dist(sphinx-gallery)
db41b0e
BuildRequires:  python3dist(numpydoc)
3099e9c
BuildRequires:  python3dist(matplotlib)
Vedran Miletić fc659b5
BuildRequires:  graphviz-devel
8b5d68f
BuildRequires:  swig
Vedran Miletić fc659b5
806b3e2
%global _description %{expand:
806b3e2
PyGraphviz is a Python interface to the Graphviz graph layout and
806b3e2
visualization package. With PyGraphviz you can create, edit, read,
806b3e2
write, and draw graphs using Python to access the Graphviz graph data
806b3e2
structure and layout algorithms. PyGraphviz is independent from
806b3e2
NetworkX but provides a similar programming interface.}
cc9084a
584c301
%description %_description
584c301
cc9084a
%package -n python3-pygraphviz
584c301
Summary:        %{summary}
584c301
%{?python_provide:%python_provide python3-pygraphviz}
cc9084a
584c301
%description -n python3-pygraphviz %_description
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%package doc
Vedran Miletić fc659b5
Summary:        Documentation for pygraphviz
a838e7b
Provides:       bundled(jquery)
cc9084a
BuildArch:      noarch
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%description doc
584c301
Documentation for PyGraphViz.
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%prep
74bac02
%autosetup -p1 -n pygraphviz-pygraphviz-%{version}
8b5d68f
8b5d68f
# Regenerate the swig-generated files
8b5d68f
swig -python pygraphviz/graphviz.i
8b5d68f
8b5d68f
# Fix the shebangs in the examples
8b5d68f
for fil in examples/*.py; do
8b5d68f
  sed -i.orig 's,%{_bindir}/env python,%{__python3},' $fil
8b5d68f
  touch -r $fil.orig $fil
8b5d68f
  rm $fil.orig
8b5d68f
done
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%build
584c301
%py3_build
584c301
cc9084a
# docs
19eef8a
%make_build -C doc html PYTHONPATH=$(echo $PWD/build/lib.%{python3_platform}-*)
35bfd1d
# or $PWD/build/lib.%%{python3_platform}-%%(%%python3 -c 'import sys; print(sys.implementation.cache_tag)'
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%install
584c301
%py3_install
20a4b11
mv %{buildroot}%{_docdir}/pygraphviz-* %{buildroot}%{_pkgdocdir}
cc9084a
rm %{buildroot}%{_pkgdocdir}/INSTALL.txt
8b5d68f
cp -p README.rst %{buildroot}%{_pkgdocdir}
584c301
rm doc/build/html/.buildinfo
cc9084a
cp -av doc/build/html %{buildroot}%{_pkgdocdir}/
eac4b12
chmod g-w %{buildroot}%{python3_sitearch}/pygraphviz/_graphviz.*.so
Vedran Miletić fc659b5
584c301
%global _docdir_fmt %{name}
584c301
2ba564d
%check
038f13c
pytest -v %{buildroot}%{python3_sitearch}/pygraphviz/tests/
2ba564d
cc9084a
%files -n python3-pygraphviz
8b5d68f
%{python3_sitearch}/pygraphviz*
8b5d68f
%exclude %{python3_sitearch}/pygraphviz/graphviz_wrap.c
2969349
%doc %dir %{_pkgdocdir}
8b5d68f
%doc %{_pkgdocdir}/README.rst
8b5d68f
%license LICENSE
Vedran Miletić fc659b5
cc9084a
%files doc
2969349
%doc %dir %{_pkgdocdir}
cc9084a
%doc %{_pkgdocdir}/html
cc9084a
%doc %{_pkgdocdir}/examples
8b5d68f
%license LICENSE
Vedran Miletić fc659b5
Vedran Miletić fc659b5
%changelog
ddf8f94
%autochangelog