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