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