2 # - fix building with qscintilla2(-devel) installed, remove BC
3 # - how to successfully prepend -I../Qt4Qt5 before system qt include in qmake?
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
8 %bcond_without qt4 # Qt4 library and modules
9 %bcond_without qt5 # Qt5 library and modules
11 %define scintilla_ver 3.3.6
13 %define pyqt4_ver 1:4.12.1
14 %define pyqt5_ver 5.7.1
15 Summary: QScintilla2 - a port to Qt of the Scintilla editing component
16 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt
22 Source0: https://www.riverbankcomputing.com/static/Downloads/QScintilla/%{version}/QScintilla_gpl-%{version}.tar.gz
23 # Source0-md5: 2ec4833e790e44698c50ec703f274bab
24 Patch0: %{name}-internal_build.patch
25 Patch3: %{name}-outoftree.patch
26 Patch4: %{name}-qt5.patch
27 Patch5: py-config.patch
28 Patch6: python-install.patch
29 Patch7: sip-check.patch
30 Patch8: missing-header.patch
31 URL: http://www.riverbankcomputing.co.uk/software/qscintilla/
33 BuildRequires: python-sip-devel >= 2:%{sip_ver}
36 BuildRequires: python3-sip-devel >= 2:%{sip_ver}
38 BuildRequires: rpm-pythonprov
39 BuildRequires: rpmbuild(macros) >= 1.558
41 BuildRequires: QtDesigner-devel >= 4.8
42 BuildRequires: QtGui-devel >= 4.8
43 BuildRequires: QtNetwork-devel >= 4.8
44 BuildRequires: qt4-build >= 4.8
45 BuildRequires: qt4-qmake >= 4.8
46 BuildRequires: sip-PyQt4 >= %{pyqt4_ver}
48 BuildRequires: python-PyQt4 >= %{pyqt4_ver}
51 BuildRequires: python3-PyQt4 >= %{pyqt4_ver}
55 BuildRequires: Qt5Designer-devel >= 5
56 BuildRequires: Qt5Gui-devel >= 5
57 BuildRequires: Qt5PrintSupport-devel >= 5
58 BuildRequires: Qt5UiTools-devel >= 5
59 BuildRequires: Qt5Widgets-devel >= 5
60 BuildRequires: qt5-build >= 5
61 BuildRequires: qt5-qmake >= 5
62 BuildRequires: sip-PyQt5 >= %{pyqt5_ver}
64 BuildRequires: python-PyQt5 >= %{pyqt5_ver}
67 BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
70 BuildConflicts: qscintilla2-devel < %{version}
71 %{?with_qt4:BuildConflicts: qscintilla2-qt4-devel < %{version}}
72 %{?with_qt5:BuildConflicts: qscintilla2-qt5-devel < %{version}}
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define _sipfilesdir %{_datadir}/sip
78 QScintilla2 is a port to Qt of the Scintilla editing component.
79 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
81 %description -l pl.UTF-8
82 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
83 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
86 Summary: QScintilla2 API documentation
87 Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2
92 QScintilla2 API documentation.
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API biblioteki QScintilla2.
98 Summary: QScintilla2 - a port to Qt 4 of the Scintilla editing component
99 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4
101 %ifarch %{x8664} ppc64 s390x sparc64
102 Provides: libqscintilla2.so.11()(64bit)
104 Provides: libqscintilla2.so.11
106 Obsoletes: qscintilla2 < 2.8.4
109 QScintilla2 is a port to Qt of the Scintilla editing component.
110 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
112 This package contains the Qt 4 port.
114 %description qt4 -l pl.UTF-8
115 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
116 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
118 Ten pakiet zawiera port Qt 4.
121 Summary: Development files for the QScintilla2 Qt 4 library
122 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4
123 Group: X11/Development/Libraries
124 Requires: %{name}-qt4 = %{version}-%{release}
125 Requires: QtGui-devel >= 4
126 Obsoletes: qscintilla2-devel < 2.8.4
128 %description qt4-devel
129 This package contains the header files necessary to develop
130 applications using QScintilla2 for Qt 4.
132 %description qt4-devel -l pl.UTF-8
133 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
134 użyciem komponentu QScintilla2 dla Qt 4.
136 %package -n QtDesigner-plugin-%{name}
137 Summary: QScintilla2 plugin for Qt Designer
138 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
139 Group: X11/Development/Libraries
140 Requires: %{name}-qt4 = %{version}-%{release}
141 Requires: QtDesigner >= 4
143 %description -n QtDesigner-plugin-%{name}
144 QScintilla2 plugin for Qt Designer that allows QScintilla instances
145 to be included in GUI designs just like any other Qt widget.
147 This package contains the Qt 4 version.
149 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
150 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
151 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
154 Ten pakiet zawiera wersję dla Qt 4.
156 %package -n sip-PyQt4-%{name}
157 Summary: Python bindings for the QScintilla2 - SIP development files
158 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
159 Group: Development/Languages/Python
160 Requires: sip-PyQt4 >= %{pyqt4_ver}
161 Obsoletes: python-qscintilla2-devel < 2.8.4
163 %description -n sip-PyQt4-%{name}
164 Python bindings for the QScintilla2 - SIP development files.
166 %description -n sip-PyQt4-%{name} -l pl.UTF-8
167 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
170 %package -n python-PyQt4-%{name}
171 Summary: Python 2 bindings for the QScintilla2 (PyQt4 version)
172 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4)
173 Group: Libraries/Python
174 Requires: %{name}-qt4 = %{version}-%{release}
175 %requires_ge python-PyQt4
176 Obsoletes: python-qscintilla2 < 2.8.4
178 %description -n python-PyQt4-%{name}
179 Python 2 bindings for the QScintilla2 (PyQt4 version).
181 %description -n python-PyQt4-%{name} -l pl.UTF-8
182 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
184 %package -n python3-PyQt4-%{name}
185 Summary: Python 3 bindings for the QScintilla2 (PyQt4 version)
186 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4)
187 Group: Libraries/Python
188 Requires: %{name}-qt4 = %{version}-%{release}
189 %requires_ge python3-PyQt4
191 %description -n python3-PyQt4-%{name}
192 Python 3 bindings for the QScintilla2 (PyQt4 version).
194 %description -n python3-PyQt4-%{name} -l pl.UTF-8
195 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
198 Summary: QScintilla2 - a port to Qt 5 of the Scintilla editing component
199 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5
203 QScintilla2 is a port to Qt of the Scintilla editing component.
204 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
206 This package contains the Qt 5 port.
208 %description qt5 -l pl.UTF-8
209 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
210 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
212 Ten pakiet zawiera port Qt 5.
215 Summary: Development files for the QScintilla2 Qt 5 library
216 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5
217 Group: X11/Development/Libraries
218 Requires: %{name}-qt5 = %{version}-%{release}
219 Requires: Qt5Gui-devel >= 5
220 Obsoletes: qscintilla2-devel < 2.8.4
222 %description qt5-devel
223 This package contains the header files necessary to develop
224 applications using QScintilla2 for Qt 5.
226 %description qt5-devel -l pl.UTF-8
227 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
228 użyciem komponentu QScintilla2 dla Qt 5.
230 %package -n Qt5Designer-plugin-%{name}
231 Summary: QScintilla2 plugin for Qt Designer
232 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
233 Group: X11/Development/Libraries
234 Requires: %{name}-qt5 = %{version}-%{release}
235 Requires: Qt5Designer >= 5
237 %description -n Qt5Designer-plugin-%{name}
238 QScintilla2 plugin for Qt Designer that allows QScintilla instances
239 to be included in GUI designs just like any other Qt widget.
241 This package contains the Qt 5 version.
243 %description -n Qt5Designer-plugin-%{name} -l pl.UTF-8
244 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
245 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
248 Ten pakiet zawiera wersję dla Qt 5.
250 %package -n sip-PyQt5-%{name}
251 Summary: Python bindings for the QScintilla2 - SIP development files
252 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
253 Group: Development/Languages/Python
254 Requires: sip-PyQt5 >= %{pyqt5_ver}
256 %description -n sip-PyQt5-%{name}
257 Python bindings for the QScintilla2 - SIP development files.
259 %description -n sip-PyQt5-%{name} -l pl.UTF-8
260 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
263 %package -n python-PyQt5-%{name}
264 Summary: Python 2 bindings for the QScintilla2 (PyQt5 version)
265 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5)
266 Group: Libraries/Python
267 Requires: %{name}-qt5 = %{version}-%{release}
268 %requires_ge python-PyQt5
270 %description -n python-PyQt5-%{name}
271 Python 2 bindings for the QScintilla2 (PyQt5 version).
273 %description -n python-PyQt5-%{name} -l pl.UTF-8
274 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
276 %package -n python3-PyQt5-%{name}
277 Summary: Python 3 bindings for the QScintilla2 (PyQt5 version)
278 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5)
279 Group: Libraries/Python
280 Requires: %{name}-qt5 = %{version}-%{release}
281 %requires_ge python3-PyQt5
283 %description -n python3-PyQt5-%{name}
284 Python 3 bindings for the QScintilla2 (PyQt5 version).
286 %description -n python3-PyQt5-%{name} -l pl.UTF-8
287 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
290 %setup -q -n QScintilla_gpl-%{version}
300 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
301 install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
302 cd build-${qt}/Qt4Qt5
303 qmake-${qt} ../../Qt4Qt5/qscintilla.pro \
304 $(test "$qt" = "qt4" || echo QMAKE_MKSPECS=%{_libdir}/$qt/mkspecs)
306 cd ../designer-Qt4Qt5
307 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
313 # setup PATH to get proper qmake
314 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
315 PATH=%{_libdir}/${qt}/bin:$PATH \
316 %{__python} ../../Python/configure.py \
319 --concatenate-split 3 \
322 --apidir=%{_datadir}/${qt}/qsci \
329 PATH=%{_libdir}/${qt}/bin:$PATH \
330 %{__python3} ../../Python/configure.py \
333 --concatenate-split 3 \
336 --apidir=%{_datadir}/${qt}/qsci \
345 rm -rf $RPM_BUILD_ROOT
347 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
348 %{__make} -j1 -C build-${qt}/Qt4Qt5 install \
349 INSTALL_ROOT=$RPM_BUILD_ROOT
350 %{__make} -j1 -C build-${qt}/designer-Qt4Qt5 install \
351 INSTALL_ROOT=$RPM_BUILD_ROOT
353 %{__make} -j1 -C build-${qt}/Python3 install \
354 INSTALL_ROOT=$RPM_BUILD_ROOT
357 %{__make} -j1 -C build-${qt}/Python2 install \
358 INSTALL_ROOT=$RPM_BUILD_ROOT
362 # unnecessary symlink
363 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.15.0
366 # move Qt4 translations to PLD-specific directory scheme
367 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
369 lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
370 [ "$lang" == "pt_br" ] && lang=pt_BR
371 install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
372 %{__mv} $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
377 rm -rf $RPM_BUILD_ROOT
379 %post qt4 -p /sbin/ldconfig
380 %postun qt4 -p /sbin/ldconfig
382 %post qt5 -p /sbin/ldconfig
383 %postun qt5 -p /sbin/ldconfig
386 %defattr(644,root,root,755)
387 %doc doc/{Scintilla,html-Qt4Qt5}
391 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/libqscintilla2_qt4.so.*.*.*
394 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2_qt4.so.15
395 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
396 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
397 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
398 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
399 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
400 %dir %{_datadir}/qt4/qsci
401 %dir %{_datadir}/qt4/qsci/api
402 %dir %{_datadir}/qt4/qsci/api/python
403 %{_datadir}/qt4/qsci/api/python/Python-*.api
404 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
407 %defattr(644,root,root,755)
408 %attr(755,root,root) %{_libdir}/libqscintilla2_qt4.so
409 %{_includedir}/qt4/Qsci
410 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
412 %files -n QtDesigner-plugin-%{name}
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
416 %if %{with python2} || %{with python3}
417 %files -n sip-PyQt4-%{name}
418 %defattr(644,root,root,755)
419 %{_sipfilesdir}/PyQt4/Qsci
423 %files -n python-PyQt4-%{name}
424 %defattr(644,root,root,755)
425 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
426 %{py_sitedir}/PyQt4/Qsci.pyi
430 %files -n python3-PyQt4-%{name}
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
433 %{py3_sitedir}/PyQt4/Qsci.pyi
439 %defattr(644,root,root,755)
441 %attr(755,root,root) %{_libdir}/libqscintilla2_qt5.so.*.*.*
442 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2_qt5.so.15
443 %lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm
444 %lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm
445 %lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm
446 %lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm
447 %lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm
448 %dir %{_datadir}/qt5/qsci
449 %dir %{_datadir}/qt5/qsci/api
450 %dir %{_datadir}/qt5/qsci/api/python
451 %{_datadir}/qt5/qsci/api/python/Python-*.api
452 %{_datadir}/qt5/qsci/api/python/QScintilla2.api
455 %defattr(644,root,root,755)
456 %attr(755,root,root) %{_libdir}/libqscintilla2_qt5.so
457 %{_includedir}/qt5/Qsci
458 %{_libdir}/qt5/mkspecs/features/qscintilla2.prf
460 %files -n Qt5Designer-plugin-%{name}
461 %defattr(644,root,root,755)
462 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
464 %if %{with python2} || %{with python3}
465 %files -n sip-PyQt5-%{name}
466 %defattr(644,root,root,755)
467 %{_sipfilesdir}/PyQt5/Qsci
471 %files -n python-PyQt5-%{name}
472 %defattr(644,root,root,755)
473 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
474 %{py_sitedir}/PyQt5/Qsci.pyi
478 %files -n python3-PyQt5-%{name}
479 %defattr(644,root,root,755)
480 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so
481 %{py3_sitedir}/PyQt5/Qsci.pyi