]> git.pld-linux.org Git - packages/sip.git/blob - sip.spec
- rel 3; allow on python2: from PyQt5 import sip
[packages/sip.git] / sip.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x modules
4 %bcond_without  python3 # CPython 3.x modules
5
6 Summary:        Python bindings generator for C++ class libraries
7 Summary(pl.UTF-8):      Generator powiązań Pythona z bibliotekami klas C++
8 Name:           sip
9 Version:        4.19.12
10 Release:        3
11 Epoch:          2
12 License:        SIP (redistributable, see LICENSE) or GPL v2 or GPL v3
13 Group:          Development/Languages/Python
14 Source0:        http://downloads.sourceforge.net/pyqt/sip-%{version}.tar.gz
15 # Source0-md5:  e28b0790dfe4962ce6bbd7c4772f40c9
16 URL:            http://www.riverbankcomputing.com/software/sip/
17 BuildRequires:  libstdc++-devel
18 BuildRequires:  python-devel >= 1:2.3
19 BuildRequires:  python3-devel >= 1:3.2
20 BuildRequires:  rpm-pythonprov
21 BuildRequires:  rpmbuild(macros) >= 1.167
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         _sipfilesdir    %{_datadir}/sip
25
26 %description
27 SIP generates Python bindings for C++ class libraries from a set of
28 class specification files. It supports Python v2 and v3.
29
30 %description -l pl.UTF-8
31 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
32 plików ze specyfikacjami klas. Obsługiwany jest Python 2 i 3.
33
34 %package -n python-sip
35 Summary:        Python 2 module needed by SIP generated bindings
36 Summary(pl.UTF-8):      Moduł Pythona 2 wymagany przez wiązania wygenerowane przez SIP
37 Group:          Libraries/Python
38 Requires:       python-libs
39
40 %description -n python-sip
41 SIP generates Python bindings for C++ class libraries from a set of
42 class specification files. This package includes Python 2 runtime
43 library needed by all generated bindings.
44
45 %description -n python-sip -l pl.UTF-8
46 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
47 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 2
48 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
49
50 %package -n python-sip-devel
51 Summary:        Python 2 development files needed to build bindings using SIP
52 Summary(pl.UTF-8):      Pliki programistyczne Pythona 2 potrzebne do budowania wiązań przy użyciu SIP-a
53 Group:          Development/Libraries
54 Requires:       %{name} = %{epoch}:%{version}-%{release}
55 Requires:       python-sip = %{epoch}:%{version}-%{release}
56 Requires:       python-devel >= 1:2.3
57
58 %description -n python-sip-devel
59 Python 2 development files needed to build bindings for C++ classes
60 using SIP.
61
62 %description -n python-sip-devel -l pl.UTF-8
63 Pliki programistyczne Pythona 2 potrzebne do budowania wiązań dla klas
64 C++ przy użyciu SIP-a.
65
66 %package -n python3-sip
67 Summary:        Python 3 module needed by SIP generated bindings
68 Summary(pl.UTF-8):      Moduł Pythona 3 wymagany przez wiązania wygenerowane przez SIP
69 Group:          Libraries/Python
70 Requires:       python3-libs
71
72 %description -n python3-sip
73 SIP generates Python bindings for C++ class libraries from a set of
74 class specification files. This package includes Python 3 runtime
75 library needed by all generated bindings.
76
77 %description -n python3-sip -l pl.UTF-8
78 SIP generuje powiązania Pythona z bibliotekami klas C++ ze zbioru
79 plików ze specyfikacjami klas. Ten pakiet zawiera bibliotekę Pythona 3
80 potrzebną do uruchomienia wszystkich wygenerowanych powiązań.
81
82 %package -n python3-sip-devel
83 Summary:        Python 3 development files needed to build bindings using SIP
84 Summary(pl.UTF-8):      Pliki programistyczne Pythona 3 potrzebne do budowania wiązań przy użyciu SIP-a
85 Group:          Development/Libraries
86 Requires:       %{name} = %{epoch}:%{version}-%{release}
87 Requires:       python3-sip = %{epoch}:%{version}-%{release}
88 Requires:       python3-devel >= 1:3.2
89
90 %description -n python3-sip-devel
91 Python 3 development files needed to build bindings for C++ classes
92 using SIP.
93
94 %description -n python3-sip-devel -l pl.UTF-8
95 Pliki programistyczne Pythona 3 potrzebne do budowania wiązań dla klas
96 C++ przy użyciu SIP-a.
97
98 %prep
99 %setup -q
100
101 %build
102 # configure.py notes:
103 # - macros overrides must be last
104 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
105
106 %if %{with python2}
107 install -d build-py2
108 cd build-py2
109 %{__python} ../configure.py \
110         --sip-module=PyQt5.sip \
111         -b %{_bindir} \
112         -e %{py_incdir} \
113         -v %{_sipfilesdir} \
114         -d %{py_sitedir} \
115         CC="%{__cc}" \
116         CXX="%{__cxx}" \
117         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
118         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
119         LINK="%{__cxx}" \
120         LINK_SHLIB="%{__cxx}"
121
122 %{__make}
123 cd ..
124 %endif
125
126 %if %{with python3}
127 install -d build-py3
128 cd build-py3
129 %{__python3} ../configure.py \
130         --sip-module=PyQt5.sip \
131         -b %{_bindir} \
132         -e %{py3_incdir} \
133         -v %{_sipfilesdir} \
134         -d %{py3_sitedir} \
135         CC="%{__cc}" \
136         CXX="%{__cxx}" \
137         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
138         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
139         LINK="%{__cxx}" \
140         LINK_SHLIB="%{__cxx}"
141
142 %{__make}
143 cd ..
144 %endif
145
146 %install
147 rm -rf $RPM_BUILD_ROOT
148 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
149
150 %if %{with python2}
151 %{__make} -C build-py2 install \
152         DESTDIR=$RPM_BUILD_ROOT
153
154 echo -n >> $RPM_BUILD_ROOT%{py_sitedir}/PyQt5/__init__.py
155
156 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
157 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
158 %endif
159
160 %if %{with python3}
161 %{__make} -C build-py3 install \
162         DESTDIR=$RPM_BUILD_ROOT
163
164 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
165 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
166 %endif
167
168 %clean
169 rm -rf $RPM_BUILD_ROOT
170
171 %files
172 %defattr(644,root,root,755)
173 %doc LICENSE NEWS README doc/html
174 %attr(755,root,root) %{_bindir}/sip
175 %dir %{_sipfilesdir}
176
177 %if %{with python2}
178 %files -n python-sip
179 %defattr(644,root,root,755)
180 %dir %{py_sitedir}/PyQt5
181 %{py_sitedir}/PyQt5/__init__.py
182 %{py_sitedir}/PyQt5/__init__.py[co]
183 %attr(755,root,root) %{py_sitedir}/PyQt5/sip.so
184
185 %files -n python-sip-devel
186 %defattr(644,root,root,755)
187 %{py_sitedir}/sipconfig.py
188 %{py_sitedir}/sipconfig.py[co]
189 %{py_sitedir}/sipdistutils.py
190 %{py_sitedir}/sipdistutils.py[co]
191 %{py_sitedir}/PyQt5/sip.pyi
192 %{py_incdir}/sip.h
193 %endif
194
195 %if %{with python3}
196 %files -n python3-sip
197 %defattr(644,root,root,755)
198 %dir %{py3_sitedir}/PyQt5
199 %attr(755,root,root) %{py3_sitedir}/PyQt5/sip.so
200
201 %files -n python3-sip-devel
202 %defattr(644,root,root,755)
203 %{py3_sitedir}/sipconfig.py
204 %{py3_sitedir}/sipdistutils.py
205 %{py3_sitedir}/__pycache__/sipconfig.cpython-*.py[co]
206 %{py3_sitedir}/__pycache__/sipdistutils.cpython-*.py[co]
207 %{py3_sitedir}/PyQt5/sip.pyi
208 %{py3_incdir}/sip.h
209 %endif
This page took 0.070733 seconds and 4 git commands to generate.