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