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