]> git.pld-linux.org Git - packages/python-objgraph.git/blob - python-objgraph.spec
cdc7da6b2368119e46b388bfb2789999258fc039
[packages/python-objgraph.git] / python-objgraph.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 %define         module  objgraph
9 Summary:        Draws Python object reference graphs with graphviz
10 Summary(pl.UTF-8):      Rysowanie referencji między obiektami przy uzyciu graphviza
11 Name:           python-objgraph
12 Version:        3.4.1
13 Release:        3
14 License:        MIT
15 Group:          Development/Languages/Python
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
20 URL:            http://mg.pov.lt/objgraph/
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-graphviz
28 BuildRequires:  python-mock
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3-modules >= 1:3.5
33 BuildRequires:  python3-setuptools
34 %if %{with tests}
35 BuildRequires:  python3-graphviz
36 %endif
37 %endif
38 %if %{with tests}
39 BuildRequires:  graphviz
40 %endif
41 Requires:       python-modules >= 1:2.7
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 # optional dependency
46 %define         _noautoreq_pyegg        graphviz
47 %define         _noautoreq_py3egg       graphviz
48
49 %description
50 Module that lets you visually explore Python object graphs and debug
51 memory leaks.
52
53 %description -l pl.UTF-8
54 Moduł do wizualizacji grafów pythonowych obiektów i diagnozowania
55 wycieków pamięci.
56
57 %package -n python3-%{module}
58 Summary:        Draws Python object reference graphs with graphviz
59 Summary(pl.UTF-8):      Rysowanie referencji między obiektami przy uzyciu graphviza
60 Group:          Development/Languages/Python
61 Requires:       python3-modules >= 1:3.5
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
68 Moduł do wizualizacji grafów pythonowych obiektów i diagnozowania
69 wycieków pamięci.
70
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
82 %prep
83 %setup -q -n %{module}-%{version}
84 %patch0 -p1
85
86 %build
87 %if %{with python2}
88 %py_build
89
90 %if %{with tests}
91 %{__python} tests.py
92 %endif
93 %endif
94
95 %if %{with python3}
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
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %py_install
112
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
125 %defattr(644,root,root,755)
126 %doc CHANGES.rst LICENSE README.rst
127 %{py_sitescriptdir}/%{module}.py*
128 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
129 %endif
130
131 %if %{with python3}
132 %files -n python3-%{module}
133 %defattr(644,root,root,755)
134 %doc CHANGES.rst LICENSE README.rst
135 %{py3_sitescriptdir}/%{module}.py
136 %{py3_sitescriptdir}/__pycache__/%{module}.*
137 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
138 %endif
139
140 %if %{with doc}
141 %files apidocs
142 %defattr(644,root,root,755)
143 %doc docs/_build/html/{_images,_static,*.html,*.js}
144 %endif
This page took 0.073274 seconds and 2 git commands to generate.