1 # TODO: __pycache__ for python3-sip-devel
4 %bcond_without python2 # CPython 2.x modules
5 %bcond_without python3 # CPython 3.x modules
7 Summary: Python bindings generator for C++ class libraries
8 Summary(pl.UTF-8): Generator powiązań Pythona z bibliotekami klas C++
13 License: SIP (redistributable, see LICENSE) or GPL v2 or GPL v3
14 Group: Development/Languages/Python
15 Source0: http://downloads.sourceforge.net/pyqt/sip-%{version}.tar.gz
16 # Source0-md5: be51a05065c9323b98a2ec2966c64e6a
17 Patch0: %{name}-outoftree.patch
18 URL: http://www.riverbankcomputing.com/software/sip/
19 BuildRequires: libstdc++-devel
20 BuildRequires: python-devel >= 1:2.3
21 BuildRequires: python3-devel >= 1:3.2
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.167
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define _sipfilesdir %{_datadir}/sip
29 SIP generates Python bindings for C++ class libraries from a set of
30 class specification files. It supports Python v2 and v3.
32 %description -l pl.UTF-8
33 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
34 plików ze specyfikacjami klas. Obsługiwany jest Python 2 i 3.
36 %package -n python-sip
37 Summary: Python 2 module needed by SIP generated bindings
38 Summary(pl.UTF-8): Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP
39 Group: Libraries/Python
42 %description -n python-sip
43 SIP generates Python bindings for C++ class libraries from a set of
44 class specification files. This package includes Python 2 runtime
45 library needed by all generated bindings.
47 %description -n python-sip -l pl.UTF-8
48 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
49 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
50 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
52 %package -n python-sip-devel
53 Summary: Python 2 development files needed to build bindings using SIP
54 Summary(pl.UTF-8): Pliki programistyczne Pythona 2 potrzebne do budowania wiązań przy użyciu SIP-a
55 Group: Development/Libraries
56 Requires: %{name} = %{epoch}:%{version}-%{release}
57 Requires: python-sip = %{epoch}:%{version}-%{release}
58 Requires: python-devel >= 1:2.3
60 %description -n python-sip-devel
61 Python 2 development files needed to build bindings for C++ classes
64 %description -n python-sip-devel -l pl.UTF-8
65 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
66 C++ przy użyciu SIP-a.
68 %package -n python3-sip
69 Summary: Python 3 module needed by SIP generated bindings
70 Summary(pl.UTF-8): Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
71 Group: Libraries/Python
72 Requires: python3-libs
74 %description -n python3-sip
75 SIP generates Python bindings for C++ class libraries from a set of
76 class specification files. This package includes Python 3 runtime
77 library needed by all generated bindings.
79 %description -n python3-sip -l pl.UTF-8
80 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
81 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
82 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
84 %package -n python3-sip-devel
85 Summary: Python 3 development files needed to build bindings using SIP
86 Summary(pl.UTF-8): Pliki programistyczne Pythona 3 potrzebne do budowania wiązań przy użyciu SIP-a
87 Group: Development/Libraries
88 Requires: %{name} = %{epoch}:%{version}-%{release}
89 Requires: python3-sip = %{epoch}:%{version}-%{release}
90 Requires: python3-devel >= 1:3.2
92 %description -n python3-sip-devel
93 Python 3 development files needed to build bindings for C++ classes
96 %description -n python3-sip-devel -l pl.UTF-8
97 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
98 C++ przy użyciu SIP-a.
105 # configure.py notes:
106 # - macros overrides must be last
107 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
112 %{__python} ../configure.py \
119 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
120 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
122 LINK_SHLIB="%{__cxx}"
131 %{__python3} ../configure.py \
138 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
139 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
141 LINK_SHLIB="%{__cxx}"
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
152 %{__make} -C build-py2 install \
153 DESTDIR=$RPM_BUILD_ROOT
155 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
156 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
160 %{__make} -C build-py3 install \
161 DESTDIR=$RPM_BUILD_ROOT
165 rm -rf $RPM_BUILD_ROOT
168 %defattr(644,root,root,755)
169 %doc LICENSE NEWS README doc/html
170 %attr(755,root,root) %{_bindir}/sip
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{py_sitedir}/sip.so
178 %files -n python-sip-devel
179 %defattr(644,root,root,755)
180 %{py_sitedir}/sipconfig.py
181 %{py_sitedir}/sipconfig.py[co]
182 %{py_sitedir}/sipdistutils.py
183 %{py_sitedir}/sipdistutils.py[co]
184 %{py_sitedir}/sip.pyi
189 %files -n python3-sip
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{py3_sitedir}/sip.so
193 %files -n python3-sip-devel
194 %defattr(644,root,root,755)
195 %{py3_sitedir}/sipconfig.py
196 %{py3_sitedir}/sipdistutils.py
197 %{py3_sitedir}/sip.pyi