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
10 %bcond_without pyqt4 # PyQt4 modules
11 %bcond_without pyqt5 # PyQt5 modules
13 %define scintilla_ver 3.3.6
15 %define pyqt4_ver 4.12
16 %define pyqt5_ver 5.7.1
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
24 Source0: https://www.riverbankcomputing.com/static/Downloads/QScintilla/%{version}/QScintilla_gpl-%{version}.tar.gz
25 # Source0-md5: 2ec4833e790e44698c50ec703f274bab
26 Patch0: %{name}-internal_build.patch
27 Patch3: %{name}-outoftree.patch
28 Patch4: %{name}-qt5.patch
29 Patch5: %{name}-link.patch
30 Patch6: python-install.patch
31 Patch7: sip-check.patch
32 Patch8: missing-header.patch
33 URL: http://www.riverbankcomputing.co.uk/software/qscintilla/
35 BuildRequires: python-sip-devel >= 2:%{sip_ver}
38 BuildRequires: python3-sip-devel >= 2:%{sip_ver}
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.558
43 BuildRequires: QtDesigner-devel >= 4.8
44 BuildRequires: QtGui-devel >= 4.8
45 BuildRequires: QtNetwork-devel >= 4.8
46 BuildRequires: qt4-build >= 4.8
47 BuildRequires: qt4-qmake >= 4.8
48 BuildRequires: sip-PyQt4 >= %{pyqt4_ver}
50 BuildRequires: python-PyQt4 >= %{pyqt4_ver}
53 BuildRequires: python3-PyQt4 >= %{pyqt4_ver}
57 BuildRequires: Qt5Designer-devel >= 5
58 BuildRequires: Qt5Gui-devel >= 5
59 BuildRequires: Qt5PrintSupport-devel >= 5
60 BuildRequires: Qt5UiTools-devel >= 5
61 BuildRequires: Qt5Widgets-devel >= 5
62 BuildRequires: qt5-build >= 5
63 BuildRequires: qt5-qmake >= 5
64 BuildRequires: sip-PyQt5 >= %{pyqt5_ver}
66 BuildRequires: python-PyQt5 >= %{pyqt5_ver}
69 BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
72 BuildConflicts: qscintilla2-devel < %{version}
73 %{?with_qt4:BuildConflicts: qscintilla2-qt4-devel < %{version}}
74 %{?with_qt5:BuildConflicts: qscintilla2-qt5-devel < %{version}}
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77 %define _sipfilesdir %{_datadir}/sip
80 QScintilla2 is a port to Qt of the Scintilla editing component.
81 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
83 %description -l pl.UTF-8
84 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
85 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
88 Summary: QScintilla2 API documentation
89 Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2
91 %if "%{_rpmversion}" >= "5"
96 QScintilla2 API documentation.
98 %description apidocs -l pl.UTF-8
99 Dokumentacja API biblioteki QScintilla2.
102 Summary: QScintilla2 - a port to Qt 4 of the Scintilla editing component
103 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4
105 %ifarch %{x8664} ppc64 s390x sparc64
106 Provides: libqscintilla2.so.11()(64bit)
108 Provides: libqscintilla2.so.11
110 Obsoletes: qscintilla2 < 2.8.4
113 QScintilla2 is a port to Qt of the Scintilla editing component.
114 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
116 This package contains the Qt 4 port.
118 %description qt4 -l pl.UTF-8
119 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
120 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
122 Ten pakiet zawiera port Qt 4.
125 Summary: Development files for the QScintilla2 Qt 4 library
126 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4
127 Group: X11/Development/Libraries
128 Requires: %{name}-qt4 = %{version}-%{release}
129 Requires: QtGui-devel >= 4
130 Obsoletes: qscintilla2-devel < 2.8.4
132 %description qt4-devel
133 This package contains the header files necessary to develop
134 applications using QScintilla2 for Qt 4.
136 %description qt4-devel -l pl.UTF-8
137 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
138 użyciem komponentu QScintilla2 dla Qt 4.
140 %package -n QtDesigner-plugin-%{name}
141 Summary: QScintilla2 plugin for Qt Designer
142 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
143 Group: X11/Development/Libraries
144 Requires: %{name}-qt4 = %{version}-%{release}
145 Requires: QtDesigner >= 4
147 %description -n QtDesigner-plugin-%{name}
148 QScintilla2 plugin for Qt Designer that allows QScintilla instances
149 to be included in GUI designs just like any other Qt widget.
151 This package contains the Qt 4 version.
153 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
154 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
155 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
158 Ten pakiet zawiera wersję dla Qt 4.
160 %package -n sip-PyQt4-%{name}
161 Summary: Python bindings for the QScintilla2 - SIP development files
162 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
163 Group: Development/Languages/Python
164 Requires: sip-PyQt4 >= %{pyqt4_ver}
165 Obsoletes: python-qscintilla2-devel < 2.8.4
167 %description -n sip-PyQt4-%{name}
168 Python bindings for the QScintilla2 - SIP development files.
170 %description -n sip-PyQt4-%{name} -l pl.UTF-8
171 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
174 %package -n python-PyQt4-%{name}
175 Summary: Python 2 bindings for the QScintilla2 (PyQt4 version)
176 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4)
177 Group: Libraries/Python
178 Requires: %{name}-qt4 = %{version}-%{release}
179 %requires_ge python-PyQt4
180 Obsoletes: python-qscintilla2 < 2.8.4
182 %description -n python-PyQt4-%{name}
183 Python 2 bindings for the QScintilla2 (PyQt4 version).
185 %description -n python-PyQt4-%{name} -l pl.UTF-8
186 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
188 %package -n python3-PyQt4-%{name}
189 Summary: Python 3 bindings for the QScintilla2 (PyQt4 version)
190 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4)
191 Group: Libraries/Python
192 Requires: %{name}-qt4 = %{version}-%{release}
193 %requires_ge python3-PyQt4
195 %description -n python3-PyQt4-%{name}
196 Python 3 bindings for the QScintilla2 (PyQt4 version).
198 %description -n python3-PyQt4-%{name} -l pl.UTF-8
199 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
202 Summary: QScintilla2 - a port to Qt 5 of the Scintilla editing component
203 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5
207 QScintilla2 is a port to Qt of the Scintilla editing component.
208 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
210 This package contains the Qt 5 port.
212 %description qt5 -l pl.UTF-8
213 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
214 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
216 Ten pakiet zawiera port Qt 5.
219 Summary: Development files for the QScintilla2 Qt 5 library
220 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5
221 Group: X11/Development/Libraries
222 Requires: %{name}-qt5 = %{version}-%{release}
223 Requires: Qt5Gui-devel >= 5
224 Obsoletes: qscintilla2-devel < 2.8.4
226 %description qt5-devel
227 This package contains the header files necessary to develop
228 applications using QScintilla2 for Qt 5.
230 %description qt5-devel -l pl.UTF-8
231 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
232 użyciem komponentu QScintilla2 dla Qt 5.
234 %package -n Qt5Designer-plugin-%{name}
235 Summary: QScintilla2 plugin for Qt Designer
236 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
237 Group: X11/Development/Libraries
238 Requires: %{name}-qt5 = %{version}-%{release}
239 Requires: Qt5Designer >= 5
241 %description -n Qt5Designer-plugin-%{name}
242 QScintilla2 plugin for Qt Designer that allows QScintilla instances
243 to be included in GUI designs just like any other Qt widget.
245 This package contains the Qt 5 version.
247 %description -n Qt5Designer-plugin-%{name} -l pl.UTF-8
248 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
249 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
252 Ten pakiet zawiera wersję dla Qt 5.
254 %package -n sip-PyQt5-%{name}
255 Summary: Python bindings for the QScintilla2 - SIP development files
256 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
257 Group: Development/Languages/Python
258 Requires: sip-PyQt5 >= %{pyqt5_ver}
260 %description -n sip-PyQt5-%{name}
261 Python bindings for the QScintilla2 - SIP development files.
263 %description -n sip-PyQt5-%{name} -l pl.UTF-8
264 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
267 %package -n python-PyQt5-%{name}
268 Summary: Python 2 bindings for the QScintilla2 (PyQt5 version)
269 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5)
270 Group: Libraries/Python
271 Requires: %{name}-qt5 = %{version}-%{release}
272 %requires_ge python-PyQt5
274 %description -n python-PyQt5-%{name}
275 Python 2 bindings for the QScintilla2 (PyQt5 version).
277 %description -n python-PyQt5-%{name} -l pl.UTF-8
278 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
280 %package -n python3-PyQt5-%{name}
281 Summary: Python 3 bindings for the QScintilla2 (PyQt5 version)
282 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5)
283 Group: Libraries/Python
284 Requires: %{name}-qt5 = %{version}-%{release}
285 %requires_ge python3-PyQt5
287 %description -n python3-PyQt5-%{name}
288 Python 3 bindings for the QScintilla2 (PyQt5 version).
290 %description -n python3-PyQt5-%{name} -l pl.UTF-8
291 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
294 %setup -q -n QScintilla_gpl-%{version}
305 install -d build-qt4/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
307 qmake-qt4 ../../Qt4Qt5/qscintilla.pro
309 cd ../designer-Qt4Qt5
310 qmake-qt4 ../../designer-Qt4Qt5/designer.pro
317 # setup PATH to get proper qmake
318 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
319 PATH=%{_libdir}/qt4/bin:$PATH \
320 %{__python} ../../Python/configure.py \
325 --apidir=%{_datadir}/qt4/qsci \
332 PATH=%{_libdir}/qt4/bin:$PATH \
333 %{__python3} ../../Python/configure.py \
338 --apidir=%{_datadir}/qt4/qsci \
349 install -d build-qt5/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
351 qmake-qt5 ../../Qt4Qt5/qscintilla.pro \
352 QMAKE_MKSPECS=%{_libdir}/qt5/mkspecs
354 cd ../designer-Qt4Qt5
355 qmake-qt5 ../../designer-Qt4Qt5/designer.pro
362 # setup PATH to get proper qmake
363 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
364 PATH=%{_libdir}/qt5/bin:$PATH \
365 %{__python} ../../Python/configure.py \
370 --apidir=%{_datadir}/qt5/qsci \
377 PATH=%{_libdir}/qt5/bin:$PATH \
378 %{__python3} ../../Python/configure.py \
383 --apidir=%{_datadir}/qt5/qsci \
393 rm -rf $RPM_BUILD_ROOT
396 %{__make} -C build-qt4/Qt4Qt5 install \
397 INSTALL_ROOT=$RPM_BUILD_ROOT
398 %{__make} -C build-qt4/designer-Qt4Qt5 install \
399 INSTALL_ROOT=$RPM_BUILD_ROOT
402 %{__make} -C build-${qt4/Python3 install \
403 INSTALL_ROOT=$RPM_BUILD_ROOT
406 %{__make} -C build-${qt4/Python2 install \
407 INSTALL_ROOT=$RPM_BUILD_ROOT
413 %{__make} -C build-qt5/Qt4Qt5 install \
414 INSTALL_ROOT=$RPM_BUILD_ROOT
415 %{__make} -C build-qt5/designer-Qt4Qt5 install \
416 INSTALL_ROOT=$RPM_BUILD_ROOT
419 %{__make} -C build-qt5/Python3 install \
420 INSTALL_ROOT=$RPM_BUILD_ROOT
423 %{__make} -C build-qt5/Python2 install \
424 INSTALL_ROOT=$RPM_BUILD_ROOT
429 # unnecessary symlink
430 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.12.0
433 # move Qt4 translations to PLD-specific directory scheme
434 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
436 lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
437 [ "$lang" == "pt_br" ] && lang=pt_BR
438 install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
439 %{__mv} $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
442 # compatibility symlinks
443 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11
444 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so
448 rm -rf $RPM_BUILD_ROOT
450 %post qt4 -p /sbin/ldconfig
451 %postun qt4 -p /sbin/ldconfig
453 %post qt5 -p /sbin/ldconfig
454 %postun qt5 -p /sbin/ldconfig
457 %defattr(644,root,root,755)
458 %doc doc/{Scintilla,html-Qt4Qt5}
462 %defattr(644,root,root,755)
464 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so.*.*.*
465 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt4.so.12
466 # compatibility symlink
467 %attr(755,root,root) %{_libdir}/libqscintilla2.so.11
468 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
469 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
470 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
471 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
472 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
473 %dir %{_datadir}/qt4/qsci
474 %dir %{_datadir}/qt4/qsci/api
475 %dir %{_datadir}/qt4/qsci/api/python
476 %{_datadir}/qt4/qsci/api/python/Python-*.api
477 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
480 %defattr(644,root,root,755)
481 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so
482 # compatibility symlink
483 %attr(755,root,root) %{_libdir}/libqscintilla2.so
484 %{_includedir}/qt4/Qsci
485 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
487 %files -n QtDesigner-plugin-%{name}
488 %defattr(644,root,root,755)
489 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
491 %files -n sip-PyQt4-%{name}
492 %defattr(644,root,root,755)
493 %{_sipfilesdir}/PyQt4/Qsci
496 %files -n python-PyQt4-%{name}
497 %defattr(644,root,root,755)
498 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
502 %files -n python3-PyQt4-%{name}
503 %defattr(644,root,root,755)
504 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
510 %defattr(644,root,root,755)
512 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so.*.*.*
513 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt5.so.12
514 %lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm
515 %lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm
516 %lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm
517 %lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm
518 %lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm
519 %dir %{_datadir}/qt5/qsci
520 %dir %{_datadir}/qt5/qsci/api
521 %dir %{_datadir}/qt5/qsci/api/python
522 %{_datadir}/qt5/qsci/api/python/Python-*.api
523 %{_datadir}/qt5/qsci/api/python/QScintilla2.api
526 %defattr(644,root,root,755)
527 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so
528 %{_includedir}/qt5/Qsci
529 %{_libdir}/qt5/mkspecs/features/qscintilla2.prf
531 %files -n Qt5Designer-plugin-%{name}
532 %defattr(644,root,root,755)
533 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
535 %files -n sip-PyQt5-%{name}
536 %defattr(644,root,root,755)
537 %{_sipfilesdir}/PyQt5/Qsci
540 %files -n python-PyQt5-%{name}
541 %defattr(644,root,root,755)
542 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
546 %files -n python3-PyQt5-%{name}
547 %defattr(644,root,root,755)
548 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so