]> git.pld-linux.org Git - packages/qscintilla2.git/blob - qscintilla2.spec
- added qt5 patch to fix PyQt5 module build
[packages/qscintilla2.git] / qscintilla2.spec
1 #
2 # TODO:
3 # - fix building with qscintilla2(-devel) installed, remove BC
4 #   - how to successfully prepend -I../Qt4Qt5 before system qt include in qmake?
5 # - QScintilla2 for Qt3 (does it make any sense nowadays?)
6 #
7 # Conditonal build:
8 %bcond_without  python2 # CPython 2.x module
9 %bcond_without  python3 # CPython 3.x module
10 %bcond_without  qt4     # Qt4 library and modules
11 %bcond_without  qt5     # Qt5 library and modules
12
13 %define         scintilla_ver   3.3.6
14 %define         sip_ver         4.16
15 %define         pyqt4_ver       4.8.2
16 %define         pyqt5_ver       5.0
17 Summary:        QScintilla2 - a port to Qt of the Scintilla editing component
18 Summary(pl.UTF-8):      QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt
19 Name:           qscintilla2
20 Version:        2.8.4
21 Release:        1
22 License:        GPL v2 or GPL v3 with Riverbank GPL Exception v1.1
23 Group:          X11/Libraries
24 Source0:        http://downloads.sourceforge.net/pyqt/QScintilla-gpl-%{version}.tar.gz
25 # Source0-md5:  28aec903ff48ae541295a4fb9c96f8ea
26 Patch0:         %{name}-internal_build.patch
27 Patch1:         %{name}-multiqt.patch
28 Patch2:         %{name}-make.patch
29 Patch3:         %{name}-outoftree.patch
30 Patch4:         %{name}-qt5.patch
31 URL:            http://www.riverbankcomputing.co.uk/software/qscintilla/
32 %if %{with python2}
33 BuildRequires:  python-sip-devel >= 2:%{sip_ver}
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-sip-devel >= 2:%{sip_ver}
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.558
40 %if %{with qt4}
41 BuildRequires:  QtDesigner-devel >= 4.8
42 BuildRequires:  QtGui-devel >= 4.8
43 BuildRequires:  qt4-build >= 4.8
44 BuildRequires:  qt4-qmake >= 4.8
45 BuildRequires:  sip-PyQt4 >= %{pyqt4_ver}
46 %if %{with python2}
47 BuildRequires:  python-PyQt4 >= %{pyqt4_ver}
48 %endif
49 %if %{with python3}
50 BuildRequires:  python3-PyQt4 >= %{pyqt4_ver}
51 %endif
52 %endif
53 %if %{with qt5}
54 BuildRequires:  Qt5Designer-devel >= 5
55 BuildRequires:  Qt5Gui-devel >= 5
56 BuildRequires:  Qt5PrintSupport-devel >= 5
57 BuildRequires:  Qt5Widgets-devel >= 5
58 BuildRequires:  qt5-build >= 5
59 BuildRequires:  qt5-qmake >= 5
60 BuildRequires:  sip-PyQt5 >= %{pyqt5_ver}
61 %if %{with python2}
62 BuildRequires:  python-PyQt5 >= %{pyqt5_ver}
63 %endif
64 %if %{with python3}
65 BuildRequires:  python3-PyQt5 >= %{pyqt5_ver}
66 %endif
67 %endif
68 BuildConflicts: qscintilla2-devel
69 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
71 %define         _sipfilesdir    %{_datadir}/sip
72
73 %description
74 QScintilla2 is a port to Qt of the Scintilla editing component.
75 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
76
77 %description -l pl.UTF-8
78 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
79 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
80
81 %package apidocs
82 Summary:        QScintilla2 API documentation
83 Summary(pl.UTF-8):      Dokumentacja API biblioteki QScintilla2
84 Group:          Documentation
85
86 %description apidocs
87 QScintilla2 API documentation.
88
89 %description apidocs -l pl.UTF-8
90 Dokumentacja API biblioteki QScintilla2.
91
92 %package qt4
93 Summary:        QScintilla2 - a port to Qt 4 of the Scintilla editing component
94 Summary(pl.UTF-8):      QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4
95 Group:          X11/Libraries
96 Requires:       %{name}-common = %{version}-%{release}
97 %ifarch %{x8664} ppc64 s390x sparc64
98 Provides:       libqscintilla2.so.11()(64bit)
99 %else
100 Provides:       libqscintilla2.so.11
101 %endif
102 Obsoletes:      qscintilla2 < 2.8.4
103
104 %description qt4
105 QScintilla2 is a port to Qt of the Scintilla editing component.
106 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
107
108 This package contains the Qt 4 port.
109
110 %description qt4 -l pl.UTF-8
111 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
112 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
113
114 Ten pakiet zawiera port Qt 4.
115
116 %package qt4-devel
117 Summary:        Development files for the QScintilla2 Qt 4 library
118 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4
119 Group:          X11/Development/Libraries
120 Requires:       %{name}-qt4 = %{version}-%{release}
121 Requires:       QtGui-devel >= 4
122 Obsoletes:      qscintilla2-devel < 2.8.4
123
124 %description qt4-devel
125 This package contains the header files necessary to develop
126 applications using QScintilla2 for Qt 4.
127
128 %description qt4-devel -l pl.UTF-8
129 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
130 użyciem komponentu QScintilla2 dla Qt 4.
131
132 %package -n QtDesigner-plugin-%{name}
133 Summary:        QScintilla2 plugin for Qt Designer
134 Summary(pl.UTF-8):      Wtyczka QScintilla2 dla Qt Designera
135 Group:          X11/Development/Libraries
136 Requires:       %{name}-qt4 = %{version}-%{release}
137 Requires:       QtDesigner >= 4
138
139 %description -n QtDesigner-plugin-%{name}
140 QScintilla2 plugin for Qt Designer that allows QScintilla instances
141 to be included in GUI designs just like any other Qt widget.
142
143 This package contains the Qt 4 version.
144
145 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
146 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
147 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
148 Qt.
149
150 Ten pakiet zawiera wersję dla Qt 4.
151
152 %package -n sip-PyQt4-%{name}
153 Summary:        Python bindings for the QScintilla2 - SIP development files
154 Summary(pl.UTF-8):      Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
155 Group:          Development/Languages/Python
156 Requires:       sip-PyQt4 >= %{pyqt4_ver}
157 Obsoletes:      python-qscintilla2-devel < 2.8.4
158
159 %description -n sip-PyQt4-%{name}
160 Python bindings for the QScintilla2 - SIP development files.
161
162 %description -n sip-PyQt4-%{name} -l pl.UTF-8
163 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
164 SIP.
165
166 %package -n python-PyQt4-%{name}
167 Summary:        Python 2 bindings for the QScintilla2 (PyQt4 version)
168 Summary(pl.UTF-8):      Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4)
169 Group:          Libraries/Python
170 Requires:       %{name}-qt4 = %{version}-%{release}
171 %requires_ge    python-PyQt4
172 Obsoletes:      python-qscintilla2 < 2.8.4
173
174 %description -n python-PyQt4-%{name}
175 Python 2 bindings for the QScintilla2 (PyQt4 version).
176
177 %description -n python-PyQt4-%{name} -l pl.UTF-8
178 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
179
180 %package -n python3-PyQt4-%{name}
181 Summary:        Python 3 bindings for the QScintilla2 (PyQt4 version)
182 Summary(pl.UTF-8):      Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4)
183 Group:          Libraries/Python
184 Requires:       %{name}-qt4 = %{version}-%{release}
185 %requires_ge    python3-PyQt4
186
187 %description -n python3-PyQt4-%{name}
188 Python 3 bindings for the QScintilla2 (PyQt4 version).
189
190 %description -n python3-PyQt4-%{name} -l pl.UTF-8
191 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
192
193 %package qt5
194 Summary:        QScintilla2 - a port to Qt 5 of the Scintilla editing component
195 Summary(pl.UTF-8):      QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5
196 Group:          X11/Libraries
197 Requires:       %{name}-common = %{version}-%{release}
198
199 %description qt5
200 QScintilla2 is a port to Qt of the Scintilla editing component.
201 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
202
203 This package contains the Qt 5 port.
204
205 %description qt5 -l pl.UTF-8
206 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
207 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
208
209 Ten pakiet zawiera port Qt 5.
210
211 %package qt5-devel
212 Summary:        Development files for the QScintilla2 Qt 5 library
213 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5
214 Group:          X11/Development/Libraries
215 Requires:       %{name}-qt5 = %{version}-%{release}
216 Requires:       Qt5Gui-devel >= 5
217 Obsoletes:      qscintilla2-devel < 2.8.4
218
219 %description qt5-devel
220 This package contains the header files necessary to develop
221 applications using QScintilla2 for Qt 5.
222
223 %description qt5-devel -l pl.UTF-8
224 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
225 użyciem komponentu QScintilla2 dla Qt 5.
226
227 %package -n Qt5Designer-plugin-%{name}
228 Summary:        QScintilla2 plugin for Qt Designer
229 Summary(pl.UTF-8):      Wtyczka QScintilla2 dla Qt Designera
230 Group:          X11/Development/Libraries
231 Requires:       %{name}-qt5 = %{version}-%{release}
232 Requires:       Qt5Designer >= 5
233
234 %description -n Qt5Designer-plugin-%{name}
235 QScintilla2 plugin for Qt Designer that allows QScintilla instances
236 to be included in GUI designs just like any other Qt widget.
237
238 This package contains the Qt 5 version.
239
240 %description -n Qt5Designer-plugin-%{name} -l pl.UTF-8
241 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
242 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
243 Qt.
244
245 Ten pakiet zawiera wersję dla Qt 5.
246
247 %package -n sip-PyQt5-%{name}
248 Summary:        Python bindings for the QScintilla2 - SIP development files
249 Summary(pl.UTF-8):      Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
250 Group:          Development/Languages/Python
251 Requires:       sip-PyQt5 >= %{pyqt5_ver}
252
253 %description -n sip-PyQt5-%{name}
254 Python bindings for the QScintilla2 - SIP development files.
255
256 %description -n sip-PyQt5-%{name} -l pl.UTF-8
257 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
258 SIP.
259
260 %package -n python-PyQt5-%{name}
261 Summary:        Python 2 bindings for the QScintilla2 (PyQt5 version)
262 Summary(pl.UTF-8):      Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5)
263 Group:          Libraries/Python
264 Requires:       %{name}-qt5 = %{version}-%{release}
265 %requires_ge    python-PyQt5
266
267 %description -n python-PyQt5-%{name}
268 Python 2 bindings for the QScintilla2 (PyQt5 version).
269
270 %description -n python-PyQt5-%{name} -l pl.UTF-8
271 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
272
273 %package -n python3-PyQt5-%{name}
274 Summary:        Python 3 bindings for the QScintilla2 (PyQt5 version)
275 Summary(pl.UTF-8):      Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5)
276 Group:          Libraries/Python
277 Requires:       %{name}-qt5 = %{version}-%{release}
278 %requires_ge    python3-PyQt5
279
280 %description -n python3-PyQt5-%{name}
281 Python 3 bindings for the QScintilla2 (PyQt5 version).
282
283 %description -n python3-PyQt5-%{name} -l pl.UTF-8
284 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
285
286 %prep
287 %setup -q -n QScintilla-gpl-%{version}
288 %patch0 -p1
289 %patch1 -p1
290 %patch2 -p1
291 %patch3 -p1
292 %patch4 -p1
293
294 %build
295 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
296 install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
297 cd build-${qt}/Qt4Qt5
298 qmake-${qt} ../../Qt4Qt5/qscintilla.pro
299 %{__make}
300 cd ../designer-Qt4Qt5
301 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
302 %{__make}
303 cd ..
304
305 %if %{with python2}
306 cd Python2
307 # setup PATH to get proper qmake
308 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
309 PATH=%{_libdir}/${qt}/bin:$PATH \
310 %{__python} ../../Python/configure.py \
311         --verbose \
312         -c -j 3 \
313         -n ../../Qt4Qt5 \
314         -o ../Qt4Qt5 \
315         --apidir=%{_datadir}/${qt}/qsci \
316         --pyqt=PyQt${qt#qt}
317 %{__make}
318 cd ..
319 %endif
320 %if %{with python3}
321 cd Python3
322 PATH=%{_libdir}/${qt}/bin:$PATH \
323 %{__python3} ../../Python/configure.py \
324         --verbose \
325         -c -j 3 \
326         -n ../../Qt4Qt5 \
327         -o ../Qt4Qt5 \
328         --apidir=%{_datadir}/${qt}/qsci \
329         --pyqt=PyQt${qt#qt}
330 %{__make}
331 cd ..
332 %endif
333 cd ..
334 done
335
336 %install
337 rm -rf $RPM_BUILD_ROOT
338
339 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
340 %{__make} -C build-${qt}/Qt4Qt5 install \
341         INSTALL_ROOT=$RPM_BUILD_ROOT
342 %{__make} -C build-${qt}/designer-Qt4Qt5 install \
343         INSTALL_ROOT=$RPM_BUILD_ROOT
344 %if %{with python3}
345 %{__make} -C build-${qt}/Python3 install \
346         INSTALL_ROOT=$RPM_BUILD_ROOT
347 %endif
348 %if %{with python2}
349 %{__make} -C build-${qt}/Python2 install \
350         INSTALL_ROOT=$RPM_BUILD_ROOT
351 %endif
352 done
353
354 # unnecessary symlink
355 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.11.3
356
357 %if %{with qt4}
358 # move Qt4 translations to PLD-specific directory scheme
359 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
360 do
361         lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
362         [ "$lang" == "pt_br" ] && lang=pt_BR
363         install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
364         mv -f $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
365 done
366
367 # compatibility symlinks
368 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11
369 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so
370 %endif
371
372 %clean
373 rm -rf $RPM_BUILD_ROOT
374
375 %post   qt4 -p /sbin/ldconfig
376 %postun qt4 -p /sbin/ldconfig
377
378 %post   qt5 -p /sbin/ldconfig
379 %postun qt5 -p /sbin/ldconfig
380
381 %files apidocs
382 %defattr(644,root,root,755)
383 %doc doc/{Scintilla,html-Qt4Qt5}
384
385 %if %{with qt4}
386 %files qt4
387 %defattr(644,root,root,755)
388 %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README
389 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so.*.*.*
390 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt4.so.11
391 # compatibility symlink
392 %attr(755,root,root) %{_libdir}/libqscintilla2.so.11
393 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
394 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
395 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
396 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
397 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
398 %dir %{_datadir}/qt4/qsci
399 %dir %{_datadir}/qt4/qsci/api
400 %dir %{_datadir}/qt4/qsci/api/python
401 %{_datadir}/qt4/qsci/api/python/Python-*.api
402 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
403
404 %files qt4-devel
405 %defattr(644,root,root,755)
406 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so
407 # compatibility symlink
408 %attr(755,root,root) %{_libdir}/libqscintilla2.so
409 %{_includedir}/qt4/Qsci
410 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
411
412 %files -n QtDesigner-plugin-%{name}
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
415
416 %files -n sip-PyQt4-%{name}
417 %defattr(644,root,root,755)
418 %{_sipfilesdir}/PyQt4/Qsci
419
420 %if %{with python2}
421 %files -n python-PyQt4-%{name}
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
424 %endif
425
426 %if %{with python3}
427 %files -n python3-PyQt4-%{name}
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
430 %endif
431 %endif
432
433 %if %{with qt5}
434 %files qt5
435 %defattr(644,root,root,755)
436 %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README
437 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so.*.*.*
438 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt5.so.11
439 %lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm
440 %lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm
441 %lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm
442 %lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm
443 %lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm
444 %dir %{_datadir}/qt5/qsci
445 %dir %{_datadir}/qt5/qsci/api
446 %dir %{_datadir}/qt5/qsci/api/python
447 %{_datadir}/qt5/qsci/api/python/Python-*.api
448 %{_datadir}/qt5/qsci/api/python/QScintilla2.api
449
450 %files qt5-devel
451 %defattr(644,root,root,755)
452 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so
453 %{_includedir}/qt5/Qsci
454 %{_datadir}/qt5/mkspecs/features/qscintilla2.prf
455
456 %files -n Qt5Designer-plugin-%{name}
457 %defattr(644,root,root,755)
458 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
459
460 %files -n sip-PyQt5-%{name}
461 %defattr(644,root,root,755)
462 %{_sipfilesdir}/PyQt5/Qsci
463
464 %if %{with python2}
465 %files -n python-PyQt5-%{name}
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
468 %endif
469
470 %if %{with python3}
471 %files -n python3-PyQt5-%{name}
472 %defattr(644,root,root,755)
473 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so
474 %endif
475 %endif
This page took 0.059869 seconds and 3 git commands to generate.