]> git.pld-linux.org Git - packages/python-pycairo.git/blob - python-pycairo.spec
rebuild with tests and docs
[packages/python-pycairo.git] / python-pycairo.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_with     python3 # CPython 3.x module (built from python3-pycairo.spec)
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 %define         module  pycairo
9 Summary:        Python 2 Cairo bindings
10 Summary(pl.UTF-8):      Dowiązania Pythona 2 dla Cairo
11 Name:           python-%{module}
12 # keep 1.18.x here for python2 support
13 Version:        1.18.2
14 Release:        3
15 License:        LGPL v2.1 or MPL v1.1
16 Group:          Libraries/Python
17 #Source0Download: https://github.com/pygobject/pycairo/releases
18 Source0:        https://github.com/pygobject/pycairo/releases/download/v%{version}/%{module}-%{version}.tar.gz
19 # Source0-md5:  be2ba51f234270dec340f28f1695a95e
20 URL:            https://www.cairographics.org/
21 BuildRequires:  cairo-devel >= 1.13.1
22 BuildRequires:  pkgconfig
23 %if %{with python2}
24 BuildRequires:  python >= 1:2.7
25 BuildRequires:  python-devel >= 1:2.7
26 BuildRequires:  python-setuptools
27 # python2 only for now
28 BuildRequires:  python-xpyb-devel >= 1.3
29 %if %{with tests}
30 BuildRequires:  python-hypothesis
31 BuildRequires:  python-numpy
32 BuildRequires:  python-pytest
33 %endif
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3 >= 1:3.4
37 BuildRequires:  python3-devel >= 1:3.4
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
40 BuildRequires:  python3-hypothesis
41 BuildRequires:  python3-numpy
42 BuildRequires:  python3-pytest
43 %endif
44 %endif
45 BuildRequires:  rpm-build >= 4.6
46 BuildRequires:  rpm-pythonprov
47 BuildRequires:  rpmbuild(macros) >= 1.714
48 %if %{with doc}
49 BuildRequires:  python3-Sphinx
50 BuildRequires:  python3-sphinx_rtd_theme
51 %endif
52 Requires:       python-libs >= 1:2.7
53 Requires:       cairo >= 1.13.1
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 %description
57 Python 2 Cairo bindings.
58
59 %description -l pl.UTF-8
60 Dowiązania Pythona 2 dla Cairo.
61
62 %package devel
63 Summary:        Development files for Python 2 pycairo
64 Summary(pl.UTF-8):      Pliki programistyczne pycairo dla Pythona 2
65 Group:          Development/Libraries
66 Requires:       %{name} = %{version}-%{release}
67 Requires:       cairo-devel >= 1.13.1
68 Requires:       python-devel >= 1:2.7
69
70 %description devel
71 Development files for Python 2 pycairo.
72
73 %description devel -l pl.UTF-8
74 Pliki programistyczne pycairo dla Pythona 2.
75
76 %package -n python3-%{module}
77 Summary:        Python 3 Cairo bindings
78 Summary(pl.UTF-8):      Dowiązania Pythona 3 dla Cairo
79 Group:          Libraries/Python
80 Requires:       cairo >= 1.13.1
81 Requires:       python3-libs >= 1:3.4
82
83 %description -n python3-%{module}
84 Python 3 Cairo bindings.
85
86 %description -n python3-%{module} -l pl.UTF-8
87 Dowiązania Pythona 3 dla Cairo.
88
89 %package -n python3-%{module}-devel
90 Summary:        Development files for Python 3 pycairo
91 Summary(pl.UTF-8):      Pliki programistyczne pycairo dla Pythona 3
92 Group:          Development/Libraries
93 Requires:       cairo-devel >= 1.13.1
94 Requires:       python3-%{module} = %{version}-%{release}
95 Requires:       python3-devel >= 1:3.4
96
97 %description -n python3-%{module}-devel
98 Development files for Python 3 pycairo.
99
100 %description -n python3-%{module}-devel -l pl.UTF-8
101 Pliki programistyczne pycairo dla Pythona 3.
102
103 %package apidocs
104 Summary:        API documentation for Python Cairo bindings
105 Summary(pl.UTF-8):      Dokumentacja API dla wiązań Pythona do Cairo
106 Group:          Documentation
107 BuildArch:      noarch
108
109 %description apidocs
110 API documentation for Python Cairo bindings.
111
112 %description apidocs -l pl.UTF-8
113 Dokumentacja API dla wiązań Pythona do Cairo.
114
115 %package examples
116 Summary:        Example programs using Python Cairo bindings
117 Summary(pl.UTF-8):      Przykładowe programy w Pythonie używające Cairo
118 Group:          Libraries/Python
119 Obsoletes:      python3-pycairo-examples < 1.16.3-3
120 BuildArch:      noarch
121
122 %description examples
123 Example programs using Python Cairo bindings.
124
125 %description examples -l pl.UTF-8
126 Przykładowe programy w Pythonie używające Cairo.
127
128 %prep
129 %setup -q -n pycairo-%{version}
130
131 %build
132 %if %{with python2}
133 %py_build %{?with_tests:test} \
134         --enable-xpyb
135 %endif
136
137 %if %{with python3}
138 %py3_build %{?with_tests:test}
139 %endif
140
141 %if %{with doc}
142 %{__make} -C docs
143 %endif
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT%{_examplesdir}
148
149 %if %{with python2}
150 %py_install
151
152 %py_postclean
153 %endif
154
155 %if %{with python3}
156 %py3_install
157 %endif
158
159 cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
160
161 %clean
162 rm -rf $RPM_BUILD_ROOT
163
164 %if %{with python2}
165 %files
166 %defattr(644,root,root,755)
167 %doc COPYING NEWS README.rst
168 %dir %{py_sitedir}/cairo
169 %attr(755,root,root) %{py_sitedir}/cairo/_cairo.so
170 %{py_sitedir}/cairo/__init__.py[co]
171 %{py_sitedir}/cairo/__init__.pyi
172 %{py_sitedir}/cairo/include
173 %{py_sitedir}/cairo/py.typed
174 %{py_sitedir}/pycairo-%{version}-py*.egg-info
175
176 %files devel
177 %defattr(644,root,root,755)
178 %dir %{_includedir}/pycairo
179 %{_includedir}/pycairo/pycairo.h
180 %{_pkgconfigdir}/pycairo.pc
181 %endif
182
183 %if %{with python3}
184 %files -n python3-%{module}
185 %defattr(644,root,root,755)
186 %doc COPYING NEWS README.rst
187 %dir %{py3_sitedir}/cairo
188 %attr(755,root,root) %{py3_sitedir}/cairo/_cairo.cpython-*.so
189 %{py3_sitedir}/cairo/__init__.py
190 %{py3_sitedir}/cairo/__init__.pyi
191 %{py3_sitedir}/cairo/__pycache__
192 %{py3_sitedir}/cairo/include
193 %{py3_sitedir}/cairo/py.typed
194 %{py3_sitedir}/pycairo-%{version}-py*.egg-info
195
196 %files -n python3-%{module}-devel
197 %defattr(644,root,root,755)
198 %dir %{_includedir}/pycairo
199 %{_includedir}/pycairo/py3cairo.h
200 %{_pkgconfigdir}/py3cairo.pc
201 %endif
202
203 %if %{with doc}
204 %files apidocs
205 %defattr(644,root,root,755)
206 %doc docs/_build/{_images,_static,reference,*.html,*.js}
207 %endif
208
209 %files examples
210 %defattr(644,root,root,755)
211 %{_examplesdir}/%{name}-%{version}
This page took 0.075673 seconds and 3 git commands to generate.