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
11 # keep 0.16.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/graphviz/
18 Source0: https://files.pythonhosted.org/packages/source/g/graphviz/graphviz-%{version}.zip
19 # Source0-md5: 76a73ed4821bcd993519490ec46d2061
20 Patch0: %{name}-mock.patch
21 URL: https://github.com/xflr6/graphviz
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: sed >= 4.0
26 BuildRequires: python-modules >= 1:2.7
27 BuildRequires: python-setuptools
29 BuildRequires: python-mock >= 2
30 BuildRequires: python-pytest >= 4
31 BuildRequires: python-pytest-cov
32 BuildRequires: python-pytest-mock >= 1.8
36 BuildRequires: python3-modules >= 1:3.4
37 BuildRequires: python3-setuptools
39 BuildRequires: python3-pytest >= 4
40 BuildRequires: python3-pytest-cov
41 BuildRequires: python3-pytest-mock >= 1.8
45 BuildRequires: graphviz
48 BuildRequires: python3-sphinx_rtd_theme
49 BuildRequires: sphinx-pdg-3 >= 1.7
52 Requires: python-modules >= 1:2.7
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 This package facilitates the creation and rendering of graph
58 descriptions in the DOT language of the Graphviz graph drawing
61 %description -l pl.UTF-8
62 Ten pakiet wspomaga tworzenie i renderowanie opisów grafów w języku
63 DOT oprogramowania do rysowania grafów Graphviz z poziomu Pythona.
65 %package -n python3-graphviz
66 Summary: Simple Python interface for Graphviz
67 Summary(pl.UTF-8): Prosty pythonowy interfejs do Graphviza
68 Group: Libraries/Python
70 Requires: python3-modules >= 1:3.4
72 %description -n python3-graphviz
73 This package facilitates the creation and rendering of graph
74 descriptions in the DOT language of the Graphviz graph drawing
77 %description -n python3-graphviz -l pl.UTF-8
78 Ten pakiet wspomaga tworzenie i renderowanie opisów grafów w języku
79 DOT oprogramowania do rysowania grafów Graphviz z poziomu Pythona.
82 Summary: API documentation for Python graphviz module
83 Summary(pl.UTF-8): Dokumentacja API modułu Pythona graphviz
87 API documentation for Python graphviz module.
89 %description apidocs -l pl.UTF-8
90 Dokumentacja API modułu Pythona graphviz.
93 %setup -q -n graphviz-%{version}
101 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
102 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
103 %{__python} -m pytest tests
111 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
112 PYTEST_PLUGINS="pytest_cov.plugin,pytest_mock" \
113 %{__python3} -m pytest tests
119 sphinx-build-3 -b html . _build/html
123 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}
137 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}
138 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/python-graphviz-%{version}/*.py
141 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}
142 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}
143 %{__sed} -i -e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-graphviz-%{version}/*.py
147 rm -rf $RPM_BUILD_ROOT
151 %defattr(644,root,root,755)
152 %doc CHANGES.txt LICENSE.txt README.rst
153 %{py_sitescriptdir}/graphviz
154 %{py_sitescriptdir}/graphviz-%{version}-py*.egg-info
155 %{_examplesdir}/python-graphviz-%{version}
159 %files -n python3-graphviz
160 %defattr(644,root,root,755)
161 %doc CHANGES.txt LICENSE.txt README.rst
162 %{py3_sitescriptdir}/graphviz
163 %{py3_sitescriptdir}/graphviz-%{version}-py*.egg-info
164 %{_examplesdir}/python3-graphviz-%{version}
169 %defattr(644,root,root,755)
170 %doc docs/_build/html/{_images,_static,*.html,*.js}