]> git.pld-linux.org Git - packages/sip.git/blob - sip.spec
- release 2 (by relup.sh)
[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.17
11 Release:        2
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:  ca51677770fa62dd5087877688cf97ba
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-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-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 %patch0 -p1
101
102 %build
103 # configure.py notes:
104 # - macros overrides must be last
105 # - cannot pass CXXFLAGS+="%{rpmcflags}" or so - builtin -O2 overrides rpmcflags
106
107 %if %{with python2}
108 install -d build-py2
109 cd build-py2
110 %{__python} ../configure.py \
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         -b %{_bindir} \
131         -e %{py3_incdir} \
132         -v %{_sipfilesdir} \
133         -d %{py3_sitedir} \
134         CC="%{__cc}" \
135         CXX="%{__cxx}" \
136         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
137         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}" \
138         LINK="%{__cxx}" \
139         LINK_SHLIB="%{__cxx}"
140
141 %{__make}
142 cd ..
143 %endif
144
145 %install
146 rm -rf $RPM_BUILD_ROOT
147 install -d $RPM_BUILD_ROOT%{_sipfilesdir}
148
149 %if %{with python2}
150 %{__make} -C build-py2 install \
151         DESTDIR=$RPM_BUILD_ROOT
152
153 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
154 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
155 %endif
156
157 %if %{with python3}
158 %{__make} -C build-py3 install \
159         DESTDIR=$RPM_BUILD_ROOT
160 %endif
161
162 %clean
163 rm -rf $RPM_BUILD_ROOT
164
165 %files
166 %defattr(644,root,root,755)
167 %doc LICENSE NEWS README doc/html
168 %attr(755,root,root) %{_bindir}/sip
169 %dir %{_sipfilesdir}
170
171 %if %{with python2}
172 %files -n python-sip
173 %defattr(644,root,root,755)
174 %attr(755,root,root) %{py_sitedir}/sip.so
175
176 %files -n python-sip-devel
177 %defattr(644,root,root,755)
178 %{py_sitedir}/sipconfig.py
179 %{py_sitedir}/sipconfig.py[co]
180 %{py_sitedir}/sipdistutils.py
181 %{py_sitedir}/sipdistutils.py[co]
182 %{py_incdir}/sip.h
183 %endif
184
185 %if %{with python3}
186 %files -n python3-sip
187 %defattr(644,root,root,755)
188 %attr(755,root,root) %{py3_sitedir}/sip.so
189
190 %files -n python3-sip-devel
191 %defattr(644,root,root,755)
192 %{py3_sitedir}/sipconfig.py
193 %{py3_sitedir}/sipdistutils.py
194 %{py3_incdir}/sip.h
195 %endif
This page took 0.076829 seconds and 4 git commands to generate.