]> git.pld-linux.org Git - packages/sip.git/blob - sip.spec
- up to 4.19
[packages/sip.git] / sip.spec
1 # TODO: __pycache__ for python3-sip-devel
2 #
3 # Conditional build:
4 %bcond_without  python2 # CPython 2.x modules
5 %bcond_without  python3 # CPython 3.x modules
6
7 Summary:        Python bindings generator for C++ class libraries
8 Summary(pl.UTF-8):      Generator powiązań Pythona z bibliotekami klas C++
9 Name:           sip
10 Version:        4.19
11 Release:        1
12 Epoch:          2
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)
25
26 %define         _sipfilesdir    %{_datadir}/sip
27
28 %description
29 SIP generates Python bindings for C++ class libraries from a set of
30 class specification files. It supports Python v2 and v3.
31
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.
35
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
40 Requires:       python-libs
41
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.
46
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ń.
51
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
59
60 %description -n python-sip-devel
61 Python 2 development files needed to build bindings for C++ classes
62 using SIP.
63
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.
67
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
73
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.
78
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ń.
83
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
91
92 %description -n python3-sip-devel
93 Python 3 development files needed to build bindings for C++ classes
94 using SIP.
95
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.
99
100 %prep
101 %setup -q
102 %patch0 -p1
103
104 %build
105 # configure.py notes:
106 # - macros overrides must be last
107 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
108
109 %if %{with python2}
110 install -d build-py2
111 cd build-py2
112 %{__python} ../configure.py \
113         -b %{_bindir} \
114         -e %{py_incdir} \
115         -v %{_sipfilesdir} \
116         -d %{py_sitedir} \
117         CC="%{__cc}" \
118         CXX="%{__cxx}" \
119         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
120         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
121         LINK="%{__cxx}" \
122         LINK_SHLIB="%{__cxx}"
123
124 %{__make}
125 cd ..
126 %endif
127
128 %if %{with python3}
129 install -d build-py3
130 cd build-py3
131 %{__python3} ../configure.py \
132         -b %{_bindir} \
133         -e %{py3_incdir} \
134         -v %{_sipfilesdir} \
135         -d %{py3_sitedir} \
136         CC="%{__cc}" \
137         CXX="%{__cxx}" \
138         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
139         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
140         LINK="%{__cxx}" \
141         LINK_SHLIB="%{__cxx}"
142
143 %{__make}
144 cd ..
145 %endif
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
150
151 %if %{with python2}
152 %{__make} -C build-py2 install \
153         DESTDIR=$RPM_BUILD_ROOT
154
155 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
156 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
157 %endif
158
159 %if %{with python3}
160 %{__make} -C build-py3 install \
161         DESTDIR=$RPM_BUILD_ROOT
162 %endif
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %files
168 %defattr(644,root,root,755)
169 %doc LICENSE NEWS README doc/html
170 %attr(755,root,root) %{_bindir}/sip
171 %dir %{_sipfilesdir}
172
173 %if %{with python2}
174 %files -n python-sip
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{py_sitedir}/sip.so
177
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
185 %{py_incdir}/sip.h
186 %endif
187
188 %if %{with python3}
189 %files -n python3-sip
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{py3_sitedir}/sip.so
192
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
198 %{py3_incdir}/sip.h
199 %endif
This page took 0.041399 seconds and 4 git commands to generate.