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 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: qt4-build >= 4.8
44 BuildRequires: qt4-qmake >= 4.8
45 BuildRequires: sip-PyQt4 >= %{pyqt4_ver}
47 BuildRequires: python-PyQt4 >= %{pyqt4_ver}
50 BuildRequires: python3-PyQt4 >= %{pyqt4_ver}
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}
62 BuildRequires: python-PyQt5 >= %{pyqt5_ver}
65 BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
68 BuildConflicts: qscintilla2-devel
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 %define _sipfilesdir %{_datadir}/sip
74 QScintilla2 is a port to Qt of the Scintilla editing component.
75 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
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}.
82 Summary: QScintilla2 API documentation
83 Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2
87 QScintilla2 API documentation.
89 %description apidocs -l pl.UTF-8
90 Dokumentacja API biblioteki QScintilla2.
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
96 Requires: %{name}-common = %{version}-%{release}
97 %ifarch %{x8664} ppc64 s390x sparc64
98 Provides: libqscintilla2.so.11()(64bit)
100 Provides: libqscintilla2.so.11
102 Obsoletes: qscintilla2 < 2.8.4
105 QScintilla2 is a port to Qt of the Scintilla editing component.
106 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
108 This package contains the Qt 4 port.
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}.
114 Ten pakiet zawiera port Qt 4.
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
124 %description qt4-devel
125 This package contains the header files necessary to develop
126 applications using QScintilla2 for Qt 4.
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.
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
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.
143 This package contains the Qt 4 version.
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
150 Ten pakiet zawiera wersję dla Qt 4.
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
159 %description -n sip-PyQt4-%{name}
160 Python bindings for the QScintilla2 - SIP development files.
162 %description -n sip-PyQt4-%{name} -l pl.UTF-8
163 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
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
174 %description -n python-PyQt4-%{name}
175 Python 2 bindings for the QScintilla2 (PyQt4 version).
177 %description -n python-PyQt4-%{name} -l pl.UTF-8
178 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
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
187 %description -n python3-PyQt4-%{name}
188 Python 3 bindings for the QScintilla2 (PyQt4 version).
190 %description -n python3-PyQt4-%{name} -l pl.UTF-8
191 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
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
197 Requires: %{name}-common = %{version}-%{release}
200 QScintilla2 is a port to Qt of the Scintilla editing component.
201 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
203 This package contains the Qt 5 port.
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}.
209 Ten pakiet zawiera port Qt 5.
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
219 %description qt5-devel
220 This package contains the header files necessary to develop
221 applications using QScintilla2 for Qt 5.
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.
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
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.
238 This package contains the Qt 5 version.
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
245 Ten pakiet zawiera wersję dla Qt 5.
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}
253 %description -n sip-PyQt5-%{name}
254 Python bindings for the QScintilla2 - SIP development files.
256 %description -n sip-PyQt5-%{name} -l pl.UTF-8
257 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
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
267 %description -n python-PyQt5-%{name}
268 Python 2 bindings for the QScintilla2 (PyQt5 version).
270 %description -n python-PyQt5-%{name} -l pl.UTF-8
271 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
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
280 %description -n python3-PyQt5-%{name}
281 Python 3 bindings for the QScintilla2 (PyQt5 version).
283 %description -n python3-PyQt5-%{name} -l pl.UTF-8
284 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
287 %setup -q -n QScintilla-gpl-%{version}
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
300 cd ../designer-Qt4Qt5
301 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
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 \
315 --apidir=%{_datadir}/${qt}/qsci \
322 PATH=%{_libdir}/${qt}/bin:$PATH \
323 %{__python3} ../../Python/configure.py \
328 --apidir=%{_datadir}/${qt}/qsci \
337 rm -rf $RPM_BUILD_ROOT
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
345 %{__make} -C build-${qt}/Python3 install \
346 INSTALL_ROOT=$RPM_BUILD_ROOT
349 %{__make} -C build-${qt}/Python2 install \
350 INSTALL_ROOT=$RPM_BUILD_ROOT
354 # unnecessary symlink
355 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.11.3
358 # move Qt4 translations to PLD-specific directory scheme
359 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
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
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
373 rm -rf $RPM_BUILD_ROOT
375 %post qt4 -p /sbin/ldconfig
376 %postun qt4 -p /sbin/ldconfig
378 %post qt5 -p /sbin/ldconfig
379 %postun qt5 -p /sbin/ldconfig
382 %defattr(644,root,root,755)
383 %doc doc/{Scintilla,html-Qt4Qt5}
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
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
412 %files -n QtDesigner-plugin-%{name}
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
416 %files -n sip-PyQt4-%{name}
417 %defattr(644,root,root,755)
418 %{_sipfilesdir}/PyQt4/Qsci
421 %files -n python-PyQt4-%{name}
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
427 %files -n python3-PyQt4-%{name}
428 %defattr(644,root,root,755)
429 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
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
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
456 %files -n Qt5Designer-plugin-%{name}
457 %defattr(644,root,root,755)
458 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
460 %files -n sip-PyQt5-%{name}
461 %defattr(644,root,root,755)
462 %{_sipfilesdir}/PyQt5/Qsci
465 %files -n python-PyQt5-%{name}
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
471 %files -n python3-PyQt5-%{name}
472 %defattr(644,root,root,755)
473 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so