3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: Simple Python interface for Graphviz
9 Summary(pl.UTF-8): Prosty pythonowy interfejs do Graphviza
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/graphviz/
16 Source0: https://files.pythonhosted.org/packages/source/g/graphviz/graphviz-%{version}.zip
17 # Source0-md5: 38052fc62e2233efe9921334b0c97cf9
18 URL: https://github.com/xflr6/graphviz
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: sed >= 4.0
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools
26 BuildRequires: python-mock >= 2
27 BuildRequires: python-pytest >= 3.4
28 BuildRequires: python-pytest-cov
29 BuildRequires: python-pytest-mock >= 1.8
33 BuildRequires: python3-modules >= 1:3.4
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-pytest >= 3.4
37 BuildRequires: python3-pytest-cov
38 BuildRequires: python3-pytest-mock >= 1.8
42 BuildRequires: graphviz
45 BuildRequires: python3-sphinx_rtd_theme
46 BuildRequires: sphinx-pdg-3 >= 1.7
49 Requires: python-modules >= 1:2.7
51 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54 This package facilitates the creation and rendering of graph
55 descriptions in the DOT language of the Graphviz graph drawing
58 %description -l pl.UTF-8
59 Ten pakiet wspomaga tworzenie i renderowanie opisów grafów w języku
60 DOT oprogramowania do rysowania grafów Graphviz z poziomu Pythona.
62 %package -n python3-graphviz
63 Summary: Simple Python interface for Graphviz
64 Summary(pl.UTF-8): Prosty pythonowy interfejs do Graphviza
65 Group: Libraries/Python
67 Requires: python3-modules >= 1:3.4
69 %description -n python3-graphviz
70 This package facilitates the creation and rendering of graph
71 descriptions in the DOT language of the Graphviz graph drawing
74 %description -n python3-graphviz -l pl.UTF-8
75 Ten pakiet wspomaga tworzenie i renderowanie opisów grafów w języku
76 DOT oprogramowania do rysowania grafów Graphviz z poziomu Pythona.
79 Summary: API documentation for Python graphviz module
80 Summary(pl.UTF-8): Dokumentacja API modułu Pythona graphviz
84 API documentation for Python graphviz module.
86 %description apidocs -l pl.UTF-8
87 Dokumentacja API modułu Pythona graphviz.
90 %setup -q -n graphviz-%{version}
97 %{__python} run-tests.py
105 %{__python3} run-tests.py
111 sphinx-build-3 -b html . _build/html
115 rm -rf $RPM_BUILD_ROOT
128 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}
129 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}
130 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}/*.py
133 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}
134 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}
135 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}/*.py
139 rm -rf $RPM_BUILD_ROOT
143 %defattr(644,root,root,755)
144 %doc CHANGES.txt LICENSE.txt README.rst
145 %{py_sitescriptdir}/graphviz
146 %{py_sitescriptdir}/graphviz-%{version}-py*.egg-info
147 %{_examplesdir}/python-graphviz-%{version}
151 %files -n python3-graphviz
152 %defattr(644,root,root,755)
153 %doc CHANGES.txt LICENSE.txt README.rst
154 %{py3_sitescriptdir}/graphviz
155 %{py3_sitescriptdir}/graphviz-%{version}-py*.egg-info
156 %{_examplesdir}/python3-graphviz-%{version}
161 %defattr(644,root,root,755)
162 %doc docs/_build/html/{_images,_static,*.html,*.js}