]> git.pld-linux.org Git - packages/python-pycairo.git/blob - python-pycairo.spec
cd5e11c5d3f63e4d6f91b3e8dbdc19d9bba5451e
[packages/python-pycairo.git] / python-pycairo.spec
1 #
2 # TODO: versions 1.19.0+ support only python 3
3 #
4 # Conditional build:
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7 %bcond_without  doc     # Sphinx documentation
8 %bcond_without  tests   # unit tests
9
10 %define         module  pycairo
11 Summary:        Python 2 Cairo bindings
12 Summary(pl.UTF-8):      Dowiązania Pythona 2 dla Cairo
13 Name:           python-%{module}
14 Version:        1.18.2
15 Release:        1
16 License:        LGPL v2.1 or MPL v1.1
17 Group:          Libraries/Python
18 Source0:        https://github.com/pygobject/pycairo/releases/download/v%{version}/%{module}-%{version}.tar.gz
19 # Source0-md5:  be2ba51f234270dec340f28f1695a95e
20 URL:            http://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 # python2 only for now
27 BuildRequires:  python-xpyb-devel >= 1.3
28 %if %{with tests}
29 BuildRequires:  python-hypothesis
30 BuildRequires:  python-numpy
31 BuildRequires:  python-pytest
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3 >= 1:3.3
36 BuildRequires:  python3-devel >= 1:3.3
37 %if %{with tests}
38 BuildRequires:  python3-hypothesis
39 BuildRequires:  python3-numpy
40 BuildRequires:  python3-pytest
41 %endif
42 %endif
43 BuildRequires:  rpm-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.714
45 %if %{with doc}
46 BuildRequires:  python-Sphinx
47 BuildRequires:  python-sphinx_rtd_theme
48 %endif
49 Requires:       python-libs >= 1:2.7
50 Requires:       cairo >= 1.13.1
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 Python 2 Cairo bindings.
55
56 %description -l pl.UTF-8
57 Dowiązania Pythona 2 dla Cairo.
58
59 %package devel
60 Summary:        Development files for Python 2 pycairo
61 Summary(pl.UTF-8):      Pliki programistyczne pycairo dla Pythona 2
62 Group:          Development/Libraries
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       cairo-devel >= 1.13.1
65 Requires:       python-devel >= 1:2.7
66
67 %description devel
68 Development files for Python 2 pycairo.
69
70 %description devel -l pl.UTF-8
71 Pliki programistyczne pycairo dla Pythona 2.
72
73 %package -n python3-%{module}
74 Summary:        Python 3 Cairo bindings
75 Summary(pl.UTF-8):      Dowiązania Pythona 3 dla Cairo
76 Group:          Libraries/Python
77 Requires:       cairo >= 1.13.1
78 Requires:       python3-libs >= 1:3.3
79
80 %description -n python3-%{module}
81 Python 3 Cairo bindings.
82
83 %description -n python3-%{module} -l pl.UTF-8
84 Dowiązania Pythona 3 dla Cairo.
85
86 %package -n python3-%{module}-devel
87 Summary:        Development files for Python 3 pycairo
88 Summary(pl.UTF-8):      Pliki programistyczne pycairo dla Pythona 3
89 Group:          Development/Libraries
90 Requires:       cairo-devel >= 1.13.1
91 Requires:       python3-%{module} = %{version}-%{release}
92 Requires:       python3-devel >= 1:3.3
93
94 %description -n python3-%{module}-devel
95 Development files for Python 3 pycairo.
96
97 %description -n python3-%{module}-devel -l pl.UTF-8
98 Pliki programistyczne pycairo dla Pythona 3.
99
100 %package apidocs
101 Summary:        API documentation for Python Cairo bindings
102 Summary(pl.UTF-8):      Dokumentacja API dla wiązań Pythona do Cairo
103 Group:          Documentation
104 BuildArch:      noarch
105
106 %description apidocs
107 API documentation for Python Cairo bindings.
108
109 %description apidocs -l pl.UTF-8
110 Dokumentacja API dla wiązań Pythona do Cairo.
111
112 %package examples
113 Summary:        Example programs using Python Cairo bindings
114 Summary(pl.UTF-8):      Przykładowe programy w Pythonie używające Cairo
115 Group:          Libraries/Python
116 Obsoletes:      python3-pycairo-devel
117 BuildArch:      noarch
118
119 %description examples
120 Example programs using Python Cairo bindings.
121
122 %description examples -l pl.UTF-8
123 Przykładowe programy w Pythonie używające Cairo.
124
125 %prep
126 %setup -q -n pycairo-%{version}
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}/cairo/py.typed
171 %{py_sitedir}/pycairo-%{version}-py*.egg-info
172
173 %files devel
174 %defattr(644,root,root,755)
175 %dir %{_includedir}/pycairo
176 %{_includedir}/pycairo/pycairo.h
177 %{_pkgconfigdir}/pycairo.pc
178 %endif
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}/cairo/py.typed
191 %{py3_sitedir}/pycairo-%{version}-py*.egg-info
192
193 %files -n python3-%{module}-devel
194 %defattr(644,root,root,755)
195 %dir %{_includedir}/pycairo
196 %{_includedir}/pycairo/py3cairo.h
197 %{_pkgconfigdir}/py3cairo.pc
198 %endif
199
200 %if %{with doc}
201 %files apidocs
202 %defattr(644,root,root,755)
203 %doc docs/_build/{_images,_static,reference,*.html,*.js}
204 %endif
205
206 %files examples
207 %defattr(644,root,root,755)
208 %{_examplesdir}/%{name}-%{version}
This page took 0.10943 seconds and 3 git commands to generate.