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