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
24 Source0: http://downloads.sourceforge.net/pyqt/QScintilla-gpl-%{version}.tar.gz
25 # Source0-md5: 38e6248cb970adf6d05aea7d94f1288e
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}-link.patch
32 Patch6: python-install.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: qt4-build >= 4.8
46 BuildRequires: qt4-qmake >= 4.8
47 BuildRequires: sip-PyQt4 >= %{pyqt4_ver}
49 BuildRequires: python-PyQt4 >= %{pyqt4_ver}
52 BuildRequires: python3-PyQt4 >= %{pyqt4_ver}
56 BuildRequires: Qt5Designer-devel >= 5
57 BuildRequires: Qt5Gui-devel >= 5
58 BuildRequires: Qt5PrintSupport-devel >= 5
59 BuildRequires: Qt5UiTools-devel >= 5
60 BuildRequires: Qt5Widgets-devel >= 5
61 BuildRequires: qt5-build >= 5
62 BuildRequires: qt5-qmake >= 5
63 BuildRequires: sip-PyQt5 >= %{pyqt5_ver}
65 BuildRequires: python-PyQt5 >= %{pyqt5_ver}
68 BuildRequires: python3-PyQt5 >= %{pyqt5_ver}
71 BuildConflicts: qscintilla2-devel < %{version}
72 %{?with_qt4:BuildConflicts: qscintilla2-qt4-devel < %{version}}
73 %{?with_qt5:BuildConflicts: qscintilla2-qt5-devel < %{version}}
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 %define _sipfilesdir %{_datadir}/sip
79 QScintilla2 is a port to Qt of the Scintilla editing component.
80 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
82 %description -l pl.UTF-8
83 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
84 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
87 Summary: QScintilla2 API documentation
88 Summary(pl.UTF-8): Dokumentacja API biblioteki QScintilla2
90 %if "%{_rpmversion}" >= "5"
95 QScintilla2 API documentation.
97 %description apidocs -l pl.UTF-8
98 Dokumentacja API biblioteki QScintilla2.
101 Summary: QScintilla2 - a port to Qt 4 of the Scintilla editing component
102 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 4
104 %ifarch %{x8664} ppc64 s390x sparc64
105 Provides: libqscintilla2.so.11()(64bit)
107 Provides: libqscintilla2.so.11
109 Obsoletes: qscintilla2 < 2.8.4
112 QScintilla2 is a port to Qt of the Scintilla editing component.
113 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
115 This package contains the Qt 4 port.
117 %description qt4 -l pl.UTF-8
118 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
119 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
121 Ten pakiet zawiera port Qt 4.
124 Summary: Development files for the QScintilla2 Qt 4 library
125 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 4
126 Group: X11/Development/Libraries
127 Requires: %{name}-qt4 = %{version}-%{release}
128 Requires: QtGui-devel >= 4
129 Obsoletes: qscintilla2-devel < 2.8.4
131 %description qt4-devel
132 This package contains the header files necessary to develop
133 applications using QScintilla2 for Qt 4.
135 %description qt4-devel -l pl.UTF-8
136 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
137 użyciem komponentu QScintilla2 dla Qt 4.
139 %package -n QtDesigner-plugin-%{name}
140 Summary: QScintilla2 plugin for Qt Designer
141 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
142 Group: X11/Development/Libraries
143 Requires: %{name}-qt4 = %{version}-%{release}
144 Requires: QtDesigner >= 4
146 %description -n QtDesigner-plugin-%{name}
147 QScintilla2 plugin for Qt Designer that allows QScintilla instances
148 to be included in GUI designs just like any other Qt widget.
150 This package contains the Qt 4 version.
152 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
153 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
154 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
157 Ten pakiet zawiera wersję dla Qt 4.
159 %package -n sip-PyQt4-%{name}
160 Summary: Python bindings for the QScintilla2 - SIP development files
161 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
162 Group: Development/Languages/Python
163 Requires: sip-PyQt4 >= %{pyqt4_ver}
164 Obsoletes: python-qscintilla2-devel < 2.8.4
166 %description -n sip-PyQt4-%{name}
167 Python bindings for the QScintilla2 - SIP development files.
169 %description -n sip-PyQt4-%{name} -l pl.UTF-8
170 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
173 %package -n python-PyQt4-%{name}
174 Summary: Python 2 bindings for the QScintilla2 (PyQt4 version)
175 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4)
176 Group: Libraries/Python
177 Requires: %{name}-qt4 = %{version}-%{release}
178 %requires_ge python-PyQt4
179 Obsoletes: python-qscintilla2 < 2.8.4
181 %description -n python-PyQt4-%{name}
182 Python 2 bindings for the QScintilla2 (PyQt4 version).
184 %description -n python-PyQt4-%{name} -l pl.UTF-8
185 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
187 %package -n python3-PyQt4-%{name}
188 Summary: Python 3 bindings for the QScintilla2 (PyQt4 version)
189 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4)
190 Group: Libraries/Python
191 Requires: %{name}-qt4 = %{version}-%{release}
192 %requires_ge python3-PyQt4
194 %description -n python3-PyQt4-%{name}
195 Python 3 bindings for the QScintilla2 (PyQt4 version).
197 %description -n python3-PyQt4-%{name} -l pl.UTF-8
198 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
201 Summary: QScintilla2 - a port to Qt 5 of the Scintilla editing component
202 Summary(pl.UTF-8): QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt 5
206 QScintilla2 is a port to Qt of the Scintilla editing component.
207 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
209 This package contains the Qt 5 port.
211 %description qt5 -l pl.UTF-8
212 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
213 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
215 Ten pakiet zawiera port Qt 5.
218 Summary: Development files for the QScintilla2 Qt 5 library
219 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki QScintilla2 dla Qt 5
220 Group: X11/Development/Libraries
221 Requires: %{name}-qt5 = %{version}-%{release}
222 Requires: Qt5Gui-devel >= 5
223 Obsoletes: qscintilla2-devel < 2.8.4
225 %description qt5-devel
226 This package contains the header files necessary to develop
227 applications using QScintilla2 for Qt 5.
229 %description qt5-devel -l pl.UTF-8
230 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
231 użyciem komponentu QScintilla2 dla Qt 5.
233 %package -n Qt5Designer-plugin-%{name}
234 Summary: QScintilla2 plugin for Qt Designer
235 Summary(pl.UTF-8): Wtyczka QScintilla2 dla Qt Designera
236 Group: X11/Development/Libraries
237 Requires: %{name}-qt5 = %{version}-%{release}
238 Requires: Qt5Designer >= 5
240 %description -n Qt5Designer-plugin-%{name}
241 QScintilla2 plugin for Qt Designer that allows QScintilla instances
242 to be included in GUI designs just like any other Qt widget.
244 This package contains the Qt 5 version.
246 %description -n Qt5Designer-plugin-%{name} -l pl.UTF-8
247 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
248 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
251 Ten pakiet zawiera wersję dla Qt 5.
253 %package -n sip-PyQt5-%{name}
254 Summary: Python bindings for the QScintilla2 - SIP development files
255 Summary(pl.UTF-8): Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne SIP
256 Group: Development/Languages/Python
257 Requires: sip-PyQt5 >= %{pyqt5_ver}
259 %description -n sip-PyQt5-%{name}
260 Python bindings for the QScintilla2 - SIP development files.
262 %description -n sip-PyQt5-%{name} -l pl.UTF-8
263 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
266 %package -n python-PyQt5-%{name}
267 Summary: Python 2 bindings for the QScintilla2 (PyQt5 version)
268 Summary(pl.UTF-8): Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5)
269 Group: Libraries/Python
270 Requires: %{name}-qt5 = %{version}-%{release}
271 %requires_ge python-PyQt5
273 %description -n python-PyQt5-%{name}
274 Python 2 bindings for the QScintilla2 (PyQt5 version).
276 %description -n python-PyQt5-%{name} -l pl.UTF-8
277 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
279 %package -n python3-PyQt5-%{name}
280 Summary: Python 3 bindings for the QScintilla2 (PyQt5 version)
281 Summary(pl.UTF-8): Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5)
282 Group: Libraries/Python
283 Requires: %{name}-qt5 = %{version}-%{release}
284 %requires_ge python3-PyQt5
286 %description -n python3-PyQt5-%{name}
287 Python 3 bindings for the QScintilla2 (PyQt5 version).
289 %description -n python3-PyQt5-%{name} -l pl.UTF-8
290 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
293 %setup -q -n QScintilla-gpl-%{version}
303 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
304 install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
305 cd build-${qt}/Qt4Qt5
306 qmake-${qt} ../../Qt4Qt5/qscintilla.pro \
307 $(test "$qt" = "qt4" || echo QMAKE_MKSPECS=%{_libdir}/$qt/mkspecs)
309 cd ../designer-Qt4Qt5
310 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
316 # setup PATH to get proper qmake
317 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
318 PATH=%{_libdir}/${qt}/bin:$PATH \
319 %{__python} ../../Python/configure.py \
324 --apidir=%{_datadir}/${qt}/qsci \
331 PATH=%{_libdir}/${qt}/bin:$PATH \
332 %{__python3} ../../Python/configure.py \
337 --apidir=%{_datadir}/${qt}/qsci \
346 rm -rf $RPM_BUILD_ROOT
348 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
349 %{__make} -C build-${qt}/Qt4Qt5 install \
350 INSTALL_ROOT=$RPM_BUILD_ROOT
351 %{__make} -C build-${qt}/designer-Qt4Qt5 install \
352 INSTALL_ROOT=$RPM_BUILD_ROOT
354 %{__make} -C build-${qt}/Python3 install \
355 INSTALL_ROOT=$RPM_BUILD_ROOT
358 %{__make} -C build-${qt}/Python2 install \
359 INSTALL_ROOT=$RPM_BUILD_ROOT
363 # unnecessary symlink
364 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.12.0
367 # move Qt4 translations to PLD-specific directory scheme
368 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
370 lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
371 [ "$lang" == "pt_br" ] && lang=pt_BR
372 install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
373 %{__mv} $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
376 # compatibility symlinks
377 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11
378 ln -sf $(basename $RPM_BUILD_ROOT%{_libdir}/libqscintilla2-qt4.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so
382 rm -rf $RPM_BUILD_ROOT
384 %post qt4 -p /sbin/ldconfig
385 %postun qt4 -p /sbin/ldconfig
387 %post qt5 -p /sbin/ldconfig
388 %postun qt5 -p /sbin/ldconfig
391 %defattr(644,root,root,755)
392 %doc doc/{Scintilla,html-Qt4Qt5}
396 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so.*.*.*
399 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt4.so.12
400 # compatibility symlink
401 %attr(755,root,root) %{_libdir}/libqscintilla2.so.11
402 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
403 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
404 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
405 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
406 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
407 %dir %{_datadir}/qt4/qsci
408 %dir %{_datadir}/qt4/qsci/api
409 %dir %{_datadir}/qt4/qsci/api/python
410 %{_datadir}/qt4/qsci/api/python/Python-*.api
411 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
414 %defattr(644,root,root,755)
415 %attr(755,root,root) %{_libdir}/libqscintilla2-qt4.so
416 # compatibility symlink
417 %attr(755,root,root) %{_libdir}/libqscintilla2.so
418 %{_includedir}/qt4/Qsci
419 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
421 %files -n QtDesigner-plugin-%{name}
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
425 %files -n sip-PyQt4-%{name}
426 %defattr(644,root,root,755)
427 %{_sipfilesdir}/PyQt4/Qsci
430 %files -n python-PyQt4-%{name}
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
436 %files -n python3-PyQt4-%{name}
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
444 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so.*.*.*
447 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2-qt5.so.12
448 %lang(cs) %{_datadir}/qt5/translations/qscintilla_cs.qm
449 %lang(de) %{_datadir}/qt5/translations/qscintilla_de.qm
450 %lang(es) %{_datadir}/qt5/translations/qscintilla_es.qm
451 %lang(fr) %{_datadir}/qt5/translations/qscintilla_fr.qm
452 %lang(pt_BR) %{_datadir}/qt5/translations/qscintilla_pt_br.qm
453 %dir %{_datadir}/qt5/qsci
454 %dir %{_datadir}/qt5/qsci/api
455 %dir %{_datadir}/qt5/qsci/api/python
456 %{_datadir}/qt5/qsci/api/python/Python-*.api
457 %{_datadir}/qt5/qsci/api/python/QScintilla2.api
460 %defattr(644,root,root,755)
461 %attr(755,root,root) %{_libdir}/libqscintilla2-qt5.so
462 %{_includedir}/qt5/Qsci
463 %{_libdir}/qt5/mkspecs/features/qscintilla2.prf
465 %files -n Qt5Designer-plugin-%{name}
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
469 %files -n sip-PyQt5-%{name}
470 %defattr(644,root,root,755)
471 %{_sipfilesdir}/PyQt5/Qsci
474 %files -n python-PyQt5-%{name}
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
480 %files -n python3-PyQt5-%{name}
481 %defattr(644,root,root,755)
482 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so