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?)
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
13 %define scintilla_ver 3.3.6
15 %define pyqt4_ver 4.8.2
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
22 License: GPL v2 or GPL v3 with Riverbank GPL Exception v1.1
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 Patch5: %{name}-mkspecs-dir.patch
32 URL: http://www.riverbankcomputing.co.uk/software/qscintilla/
34 BuildRequires: python-sip-devel >= 2:%{sip_ver}
37 BuildRequires: python3-sip-devel >= 2:%{sip_ver}
39 BuildRequires: rpm-pythonprov
40 BuildRequires: rpmbuild(macros) >= 1.558
42 BuildRequires: QtDesigner-devel >= 4.8
43 BuildRequires: QtGui-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: Qt5Widgets-devel >= 5
59 BuildRequires: qt5-build >= 5
60 BuildRequires: qt5-qmake >= 5
61 BuildRequires: sip-PyQt5 >= %{pyqt5_ver}
63 BuildRequires: python-PyQt5 >= %{pyqt5_ver}
66 BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
69 BuildConflicts: qscintilla2-devel < %{version}
70 %{?with_qt4:BuildConflicts: qscintilla2-qt4-devel < %{version}}
71 %{?with_qt5:BuildConflicts: qscintilla2-qt5-devel < %{version}}
72 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 %define _sipfilesdir %{_datadir}/sip
77 QScintilla2 is a port to Qt of the Scintilla editing component.
78 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
80 %description -l pl.UTF-8
81 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
82 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
85 Summary: QScintilla2 API documentation
86 Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2
90 QScintilla2 API documentation.
92 %description apidocs -l pl.UTF-8
93 Dokumentacja API biblioteki QScintilla2.
96 Summary: QScintilla2 - a port to Qt 4 of the Scintilla editing component
97 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4
99 %ifarch %{x8664} ppc64 s390x sparc64
100 Provides: libqscintilla2.so.11()(64bit)
102 Provides: libqscintilla2.so.11
104 Obsoletes: qscintilla2 < 2.8.4
107 QScintilla2 is a port to Qt of the Scintilla editing component.
108 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
110 This package contains the Qt 4 port.
112 %description qt4 -l pl.UTF-8
113 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
114 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
116 Ten pakiet zawiera port Qt 4.
119 Summary: Development files for the QScintilla2 Qt 4 library
120 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4
121 Group: X11/Development/Libraries
122 Requires: %{name}-qt4 = %{version}-%{release}
123 Requires: QtGui-devel >= 4
124 Obsoletes: qscintilla2-devel < 2.8.4
126 %description qt4-devel
127 This package contains the header files necessary to develop
128 applications using QScintilla2 for Qt 4.
130 %description qt4-devel -l pl.UTF-8
131 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
132 użyciem komponentu QScintilla2 dla Qt 4.
134 %package -n QtDesigner-plugin-%{name}
135 Summary: QScintilla2 plugin for Qt Designer
136 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
137 Group: X11/Development/Libraries
138 Requires: %{name}-qt4 = %{version}-%{release}
139 Requires: QtDesigner >= 4
141 %description -n QtDesigner-plugin-%{name}
142 QScintilla2 plugin for Qt Designer that allows QScintilla instances
143 to be included in GUI designs just like any other Qt widget.
145 This package contains the Qt 4 version.
147 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
148 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
149 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
152 Ten pakiet zawiera wersję dla Qt 4.
154 %package -n sip-PyQt4-%{name}
155 Summary: Python bindings for the QScintilla2 - SIP development files
156 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
157 Group: Development/Languages/Python
158 Requires: sip-PyQt4 >= %{pyqt4_ver}
159 Obsoletes: python-qscintilla2-devel < 2.8.4
161 %description -n sip-PyQt4-%{name}
162 Python bindings for the QScintilla2 - SIP development files.
164 %description -n sip-PyQt4-%{name} -l pl.UTF-8
165 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
168 %package -n python-PyQt4-%{name}
169 Summary: Python 2 bindings for the QScintilla2 (PyQt4 version)
170 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4)
171 Group: Libraries/Python
172 Requires: %{name}-qt4 = %{version}-%{release}
173 %requires_ge python-PyQt4
174 Obsoletes: python-qscintilla2 < 2.8.4
176 %description -n python-PyQt4-%{name}
177 Python 2 bindings for the QScintilla2 (PyQt4 version).
179 %description -n python-PyQt4-%{name} -l pl.UTF-8
180 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
182 %package -n python3-PyQt4-%{name}
183 Summary: Python 3 bindings for the QScintilla2 (PyQt4 version)
184 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4)
185 Group: Libraries/Python
186 Requires: %{name}-qt4 = %{version}-%{release}
187 %requires_ge python3-PyQt4
189 %description -n python3-PyQt4-%{name}
190 Python 3 bindings for the QScintilla2 (PyQt4 version).
192 %description -n python3-PyQt4-%{name} -l pl.UTF-8
193 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
196 Summary: QScintilla2 - a port to Qt 5 of the Scintilla editing component
197 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5
201 QScintilla2 is a port to Qt of the Scintilla editing component.
202 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
204 This package contains the Qt 5 port.
206 %description qt5 -l pl.UTF-8
207 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
208 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
210 Ten pakiet zawiera port Qt 5.
213 Summary: Development files for the QScintilla2 Qt 5 library
214 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5
215 Group: X11/Development/Libraries
216 Requires: %{name}-qt5 = %{version}-%{release}
217 Requires: Qt5Gui-devel >= 5
218 Obsoletes: qscintilla2-devel < 2.8.4
220 %description qt5-devel
221 This package contains the header files necessary to develop
222 applications using QScintilla2 for Qt 5.
224 %description qt5-devel -l pl.UTF-8
225 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
226 użyciem komponentu QScintilla2 dla Qt 5.
228 %package -n Qt5Designer-plugin-%{name}
229 Summary: QScintilla2 plugin for Qt Designer
230 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
231 Group: X11/Development/Libraries
232 Requires: %{name}-qt5 = %{version}-%{release}
233 Requires: Qt5Designer >= 5
235 %description -n Qt5Designer-plugin-%{name}
236 QScintilla2 plugin for Qt Designer that allows QScintilla instances
237 to be included in GUI designs just like any other Qt widget.
239 This package contains the Qt 5 version.
241 %description -n Qt5Designer-plugin-%{name} -l pl.UTF-8
242 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
243 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
246 Ten pakiet zawiera wersję dla Qt 5.
248 %package -n sip-PyQt5-%{name}
249 Summary: Python bindings for the QScintilla2 - SIP development files
250 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
251 Group: Development/Languages/Python
252 Requires: sip-PyQt5 >= %{pyqt5_ver}
254 %description -n sip-PyQt5-%{name}
255 Python bindings for the QScintilla2 - SIP development files.
257 %description -n sip-PyQt5-%{name} -l pl.UTF-8
258 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
261 %package -n python-PyQt5-%{name}
262 Summary: Python 2 bindings for the QScintilla2 (PyQt5 version)
263 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5)
264 Group: Libraries/Python
265 Requires: %{name}-qt5 = %{version}-%{release}
266 %requires_ge python-PyQt5
268 %description -n python-PyQt5-%{name}
269 Python 2 bindings for the QScintilla2 (PyQt5 version).
271 %description -n python-PyQt5-%{name} -l pl.UTF-8
272 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
274 %package -n python3-PyQt5-%{name}
275 Summary: Python 3 bindings for the QScintilla2 (PyQt5 version)
276 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5)
277 Group: Libraries/Python
278 Requires: %{name}-qt5 = %{version}-%{release}
279 %requires_ge python3-PyQt5
281 %description -n python3-PyQt5-%{name}
282 Python 3 bindings for the QScintilla2 (PyQt5 version).
284 %description -n python3-PyQt5-%{name} -l pl.UTF-8
285 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
288 %setup -q -n QScintilla-gpl-%{version}
297 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
298 install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
299 cd build-${qt}/Qt4Qt5
300 qmake-${qt} ../../Qt4Qt5/qscintilla.pro \
301 $(test "$qt" = "qt4" || echo QMAKE_MKSPECS=%{_libdir}/$qt/mkspecs)
303 cd ../designer-Qt4Qt5
304 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
310 # setup PATH to get proper qmake
311 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
312 PATH=%{_libdir}/${qt}/bin:$PATH \
313 %{__python} ../../Python/configure.py \
318 --apidir=%{_datadir}/${qt}/qsci \
325 PATH=%{_libdir}/${qt}/bin:$PATH \
326 %{__python3} ../../Python/configure.py \
331 --apidir=%{_datadir}/${qt}/qsci \
340 rm -rf $RPM_BUILD_ROOT
342 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
343 %{__make} -C build-${qt}/Qt4Qt5 install \
344 INSTALL_ROOT=$RPM_BUILD_ROOT
345 %{__make} -C build-${qt}/designer-Qt4Qt5 install \
346 INSTALL_ROOT=$RPM_BUILD_ROOT
348 %{__make} -C build-${qt}/Python3 install \
349 INSTALL_ROOT=$RPM_BUILD_ROOT
352 %{__make} -C build-${qt}/Python2 install \
353 INSTALL_ROOT=$RPM_BUILD_ROOT
357 # unnecessary symlink
358 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.11.3
361 # move Qt4 translations to PLD-specific directory scheme
362 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
364 lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
365 [ "$lang" == "pt_br" ] && lang=pt_BR
366 install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
367 mv -f $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
370 # compatibility symlinks
371 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11
372 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so
376 rm -rf $RPM_BUILD_ROOT
378 %post qt4 -p /sbin/ldconfig
379 %postun qt4 -p /sbin/ldconfig
381 %post qt5 -p /sbin/ldconfig
382 %postun qt5 -p /sbin/ldconfig
385 %defattr(644,root,root,755)
386 %doc doc/{Scintilla,html-Qt4Qt5}
390 %defattr(644,root,root,755)
391 %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README
392 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so.*.*.*
393 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt4.so.11
394 # compatibility symlink
395 %attr(755,root,root) %{_libdir}/libqscintilla2.so.11
396 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
397 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
398 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
399 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
400 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
401 %dir %{_datadir}/qt4/qsci
402 %dir %{_datadir}/qt4/qsci/api
403 %dir %{_datadir}/qt4/qsci/api/python
404 %{_datadir}/qt4/qsci/api/python/Python-*.api
405 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so
410 # compatibility symlink
411 %attr(755,root,root) %{_libdir}/libqscintilla2.so
412 %{_includedir}/qt4/Qsci
413 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
415 %files -n QtDesigner-plugin-%{name}
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
419 %files -n sip-PyQt4-%{name}
420 %defattr(644,root,root,755)
421 %{_sipfilesdir}/PyQt4/Qsci
424 %files -n python-PyQt4-%{name}
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
430 %files -n python3-PyQt4-%{name}
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
438 %defattr(644,root,root,755)
439 %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README
440 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so.*.*.*
441 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt5.so.11
442 %lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm
443 %lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm
444 %lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm
445 %lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm
446 %lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm
447 %dir %{_datadir}/qt5/qsci
448 %dir %{_datadir}/qt5/qsci/api
449 %dir %{_datadir}/qt5/qsci/api/python
450 %{_datadir}/qt5/qsci/api/python/Python-*.api
451 %{_datadir}/qt5/qsci/api/python/QScintilla2.api
454 %defattr(644,root,root,755)
455 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so
456 %{_includedir}/qt5/Qsci
457 %{_libdir}/qt5/mkspecs/features/qscintilla2.prf
459 %files -n Qt5Designer-plugin-%{name}
460 %defattr(644,root,root,755)
461 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
463 %files -n sip-PyQt5-%{name}
464 %defattr(644,root,root,755)
465 %{_sipfilesdir}/PyQt5/Qsci
468 %files -n python-PyQt5-%{name}
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
474 %files -n python3-PyQt5-%{name}
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so