]>
Commit | Line | Data |
---|---|---|
861c1e6e JB |
1 | # |
2 | # Conditional build: | |
6b7eb3bb JB |
3 | %bcond_without python2 # CPython 2.x support |
4 | %bcond_without python3 # CPython 3.x support | |
5 | %bcond_with python3_default # default to python3 | |
861c1e6e | 6 | # |
1e5508db JB |
7 | Summary: CPython bindings generator for C++ libraries |
8 | Summary(pl.UTF-8): Generator wiązań CPythona dla bibliotek C++ | |
9 | Name: shiboken | |
ab841884 | 10 | Version: 1.2.4 |
6b7eb3bb | 11 | Release: 3 |
1e5508db JB |
12 | License: LGPL v2.1+ (libraries), GPL v2 (tools) |
13 | Group: Development/Tools | |
3c92e18f | 14 | #Source0Download: https://github.com/pyside/Shiboken/releases |
ab841884 JR |
15 | Source0: https://github.com/pyside/Shiboken/archive/%{version}/%{name}-%{version}.tar.gz |
16 | # Source0-md5: c284197d06ad25d78009ff55f18dd512 | |
e19fa77b | 17 | Patch0: %{name}-python.patch |
47127cd5 | 18 | Patch1: build.patch |
ab841884 | 19 | Patch2: python3.patch |
3c92e18f | 20 | URL: https://github.com/pyside/Shiboken |
1e5508db JB |
21 | BuildRequires: QtCore-devel >= 4.5.0 |
22 | BuildRequires: QtXml-devel >= 4.5.0 | |
23 | BuildRequires: QtXmlPatterns-devel >= 4.5.0 | |
24 | BuildRequires: cmake >= 2.6 | |
25 | BuildRequires: libstdc++-devel | |
26 | BuildRequires: libxml2-devel >= 1:2.6.32 | |
27 | BuildRequires: libxslt-devel >= 1.1.19 | |
427e0d81 JB |
28 | %{?with_python2:BuildRequires: python-devel >= 1:2.6} |
29 | %{?with_python3:BuildRequires: python3-devel >= 1:3.2} | |
1e5508db JB |
30 | BuildRequires: sphinx-pdg |
31 | Requires: QtCore >= 4.5.0 | |
32 | Requires: QtXml >= 4.5.0 | |
33 | Requires: QtXmlPatterns >= 4.5.0 | |
34 | Requires: libxml2 >= 1:2.6.32 | |
35 | Requires: libxslt >= 1.1.19 | |
427e0d81 | 36 | Requires: python >= 1:2.6 |
1e5508db JB |
37 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
38 | ||
6b7eb3bb JB |
39 | %define py3_soabi %(%{__python3} -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"));') |
40 | ||
1e5508db JB |
41 | %description |
42 | shiboken is a CPython bindings generator for C++ libraries. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | shiboken to generator wiązań CPythona dla bibliotek C++. | |
46 | ||
861c1e6e JB |
47 | %package python2 |
48 | Summary: Shiboken Python 2.x support files | |
49 | Summary(pl.UTF-8): Shiboken - pliki do obsługi Pythona 2.x | |
50 | Group: Development/Libraries | |
51 | Requires: %{name} = %{version}-%{release} | |
52 | Requires: python-devel >= 1:%{py_ver} | |
53 | Requires: python-shiboken = %{version}-%{release} | |
54 | ||
55 | %description python2 | |
56 | Shiboken Python 2.x support files. | |
57 | ||
58 | %description python2 -l pl.UTF-8 | |
59 | Shiboken - pliki do obsługi Pythona 2.x. | |
60 | ||
61 | %package -n python-shiboken | |
62 | Summary: Shiboken runtime library for Python 2.x | |
63 | Summary(pl.UTF-8): Biblioteka uruchomieniowa shiboken dla Pythona 2.x | |
64 | Group: Libraries/Python | |
427e0d81 JB |
65 | Requires: python-libs >= 1:2.6 |
66 | Obsoletes: shiboken-libs < 1.2.2 | |
861c1e6e JB |
67 | |
68 | %description -n python-shiboken | |
69 | Shiboken runtime library for Python 2.x. | |
70 | ||
71 | %description -n python-shiboken -l pl.UTF-8 | |
72 | Biblioteka uruchomieniowa shiboken dla Pythona 2.x. | |
73 | ||
74 | %package python3 | |
75 | Summary: Shiboken Python 3.x support files | |
76 | Summary(pl.UTF-8): Shiboken - pliki do obsługi Pythona 3.x | |
77 | Group: Development/Libraries | |
78 | Requires: %{name} = %{version}-%{release} | |
79 | Requires: python3-devel >= 1:%{py_ver} | |
80 | Requires: python3-shiboken = %{version}-%{release} | |
1e5508db | 81 | |
861c1e6e JB |
82 | %description python3 |
83 | Shiboken Python 3.x support files. | |
1e5508db | 84 | |
861c1e6e JB |
85 | %description python3 -l pl.UTF-8 |
86 | Shiboken - pliki do obsługi Pythona 3.x. | |
87 | ||
88 | %package -n python3-shiboken | |
89 | Summary: Shiboken runtime library for Python 3.x | |
90 | Summary(pl.UTF-8): Biblioteka uruchomieniowa shiboken dla Pythona 3.x | |
91 | Group: Libraries/Python | |
427e0d81 JB |
92 | Requires: python3-libs >= 1:3.2 |
93 | Obsoletes: shiboken-libs < 1.2.2 | |
861c1e6e JB |
94 | |
95 | %description -n python3-shiboken | |
96 | Shiboken runtime library for Python 3.x. | |
97 | ||
98 | %description -n python3-shiboken -l pl.UTF-8 | |
99 | Biblioteka uruchomieniowa shiboken dla Pythona 3.x. | |
1e5508db JB |
100 | |
101 | %prep | |
ab841884 | 102 | %setup -q -n Shiboken-%{version} |
e19fa77b | 103 | %patch0 -p1 |
47127cd5 | 104 | %patch1 -p1 |
ab841884 | 105 | %patch2 -p1 |
1e5508db JB |
106 | |
107 | %build | |
861c1e6e JB |
108 | %if %{with python2} |
109 | install -d build-py2 | |
110 | cd build-py2 | |
1e5508db | 111 | %cmake .. |
861c1e6e JB |
112 | %{__make} |
113 | cd .. | |
114 | %endif | |
1e5508db | 115 | |
861c1e6e JB |
116 | %if %{with python3} |
117 | install -d build-py3 | |
118 | cd build-py3 | |
119 | %cmake .. \ | |
120 | -DUSE_PYTHON3=TRUE | |
1e5508db | 121 | %{__make} |
861c1e6e JB |
122 | cd .. |
123 | %endif | |
1e5508db JB |
124 | |
125 | %install | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
708d81c9 | 128 | # version installed as last will be default (it covers default PYTHON_SUFFIX in cmake files and .pc symlink) |
6b7eb3bb | 129 | for pyver in %{?with_python3_default:%{?with_python2:py2}} %{?with_python3:py3} %{!?with_python3_default:%{?with_python2:py2}} ; do |
861c1e6e | 130 | |
6b7eb3bb | 131 | %{__make} -C build-${pyver} install \ |
1e5508db | 132 | DESTDIR=$RPM_BUILD_ROOT |
708d81c9 | 133 | |
6b7eb3bb JB |
134 | %{__mv} $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken-${pyver}.pc |
135 | ln -sf shiboken-${pyver}.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/shiboken.pc | |
136 | ||
137 | done | |
1e5508db JB |
138 | |
139 | %clean | |
140 | rm -rf $RPM_BUILD_ROOT | |
141 | ||
861c1e6e JB |
142 | %post -n python-shiboken -p /sbin/ldconfig |
143 | %postun -n python-shiboken -p /sbin/ldconfig | |
144 | ||
145 | %post -n python3-shiboken -p /sbin/ldconfig | |
146 | %postun -n python3-shiboken -p /sbin/ldconfig | |
377f5ae4 | 147 | |
1e5508db JB |
148 | %files |
149 | %defattr(644,root,root,755) | |
d2a26624 | 150 | %doc AUTHORS |
1e5508db | 151 | %attr(755,root,root) %{_bindir}/shiboken |
1e5508db | 152 | %{_includedir}/shiboken |
861c1e6e JB |
153 | %dir %{_libdir}/cmake/Shiboken-%{version} |
154 | %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig.cmake | |
155 | %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfigVersion.cmake | |
1e5508db JB |
156 | %{_mandir}/man1/shiboken.1* |
157 | ||
861c1e6e JB |
158 | %if %{with python2} |
159 | %files python2 | |
160 | %defattr(644,root,root,755) | |
161 | %attr(755,root,root) %{_libdir}/libshiboken-python%{py_ver}.so | |
6b7eb3bb JB |
162 | %{_pkgconfigdir}/shiboken-py2.pc |
163 | %{!?with_python3_default:%{_pkgconfigdir}/shiboken.pc} | |
861c1e6e JB |
164 | %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig-python%{py_ver}.cmake |
165 | ||
166 | %files -n python-shiboken | |
1e5508db JB |
167 | %defattr(644,root,root,755) |
168 | %attr(755,root,root) %{_libdir}/libshiboken-python%{py_ver}.so.*.*.* | |
861c1e6e | 169 | %attr(755,root,root) %ghost %{_libdir}/libshiboken-python%{py_ver}.so.1.2 |
1e5508db | 170 | %attr(755,root,root) %{py_sitedir}/shiboken.so |
861c1e6e JB |
171 | %endif |
172 | ||
173 | %if %{with python3} | |
174 | %files python3 | |
175 | %defattr(644,root,root,755) | |
6b7eb3bb JB |
176 | %attr(755,root,root) %{_libdir}/libshiboken.%{py3_soabi}.so |
177 | %{_pkgconfigdir}/shiboken-py3.pc | |
178 | %{?with_python3_default:%{_pkgconfigdir}/shiboken.pc} | |
179 | %{_libdir}/cmake/Shiboken-%{version}/ShibokenConfig.%{py3_soabi}.cmake | |
861c1e6e JB |
180 | |
181 | %files -n python3-shiboken | |
182 | %defattr(644,root,root,755) | |
6b7eb3bb JB |
183 | %attr(755,root,root) %{_libdir}/libshiboken.%{py3_soabi}.so.*.*.* |
184 | %attr(755,root,root) %ghost %{_libdir}/libshiboken.%{py3_soabi}.so.1.2 | |
861c1e6e JB |
185 | %attr(755,root,root) %{py3_sitedir}/shiboken.so |
186 | %endif |