]> git.pld-linux.org Git - packages/qscintilla2.git/blob - qscintilla2.spec
05bb2db2d310c5726cc2ca09f9e2af45a765899d
[packages/qscintilla2.git] / qscintilla2.spec
1 # TODO:
2 # - fix building with qscintilla2(-devel) installed, remove BC
3 #   - how to successfully prepend -I../Qt4Qt5 before system qt include in qmake?
4 #
5 # Conditonal build:
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
11 %define         scintilla_ver   3.3.6
12 %define         sip_ver         4.19
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
17 Name:           qscintilla2
18 Version:        2.11.2
19 Release:        3
20 License:        GPL v3
21 Group:          X11/Libraries
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/
32 %if %{with python2}
33 BuildRequires:  python-sip-devel >= 2:%{sip_ver}
34 %endif
35 %if %{with python3}
36 BuildRequires:  python3-sip-devel >= 2:%{sip_ver}
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.558
40 %if %{with qt4}
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}
47 %if %{with python2}
48 BuildRequires:  python-PyQt4 >= %{pyqt4_ver}
49 %endif
50 %if %{with python3}
51 BuildRequires:  python3-PyQt4 >= %{pyqt4_ver}
52 %endif
53 %endif
54 %if %{with qt5}
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}
63 %if %{with python2}
64 BuildRequires:  python-PyQt5 >= %{pyqt5_ver}
65 %endif
66 %if %{with python3}
67 BuildRequires:  python3-PyQt5 >= %{pyqt5_ver}
68 %endif
69 %endif
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)
74
75 %define         _sipfilesdir    %{_datadir}/sip
76
77 %description
78 QScintilla2 is a port to Qt of the Scintilla editing component.
79 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
80
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}.
84
85 %package apidocs
86 Summary:        QScintilla2 API documentation
87 Summary(pl.UTF-8):      Dokumentacja API biblioteki QScintilla2
88 Group:          Documentation
89 BuildArch:      noarch
90
91 %description apidocs
92 QScintilla2 API documentation.
93
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API biblioteki QScintilla2.
96
97 %package qt4
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
100 Group:          X11/Libraries
101 %ifarch %{x8664} ppc64 s390x sparc64
102 Provides:       libqscintilla2.so.11()(64bit)
103 %else
104 Provides:       libqscintilla2.so.11
105 %endif
106 Obsoletes:      qscintilla2 < 2.8.4
107
108 %description qt4
109 QScintilla2 is a port to Qt of the Scintilla editing component.
110 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
111
112 This package contains the Qt 4 port.
113
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}.
117
118 Ten pakiet zawiera port Qt 4.
119
120 %package qt4-devel
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
127
128 %description qt4-devel
129 This package contains the header files necessary to develop
130 applications using QScintilla2 for Qt 4.
131
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.
135
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
142
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.
146
147 This package contains the Qt 4 version.
148
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
152 Qt.
153
154 Ten pakiet zawiera wersję dla Qt 4.
155
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
162
163 %description -n sip-PyQt4-%{name}
164 Python bindings for the QScintilla2 - SIP development files.
165
166 %description -n sip-PyQt4-%{name} -l pl.UTF-8
167 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
168 SIP.
169
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
177
178 %description -n python-PyQt4-%{name}
179 Python 2 bindings for the QScintilla2 (PyQt4 version).
180
181 %description -n python-PyQt4-%{name} -l pl.UTF-8
182 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
183
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
190
191 %description -n python3-PyQt4-%{name}
192 Python 3 bindings for the QScintilla2 (PyQt4 version).
193
194 %description -n python3-PyQt4-%{name} -l pl.UTF-8
195 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
196
197 %package qt5
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
200 Group:          X11/Libraries
201
202 %description qt5
203 QScintilla2 is a port to Qt of the Scintilla editing component.
204 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
205
206 This package contains the Qt 5 port.
207
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}.
211
212 Ten pakiet zawiera port Qt 5.
213
214 %package qt5-devel
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
221
222 %description qt5-devel
223 This package contains the header files necessary to develop
224 applications using QScintilla2 for Qt 5.
225
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.
229
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
236
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.
240
241 This package contains the Qt 5 version.
242
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
246 Qt.
247
248 Ten pakiet zawiera wersję dla Qt 5.
249
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}
255
256 %description -n sip-PyQt5-%{name}
257 Python bindings for the QScintilla2 - SIP development files.
258
259 %description -n sip-PyQt5-%{name} -l pl.UTF-8
260 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
261 SIP.
262
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
269
270 %description -n python-PyQt5-%{name}
271 Python 2 bindings for the QScintilla2 (PyQt5 version).
272
273 %description -n python-PyQt5-%{name} -l pl.UTF-8
274 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
275
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
282
283 %description -n python3-PyQt5-%{name}
284 Python 3 bindings for the QScintilla2 (PyQt5 version).
285
286 %description -n python3-PyQt5-%{name} -l pl.UTF-8
287 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
288
289 %prep
290 %setup -q -n QScintilla_gpl-%{version}
291 %patch0 -p1
292 %patch3 -p1
293 %patch4 -p1
294 %patch5 -p1
295 %patch6 -p1
296 %patch7 -p1
297 %patch8 -p1
298
299 %build
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)
305 %{__make}
306 cd ../designer-Qt4Qt5
307 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
308 %{__make}
309 cd ..
310
311 %if %{with python2}
312 cd Python2
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 \
317         --verbose \
318         --concatenate \
319         --concatenate-split 3 \
320         -n ../../Qt4Qt5 \
321         -o ../Qt4Qt5 \
322         --apidir=%{_datadir}/${qt}/qsci \
323         --pyqt=PyQt${qt#qt}
324 %{__make}
325 cd ..
326 %endif
327 %if %{with python3}
328 cd Python3
329 PATH=%{_libdir}/${qt}/bin:$PATH \
330 %{__python3} ../../Python/configure.py \
331         --verbose \
332         --concatenate \
333         --concatenate-split 3 \
334         -n ../../Qt4Qt5 \
335         -o ../Qt4Qt5 \
336         --apidir=%{_datadir}/${qt}/qsci \
337         --pyqt=PyQt${qt#qt}
338 %{__make}
339 cd ..
340 %endif
341 cd ..
342 done
343
344 %install
345 rm -rf $RPM_BUILD_ROOT
346
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
352 %if %{with python3}
353 %{__make} -j1 -C build-${qt}/Python3 install \
354         INSTALL_ROOT=$RPM_BUILD_ROOT
355 %endif
356 %if %{with python2}
357 %{__make} -j1 -C build-${qt}/Python2 install \
358         INSTALL_ROOT=$RPM_BUILD_ROOT
359 %endif
360 done
361
362 # unnecessary symlink
363 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.15.0
364
365 %if %{with qt4}
366 # move Qt4 translations to PLD-specific directory scheme
367 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
368 do
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
373 done
374 %endif
375
376 %clean
377 rm -rf $RPM_BUILD_ROOT
378
379 %post   qt4 -p /sbin/ldconfig
380 %postun qt4 -p /sbin/ldconfig
381
382 %post   qt5 -p /sbin/ldconfig
383 %postun qt5 -p /sbin/ldconfig
384
385 %files apidocs
386 %defattr(644,root,root,755)
387 %doc doc/{Scintilla,html-Qt4Qt5}
388
389 %if %{with qt4}
390 %files qt4
391 %defattr(644,root,root,755)
392 %doc NEWS README
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
405
406 %files qt4-devel
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
411
412 %files -n QtDesigner-plugin-%{name}
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
415
416 %if %{with python2} || %{with python3}
417 %files -n sip-PyQt4-%{name}
418 %defattr(644,root,root,755)
419 %{_sipfilesdir}/PyQt4/Qsci
420 %endif
421
422 %if %{with python2}
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
427 %endif
428
429 %if %{with python3}
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
434 %endif
435 %endif
436
437 %if %{with qt5}
438 %files qt5
439 %defattr(644,root,root,755)
440 %doc NEWS README
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
453
454 %files qt5-devel
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
459
460 %files -n Qt5Designer-plugin-%{name}
461 %defattr(644,root,root,755)
462 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
463
464 %if %{with python2} || %{with python3}
465 %files -n sip-PyQt5-%{name}
466 %defattr(644,root,root,755)
467 %{_sipfilesdir}/PyQt5/Qsci
468 %endif
469
470 %if %{with python2}
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
475 %endif
476
477 %if %{with python3}
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
482 %endif
483 %endif
This page took 0.105499 seconds and 2 git commands to generate.