]>
Commit | Line | Data |
---|---|---|
23d84bf7 MK |
1 | # |
2 | # Conditional build: | |
b9af2bb5 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
8352fbfd JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
23d84bf7 MK |
7 | |
8 | %define module objgraph | |
9 | Summary: Draws Python object reference graphs with graphviz | |
b9af2bb5 | 10 | Summary(pl.UTF-8): Rysowanie referencji między obiektami przy uzyciu graphviza |
23d84bf7 | 11 | Name: python-objgraph |
b9af2bb5 | 12 | Version: 3.4.1 |
4ed168c8 | 13 | Release: 4 |
23d84bf7 MK |
14 | License: MIT |
15 | Group: Development/Languages/Python | |
b9af2bb5 JB |
16 | #Source0Download: https://pypi.org/simple/objgraph/ |
17 | Source0: https://files.pythonhosted.org/packages/source/o/objgraph/%{module}-%{version}.tar.gz | |
18 | # Source0-md5: 4f416da377b3c7799799c357c6f0c2ed | |
19 | Patch0: %{name}-mock.patch | |
23d84bf7 | 20 | URL: http://mg.pov.lt/objgraph/ |
23d84bf7 | 21 | BuildRequires: rpm-pythonprov |
8352fbfd JK |
22 | BuildRequires: rpmbuild(macros) >= 1.714 |
23 | %if %{with python2} | |
b9af2bb5 | 24 | BuildRequires: python-modules >= 1:2.7 |
8352fbfd | 25 | BuildRequires: python-setuptools |
b9af2bb5 JB |
26 | %if %{with tests} |
27 | BuildRequires: python-graphviz | |
28 | BuildRequires: python-mock | |
29 | %endif | |
8352fbfd JK |
30 | %endif |
31 | %if %{with python3} | |
b9af2bb5 | 32 | BuildRequires: python3-modules >= 1:3.5 |
8352fbfd | 33 | BuildRequires: python3-setuptools |
b9af2bb5 JB |
34 | %if %{with tests} |
35 | BuildRequires: python3-graphviz | |
36 | %endif | |
8352fbfd | 37 | %endif |
8ea9379e JK |
38 | %if %{with tests} |
39 | BuildRequires: graphviz | |
40 | %endif | |
b9af2bb5 | 41 | Requires: python-modules >= 1:2.7 |
23d84bf7 MK |
42 | BuildArch: noarch |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
44 | ||
8352fbfd | 45 | # optional dependency |
b9af2bb5 JB |
46 | %define _noautoreq_pyegg graphviz |
47 | %define _noautoreq_py3egg graphviz | |
23d84bf7 | 48 | |
8352fbfd JK |
49 | %description |
50 | Module that lets you visually explore Python object graphs and debug | |
51 | memory leaks. | |
23d84bf7 MK |
52 | |
53 | %description -l pl.UTF-8 | |
b9af2bb5 | 54 | Moduł do wizualizacji grafów pythonowych obiektów i diagnozowania |
8352fbfd JK |
55 | wycieków pamięci. |
56 | ||
57 | %package -n python3-%{module} | |
58 | Summary: Draws Python object reference graphs with graphviz | |
b9af2bb5 | 59 | Summary(pl.UTF-8): Rysowanie referencji między obiektami przy uzyciu graphviza |
8352fbfd | 60 | Group: Development/Languages/Python |
b9af2bb5 | 61 | Requires: python3-modules >= 1:3.5 |
8352fbfd JK |
62 | |
63 | %description -n python3-%{module} | |
64 | Module that lets you visually explore Python object graphs and debug | |
65 | memory leaks. | |
66 | ||
67 | %description -n python3-%{module} -l pl.UTF-8 | |
b9af2bb5 | 68 | Moduł do wizualizacji grafów pythonowych obiektów i diagnozowania |
8352fbfd | 69 | wycieków pamięci. |
23d84bf7 | 70 | |
b9af2bb5 JB |
71 | %package apidocs |
72 | Summary: API documentation for Python objgraph module | |
73 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona objgraph | |
74 | Group: Documentation | |
75 | ||
76 | %description apidocs | |
77 | API documentation for Python objgraph module. | |
78 | ||
79 | %description apidocs -l pl.UTF-8 | |
80 | Dokumentacja API modułu Pythona objgraph. | |
81 | ||
23d84bf7 MK |
82 | %prep |
83 | %setup -q -n %{module}-%{version} | |
b9af2bb5 | 84 | %patch0 -p1 |
23d84bf7 | 85 | |
23d84bf7 | 86 | %build |
8352fbfd | 87 | %if %{with python2} |
b9af2bb5 JB |
88 | %py_build |
89 | ||
90 | %if %{with tests} | |
91 | %{__python} tests.py | |
92 | %endif | |
8352fbfd | 93 | %endif |
23d84bf7 | 94 | |
8352fbfd | 95 | %if %{with python3} |
b9af2bb5 JB |
96 | %py3_build |
97 | ||
98 | %if %{with tests} | |
99 | %{__python3} tests.py | |
100 | %endif | |
101 | %endif | |
102 | ||
103 | %if %{with doc} | |
104 | sphinx-build-2 -b html docs docs/_build/html | |
8352fbfd | 105 | %endif |
23d84bf7 MK |
106 | |
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
23d84bf7 | 109 | |
8352fbfd JK |
110 | %if %{with python2} |
111 | %py_install | |
23d84bf7 | 112 | |
23d84bf7 | 113 | %py_postclean |
8352fbfd | 114 | %endif |
23d84bf7 | 115 | |
8352fbfd JK |
116 | %if %{with python3} |
117 | %py3_install | |
118 | %endif | |
23d84bf7 | 119 | |
b9af2bb5 JB |
120 | %clean |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
123 | %if %{with python2} | |
23d84bf7 MK |
124 | %files |
125 | %defattr(644,root,root,755) | |
b9af2bb5 | 126 | %doc CHANGES.rst LICENSE README.rst |
8352fbfd JK |
127 | %{py_sitescriptdir}/%{module}.py* |
128 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
b9af2bb5 | 129 | %endif |
8352fbfd | 130 | |
b9af2bb5 | 131 | %if %{with python3} |
8352fbfd JK |
132 | %files -n python3-%{module} |
133 | %defattr(644,root,root,755) | |
b9af2bb5 | 134 | %doc CHANGES.rst LICENSE README.rst |
8352fbfd JK |
135 | %{py3_sitescriptdir}/%{module}.py |
136 | %{py3_sitescriptdir}/__pycache__/%{module}.* | |
137 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
b9af2bb5 | 138 | %endif |
8352fbfd | 139 | |
b9af2bb5 JB |
140 | %if %{with doc} |
141 | %files apidocs | |
142 | %defattr(644,root,root,755) | |
143 | %doc docs/_build/html/{_images,_static,*.html,*.js} | |
144 | %endif |