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