]> git.pld-linux.org Git - packages/python-graphviz.git/blob - python-graphviz.spec
- new
[packages/python-graphviz.git] / python-graphviz.spec
1 #
2 # Conditional build:
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
7
8 Summary:        Simple Python interface for Graphviz
9 Summary(pl.UTF-8):      Prosty pythonowy interfejs do Graphviza
10 Name:           python-graphviz
11 Version:        0.10.1
12 Release:        1
13 License:        MIT
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
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.7
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-mock >= 2
27 BuildRequires:  python-pytest >= 3.4
28 BuildRequires:  python-pytest-cov
29 BuildRequires:  python-pytest-mock >= 1.8
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-modules >= 1:3.4
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-pytest >= 3.4
37 BuildRequires:  python3-pytest-cov
38 BuildRequires:  python3-pytest-mock >= 1.8
39 %endif
40 %endif
41 %if %{with tests}
42 BuildRequires:  graphviz
43 %endif
44 %if %{with apidocs}
45 BuildRequires:  python3-sphinx_rtd_theme
46 BuildRequires:  sphinx-pdg-3 >= 1.7
47 %endif
48 Requires:       graphviz
49 Requires:       python-modules >= 1:2.7
50 BuildArch:      noarch
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 This package facilitates the creation and rendering of graph
55 descriptions in the DOT language of the Graphviz graph drawing
56 software from Python.
57
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.
61
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
66 Requires:       graphviz
67 Requires:       python3-modules >= 1:3.4
68
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
72 software from Python.
73
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.
77
78 %package apidocs
79 Summary:        API documentation for Python graphviz module
80 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona graphviz
81 Group:          Documentation
82
83 %description apidocs
84 API documentation for Python graphviz module.
85
86 %description apidocs -l pl.UTF-8
87 Dokumentacja API modułu Pythona graphviz.
88
89 %prep
90 %setup -q -n graphviz-%{version}
91
92 %build
93 %if %{with python2}
94 %py_build
95
96 %if %{with tests}
97 %{__python} run-tests.py
98 %endif
99 %endif
100
101 %if %{with python3}
102 %py3_build
103
104 %if %{with tests}
105 %{__python3} run-tests.py
106 %endif
107 %endif
108
109 %if %{with doc}
110 cd docs
111 sphinx-build-3 -b html . _build/html
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %py_install
119
120 %py_postclean
121 %endif
122
123 %if %{with python3}
124 %py3_install
125 %endif
126
127 %if %{with python2}
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
131 %endif
132 %if %{with python3}
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
136 %endif
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %files
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}
148 %endif
149
150 %if %{with python3}
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}
157 %endif
158
159 %if %{with doc}
160 %files apidocs
161 %defattr(644,root,root,755)
162 %doc docs/_build/html/{_images,_static,*.html,*.js}
163 %endif
This page took 0.070077 seconds and 3 git commands to generate.