1 | %{!?python3_sitearch: %define python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} |
---|
2 | |
---|
3 | Name: python3-pycairo |
---|
4 | Summary: Python3 bindings for the cairo library |
---|
5 | Summary(ja): cairo ライブラリの Python3 バインディング |
---|
6 | Version: 1.10.0 |
---|
7 | Release: 3%{?_dist_release} |
---|
8 | |
---|
9 | Group: Development/Languages |
---|
10 | License: LGPLv2 |
---|
11 | URL: http://cairographics.org/pycairo |
---|
12 | |
---|
13 | Source: http://cairographics.org/releases/pycairo-%{version}.tar.bz2 |
---|
14 | |
---|
15 | # patches from fedora |
---|
16 | Patch0: cairo-waf-use-python-config-as-shell-script.patch |
---|
17 | Patch1: pycairo-1.10.0-test-python3.patch |
---|
18 | Patch2: pycairo-1.10.0-pickle-python3.patch |
---|
19 | |
---|
20 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
21 | BuildRequires: cairo-devel >= 1.10.0 |
---|
22 | BuildRequires: python3-devel >= 3.0 |
---|
23 | BuildRequires: pkgconfig |
---|
24 | Requires: python3 >= 3.0 |
---|
25 | Requires: cairo >= 1.10.0 |
---|
26 | |
---|
27 | %description |
---|
28 | Python3 bindings for the cairo library. |
---|
29 | |
---|
30 | %package devel |
---|
31 | Summary: Libraries and headers for pycairo |
---|
32 | Group: Development/Libraries |
---|
33 | Requires: %{name} = %{version}-%{release} |
---|
34 | Requires: cairo-devel >= 1.10.0 |
---|
35 | Requires: python3-devel >= 3.0 |
---|
36 | |
---|
37 | %description devel |
---|
38 | This package contains files required to build wrappers for cairo add-on |
---|
39 | libraries so that they interoperate with pycairo3. |
---|
40 | |
---|
41 | %prep |
---|
42 | %setup -q -n pycairo-%{version} |
---|
43 | |
---|
44 | # Ensure that ./waf has created the cached unpacked version |
---|
45 | # of the wafadmin source tree. |
---|
46 | # This will be created to a subdirectory like |
---|
47 | # .waf3-1.5.18-a7b91e2a913ce55fa6ecdf310df95752 |
---|
48 | python3 ./waf --version |
---|
49 | |
---|
50 | %patch0 -p0 |
---|
51 | %patch1 -p1 |
---|
52 | %patch2 -p1 |
---|
53 | |
---|
54 | %build |
---|
55 | export CFLAGS="$RPM_OPT_FLAGS" |
---|
56 | export PYTHON=python3 |
---|
57 | python3 ./waf configure \ |
---|
58 | --prefix=%{_prefix} \ |
---|
59 | --libdir=%{_libdir} |
---|
60 | |
---|
61 | |
---|
62 | # do not fail on utf-8 encoded files |
---|
63 | LANG=en_US.utf8 python3 ./waf build -v |
---|
64 | |
---|
65 | # remove executable bits from examples |
---|
66 | find ./examples/ -type f -print0 | xargs -0 chmod -x |
---|
67 | |
---|
68 | %install |
---|
69 | rm -rf $RPM_BUILD_ROOT |
---|
70 | |
---|
71 | DESTDIR=$RPM_BUILD_ROOT python3 ./waf install |
---|
72 | find $RPM_BUILD_ROOT -name '*.la' | xargs rm -f |
---|
73 | |
---|
74 | # Remove stowaway py2 build artifacts |
---|
75 | find $RPM_BUILD_ROOT -name '*.pyc' | xargs rm -f |
---|
76 | find $RPM_BUILD_ROOT -name '*.pyo' | xargs rm -f |
---|
77 | |
---|
78 | %clean |
---|
79 | rm -rf $RPM_BUILD_ROOT |
---|
80 | |
---|
81 | %files |
---|
82 | %defattr(-,root,root,-) |
---|
83 | %doc AUTHORS COPYING* INSTALL NEWS README |
---|
84 | %{python3_sitearch}/cairo/ |
---|
85 | |
---|
86 | %files devel |
---|
87 | %defattr(-,root,root,-) |
---|
88 | %{_includedir}/pycairo/py3cairo.h |
---|
89 | %{_libdir}/pkgconfig/py3cairo.pc |
---|
90 | |
---|
91 | %changelog |
---|
92 | * Tue Jun 28 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.0-3 |
---|
93 | - rebuild with python-3.5.2 |
---|
94 | - remove old patches |
---|
95 | - add Patch0,1,2 from fedora |
---|
96 | |
---|
97 | * Mon Jan 12 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.0-2 |
---|
98 | - rebuild with python-3.4.2 |
---|
99 | - add Patch0 (pycairo-1.10.0-waf_unpack-1.patch) |
---|
100 | - add Patch1 (pycairo-1.10.0-waf_python_3_4-1.patch) |
---|
101 | |
---|
102 | * Sat Oct 26 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.10.0-1 |
---|
103 | - initial build |
---|
104 | |
---|