]> git.pld-linux.org Git - packages/python-PySide.git/blob - python-PySide.spec
- unified python2/python3 suffixes and default chosing with shiboken
[packages/python-PySide.git] / python-PySide.spec
1 %define         qt_ver          4.8
2 %define         pyside_ver      1.2.4
3 #
4 # Conditional build:
5 %bcond_with     apidocs         # build API documentation (needs Qt sources)
6 %bcond_without  python2         # CPython 2.x module
7 %bcond_without  python3         # CPython 3.x module
8 %bcond_with     python3_default # default to python3
9 #
10 Summary:        PySide - Python bindings for the Qt 4 toolkit
11 Summary(pl.UTF-8):      PySide - wiązania Pythona do toolkitu Qt 4
12 Name:           python-PySide
13 Version:        %{qt_ver}_%{pyside_ver}
14 Release:        1
15 License:        LGPL v2.1+
16 Group:          Libraries/Python
17 #Source0Download: https://github.com/pyside/PySide/releases
18 Source0:        https://github.com/pyside/PySide/archive/%{pyside_ver}/PySide-%{pyside_ver}.tar.gz
19 # Source0-md5:  c28563e1f3c3ce269a7cc634f97d271c
20 URL:            https://github.com/pyside/PySide/
21 BuildRequires:  OpenGL-devel
22 BuildRequires:  QtCore-devel >= %{qt_ver}
23 BuildRequires:  QtDeclarative-devel >= %{qt_ver}
24 BuildRequires:  QtGui-devel >= %{qt_ver}
25 BuildRequires:  QtHelp-devel >= %{qt_ver}
26 BuildRequires:  QtMultimedia-devel >= %{qt_ver}
27 BuildRequires:  QtNetwork-devel >= %{qt_ver}
28 BuildRequires:  QtOpenGL-devel >= %{qt_ver}
29 BuildRequires:  QtScript-devel >= %{qt_ver}
30 BuildRequires:  QtScriptTools-devel >= %{qt_ver}
31 BuildRequires:  QtSql-devel >= %{qt_ver}
32 BuildRequires:  QtSvg-devel >= %{qt_ver}
33 BuildRequires:  QtTest-devel >= %{qt_ver}
34 BuildRequires:  QtUiTools-devel >= %{qt_ver}
35 BuildRequires:  QtWebKit-devel >= %{qt_ver}
36 BuildRequires:  QtXml-devel >= %{qt_ver}
37 BuildRequires:  QtXmlPatterns-devel >= %{qt_ver}
38 BuildRequires:  cmake >= 2.6
39 BuildRequires:  phonon-devel
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  rpmbuild(macros) >= 1.605
42 %{?with_python2:BuildRequires:  shiboken-python2 >= %{pyside_ver}}
43 %{?with_python3:BuildRequires:  shiboken-python3 >= %{pyside_ver}}
44 %if %{with apidocs}
45 BuildRequires:  graphviz
46 BuildRequires:  qt4-build
47 BuildRequires:  qt4-source
48 BuildRequires:  sphinx-pdg
49 %endif
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
52 %define         py3_soabi       %(%{__python3} -c 'import sysconfig; print(sysconfig.get_config_var("SOABI"));')
53
54 %description
55 PySide project provides LGPL-licensed Python bindings for the Qt. It
56 also includes complete toolchain for rapidly generating bindings for
57 any Qt-based C++ class hierarchies. PySide Qt bindings allow both free
58 open source and proprietary software development and ultimately aim to
59 support Qt platforms.
60
61 This package contains Python 2 bindings.
62
63 %description -l pl.UTF-8
64 Projekt PySide udostępnia na licencji LGPL wiązania Pythona dla
65 tookitu Qt. Zawiera także pełny zestaw narzędzi do szybkiego
66 generowania wiązań dla dowolnej hierarchii klas C++ opartych na Qt.
67 Wiązania Qt PySide pozwalają na tworzenie zarówno wolnodostępnego, jak
68 i własnościowego oprogramowania i mają na celu wsparcie platform Qt.
69
70 Ten pakiet zawiera wiązania Pythona 2.
71
72 %package devel
73 Summary:        Development files for PySide bindings
74 Summary(pl.UTF-8):      Pliki programistyczne dla wiązań PySide
75 Group:          Development/Libraries
76 Requires:       %{name} = %{version}-%{release}
77 Requires:       %{name}-common-devel = %{version}-%{release}
78 Requires:       shiboken-python2 >= %{pyside_ver}
79
80 %description devel
81 Development files for PySide bindings for Python 2.
82
83 %description devel -l pl.UTF-8
84 Pliki programistyczne dla wiązań PySide dla Pythona 2.
85
86 %package common-devel
87 Summary:        Common development files for PySide bindings
88 Summary(pl.UTF-8):      Wspólne pliki programistyczne dla wiązań PySide
89 Group:          Development/Libraries
90 Conflicts:      python-PySide-devel < 4.8_1.2.4-1
91
92 %description common-devel
93 Development files for PySide bindings, common for Python 2 and 3.
94
95 %description common-devel -l pl.UTF-8
96 Pliki programistyczne dla wiązań PySide, wspólne dla Pythona 2 i 3.
97
98 %package -n python3-PySide
99 Summary:        PySide - Python bindings for the Qt 4 toolkit
100 Summary(pl.UTF-8):      PySide - wiązania Pythona do toolkitu Qt 4
101 Group:          Libraries/Python
102
103 %description -n python3-PySide
104 PySide project provides LGPL-licensed Python bindings for the Qt. It
105 also includes complete toolchain for rapidly generating bindings for
106 any Qt-based C++ class hierarchies. PySide Qt bindings allow both free
107 open source and proprietary software development and ultimately aim to
108 support Qt platforms.
109
110 This package contains Python 3 bindings.
111
112 %description -n python3-PySide -l pl.UTF-8
113 Projekt PySide udostępnia na licencji LGPL wiązania Pythona dla
114 tookitu Qt. Zawiera także pełny zestaw narzędzi do szybkiego
115 generowania wiązań dla dowolnej hierarchii klas C++ opartych na Qt.
116 Wiązania Qt PySide pozwalają na tworzenie zarówno wolnodostępnego, jak
117 i własnościowego oprogramowania i mają na celu wsparcie platform Qt.
118
119 Ten pakiet zawiera wiązania Pythona 3.
120
121 %package -n python3-PySide-devel
122 Summary:        Development files for PySide bindings
123 Summary(pl.UTF-8):      Pliki programistyczne dla wiązań PySide
124 Group:          Development/Libraries
125 Requires:       %{name}-common-devel = %{version}-%{release}
126 Requires:       python3-PySide = %{version}-%{release}
127 Requires:       shiboken-python3 >= %{pyside_ver}
128
129 %description -n python3-PySide-devel
130 Development files for PySide bindings for Python 3.
131
132 %description -n python3-PySide-devel -l pl.UTF-8
133 Pliki programistyczne dla wiązań PySide dla Pythona 3.
134
135 %prep
136 %setup -q -n PySide-%{pyside_ver}
137
138 %build
139 %if %{with python2}
140 install -d build-py2
141 cd build-py2
142 %cmake .. \
143         -DPYTHON_SUFFIX=-python%{py_ver}
144
145 %{__make}
146 cd ..
147 %endif
148
149 %if %{with python3}
150 install -d build-py3
151 cd build-py3
152 %cmake .. \
153         -DPYTHON_SUFFIX=.%{py3_soabi}
154 %endif
155
156 %install
157 rm -rf $RPM_BUILD_ROOT
158
159 # version installed as last will be default (it covers default PYTHON_SUFFIX in cmake files and .pc symlink)
160 for pyver in %{?with_python3_default:%{?with_python2:py2}} %{?with_python3:py3} %{!?with_python3_default:%{?with_python2:py2}} ; do
161
162 %{__make} -C build-${pyver} install \
163         DESTDIR=$RPM_BUILD_ROOT
164
165 %{__mv} $RPM_BUILD_ROOT%{_pkgconfigdir}/pyside.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/pyside-${pyver}.pc
166 ln -sf pyside-${pyver}.pc $RPM_BUILD_ROOT%{_pkgconfigdir}/pyside.pc
167
168 done
169
170 %if %{with python2}
171 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/PySide
172 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/PySide
173 %py_postclean
174 %endif
175
176 %if %{with python3}
177 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/PySide
178 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/PySide
179 %endif
180
181 %clean
182 rm -rf $RPM_BUILD_ROOT
183
184 %post   -p /sbin/ldconfig
185 %postun -p /sbin/ldconfig
186
187 %if %{with python2}
188 %files
189 %defattr(644,root,root,755)
190 %attr(755,root,root) %{_libdir}/libpyside-python%{py_ver}.so.*.*.*
191 %attr(755,root,root) %ghost %{_libdir}/libpyside-python%{py_ver}.so.1.2
192 %dir %{py_sitedir}/PySide
193 %attr(755,root,root) %{py_sitedir}/PySide/QtCore.so
194 %attr(755,root,root) %{py_sitedir}/PySide/QtDeclarative.so
195 %attr(755,root,root) %{py_sitedir}/PySide/QtGui.so
196 %attr(755,root,root) %{py_sitedir}/PySide/QtHelp.so
197 %attr(755,root,root) %{py_sitedir}/PySide/QtMultimedia.so
198 %attr(755,root,root) %{py_sitedir}/PySide/QtNetwork.so
199 %attr(755,root,root) %{py_sitedir}/PySide/QtOpenGL.so
200 %attr(755,root,root) %{py_sitedir}/PySide/QtScript.so
201 %attr(755,root,root) %{py_sitedir}/PySide/QtScriptTools.so
202 %attr(755,root,root) %{py_sitedir}/PySide/QtSql.so
203 %attr(755,root,root) %{py_sitedir}/PySide/QtSvg.so
204 %attr(755,root,root) %{py_sitedir}/PySide/QtTest.so
205 %attr(755,root,root) %{py_sitedir}/PySide/QtUiTools.so
206 %attr(755,root,root) %{py_sitedir}/PySide/QtWebKit.so
207 %attr(755,root,root) %{py_sitedir}/PySide/QtXml.so
208 %attr(755,root,root) %{py_sitedir}/PySide/QtXmlPatterns.so
209 %attr(755,root,root) %{py_sitedir}/PySide/phonon.so
210 %{py_sitedir}/PySide/__init__.py[co]
211 %{py_sitedir}/PySide/_utils.py[co]
212
213 %files devel
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_libdir}/libpyside-python%{py_ver}.so
216 %{_pkgconfigdir}/pyside-py2.pc
217 %{!?with_python3_default:%{_pkgconfigdir}/pyside.pc}
218 %{_libdir}/cmake/PySide-%{pyside_ver}/PySideConfig-python%{py_ver}.cmake
219 %endif
220
221 %files common-devel
222 %defattr(644,root,root,755)
223 %{_includedir}/PySide
224 %dir %{_datadir}/PySide
225 %{_datadir}/PySide/typesystems
226 %dir %{_libdir}/cmake/PySide-%{pyside_ver}
227 %{_libdir}/cmake/PySide-%{pyside_ver}/PySideConfig.cmake
228 %{_libdir}/cmake/PySide-%{pyside_ver}/PySideConfigVersion.cmake
229
230 %if %{with python3}
231 %files -n python3-PySide
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{_libdir}/libpyside.%{py3_soabi}.so.*.*.*
234 %attr(755,root,root) %ghost %{_libdir}/libpyside.%{py3_soabi}.so.1.2
235 %dir %{py3_sitedir}/PySide
236 %attr(755,root,root) %{py3_sitedir}/PySide/QtCore.so
237 %attr(755,root,root) %{py3_sitedir}/PySide/QtDeclarative.so
238 %attr(755,root,root) %{py3_sitedir}/PySide/QtGui.so
239 %attr(755,root,root) %{py3_sitedir}/PySide/QtHelp.so
240 %attr(755,root,root) %{py3_sitedir}/PySide/QtMultimedia.so
241 %attr(755,root,root) %{py3_sitedir}/PySide/QtNetwork.so
242 %attr(755,root,root) %{py3_sitedir}/PySide/QtOpenGL.so
243 %attr(755,root,root) %{py3_sitedir}/PySide/QtScript.so
244 %attr(755,root,root) %{py3_sitedir}/PySide/QtScriptTools.so
245 %attr(755,root,root) %{py3_sitedir}/PySide/QtSql.so
246 %attr(755,root,root) %{py3_sitedir}/PySide/QtSvg.so
247 %attr(755,root,root) %{py3_sitedir}/PySide/QtTest.so
248 %attr(755,root,root) %{py3_sitedir}/PySide/QtUiTools.so
249 %attr(755,root,root) %{py3_sitedir}/PySide/QtWebKit.so
250 %attr(755,root,root) %{py3_sitedir}/PySide/QtXml.so
251 %attr(755,root,root) %{py3_sitedir}/PySide/QtXmlPatterns.so
252 %attr(755,root,root) %{py3_sitedir}/PySide/phonon.so
253 %{py3_sitedir}/PySide/__init__.py
254 %{py3_sitedir}/PySide/_utils.py
255 %{py3_sitedir}/PySide/__pycache__
256
257 %files -n python3-PySide-devel
258 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_libdir}/libpyside.%{py3_soabi}.so
260 %{_pkgconfigdir}/pyside-py3.pc
261 %{?with_python3_default:%{_pkgconfigdir}/pyside.pc}
262 %{_libdir}/cmake/PySide-%{pyside_ver}/PySideConfig.%{py3_soabi}.cmake
263 %endif
This page took 0.071751 seconds and 3 git commands to generate.