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