]>
Commit | Line | Data |
---|---|---|
538c8396 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module pycairo | |
7 | Summary: Python 3 Cairo bindings | |
8 | Summary(pl.UTF-8): Dowiązania Pythona 3 dla Cairo | |
e841d876 | 9 | Name: python3-%{module} |
00e40d9d | 10 | Version: 1.20.1 |
00502a29 | 11 | Release: 2 |
538c8396 JB |
12 | License: LGPL v2.1 or MPL v1.1 |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://github.com/pygobject/pycairo/releases | |
15 | Source0: https://github.com/pygobject/pycairo/releases/download/v%{version}/%{module}-%{version}.tar.gz | |
00e40d9d | 16 | # Source0-md5: fa88a28cadbfb34192fe743d32c0ee33 |
538c8396 | 17 | URL: https://www.cairographics.org/ |
00e40d9d | 18 | BuildRequires: cairo-devel >= 1.15.10 |
538c8396 | 19 | BuildRequires: pkgconfig |
00e40d9d JB |
20 | BuildRequires: python3 >= 1:3.6 |
21 | BuildRequires: python3-devel >= 1:3.6 | |
22 | BuildRequires: python3-setuptools | |
538c8396 JB |
23 | %if %{with tests} |
24 | BuildRequires: python3-hypothesis | |
25 | BuildRequires: python3-numpy | |
26 | BuildRequires: python3-pytest | |
27 | %endif | |
28 | BuildRequires: rpm-build >= 4.6 | |
29 | BuildRequires: rpm-pythonprov | |
30 | BuildRequires: rpmbuild(macros) >= 1.714 | |
31 | %if %{with doc} | |
32 | BuildRequires: python3-Sphinx | |
33 | BuildRequires: python3-sphinx_rtd_theme | |
34 | %endif | |
00e40d9d JB |
35 | Requires: python3-libs >= 1:3.6 |
36 | Requires: cairo >= 1.15.10 | |
538c8396 JB |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
39 | %description | |
40 | Python 3 Cairo bindings. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Dowiązania Pythona 3 dla Cairo. | |
44 | ||
45 | %package devel | |
46 | Summary: Development files for Python 3 pycairo | |
47 | Summary(pl.UTF-8): Pliki programistyczne pycairo dla Pythona 3 | |
48 | Group: Development/Libraries | |
49 | Requires: %{name} = %{version}-%{release} | |
00e40d9d JB |
50 | Requires: cairo-devel >= 1.15.10 |
51 | Requires: python3-devel >= 1:3.6 | |
538c8396 JB |
52 | |
53 | %description devel | |
54 | Development files for Python 3 pycairo. | |
55 | ||
56 | %description devel -l pl.UTF-8 | |
57 | Pliki programistyczne pycairo dla Pythona 3. | |
58 | ||
59 | %package apidocs | |
60 | Summary: API documentation for Python Cairo bindings | |
61 | Summary(pl.UTF-8): Dokumentacja API dla wiązań Pythona do Cairo | |
62 | Group: Documentation | |
63 | BuildArch: noarch | |
64 | ||
65 | %description apidocs | |
66 | API documentation for Python Cairo bindings. | |
67 | ||
68 | %description apidocs -l pl.UTF-8 | |
69 | Dokumentacja API dla wiązań Pythona do Cairo. | |
70 | ||
71 | %package examples | |
72 | Summary: Example programs using Python Cairo bindings | |
73 | Summary(pl.UTF-8): Przykładowe programy w Pythonie używające Cairo | |
74 | Group: Libraries/Python | |
75 | BuildArch: noarch | |
76 | ||
77 | %description examples | |
78 | Example programs using Python Cairo bindings. | |
79 | ||
80 | %description examples -l pl.UTF-8 | |
81 | Przykładowe programy w Pythonie używające Cairo. | |
82 | ||
83 | %prep | |
84 | %setup -q -n pycairo-%{version} | |
85 | ||
86 | %build | |
87 | %py3_build %{?with_tests:test} | |
88 | ||
89 | %if %{with doc} | |
90 | %{__make} -C docs | |
91 | %endif | |
92 | ||
93 | %install | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
96 | ||
97 | %py3_install | |
98 | ||
99 | cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %files | |
105 | %defattr(644,root,root,755) | |
106 | %doc COPYING NEWS README.rst | |
107 | %dir %{py3_sitedir}/cairo | |
108 | %attr(755,root,root) %{py3_sitedir}/cairo/_cairo.cpython-*.so | |
109 | %{py3_sitedir}/cairo/__init__.py | |
110 | %{py3_sitedir}/cairo/__init__.pyi | |
111 | %{py3_sitedir}/cairo/__pycache__ | |
112 | %{py3_sitedir}/cairo/include | |
113 | %{py3_sitedir}/cairo/py.typed | |
114 | %{py3_sitedir}/pycairo-%{version}-py*.egg-info | |
115 | ||
116 | %files devel | |
117 | %defattr(644,root,root,755) | |
118 | %dir %{_includedir}/pycairo | |
119 | %{_includedir}/pycairo/py3cairo.h | |
120 | %{_pkgconfigdir}/py3cairo.pc | |
121 | ||
122 | %if %{with doc} | |
123 | %files apidocs | |
124 | %defattr(644,root,root,755) | |
125 | %doc docs/_build/{_images,_static,reference,*.html,*.js} | |
126 | %endif | |
127 | ||
128 | %files examples | |
129 | %defattr(644,root,root,755) | |
130 | %{_examplesdir}/%{name}-%{version} |