]> git.pld-linux.org Git - packages/qscintilla2.git/blob - qscintilla2.spec
3c06a9c8d136f2fd1c1efa8f1a124cb014f81a78
[packages/qscintilla2.git] / qscintilla2.spec
1 #
2 # TODO:
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?)
6 #
7 # Conditonal build:
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
12
13 %define         scintilla_ver   3.3.6
14 %define         sip_ver         4.16
15 %define         pyqt4_ver       4.8.2
16 %define         pyqt5_ver       5.0
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
19 Name:           qscintilla2
20 Version:        2.8.4
21 Release:        2
22 License:        GPL v2 or GPL v3 with Riverbank GPL Exception v1.1
23 Group:          X11/Libraries
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/
33 %if %{with python2}
34 BuildRequires:  python-sip-devel >= 2:%{sip_ver}
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3-sip-devel >= 2:%{sip_ver}
38 %endif
39 BuildRequires:  rpm-pythonprov
40 BuildRequires:  rpmbuild(macros) >= 1.558
41 %if %{with qt4}
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}
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:  Qt5Widgets-devel >= 5
59 BuildRequires:  qt5-build >= 5
60 BuildRequires:  qt5-qmake >= 5
61 BuildRequires:  sip-PyQt5 >= %{pyqt5_ver}
62 %if %{with python2}
63 BuildRequires:  python-PyQt5 >= %{pyqt5_ver}
64 %endif
65 %if %{with python3}
66 BuildRequires:  python3-PyQt5 >= %{pyqt5_ver}
67 %endif
68 %endif
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)
73
74 %define         _sipfilesdir    %{_datadir}/sip
75
76 %description
77 QScintilla2 is a port to Qt of the Scintilla editing component.
78 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
79
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}.
83
84 %package apidocs
85 Summary:        QScintilla2 API documentation
86 Summary(pl.UTF-8):      Dokumentacja API biblioteki QScintilla2
87 Group:          Documentation
88
89 %description apidocs
90 QScintilla2 API documentation.
91
92 %description apidocs -l pl.UTF-8
93 Dokumentacja API biblioteki QScintilla2.
94
95 %package qt4
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
98 Group:          X11/Libraries
99 %ifarch %{x8664} ppc64 s390x sparc64
100 Provides:       libqscintilla2.so.11()(64bit)
101 %else
102 Provides:       libqscintilla2.so.11
103 %endif
104 Obsoletes:      qscintilla2 < 2.8.4
105
106 %description qt4
107 QScintilla2 is a port to Qt of the Scintilla editing component.
108 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
109
110 This package contains the Qt 4 port.
111
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}.
115
116 Ten pakiet zawiera port Qt 4.
117
118 %package qt4-devel
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
125
126 %description qt4-devel
127 This package contains the header files necessary to develop
128 applications using QScintilla2 for Qt 4.
129
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.
133
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
140
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.
144
145 This package contains the Qt 4 version.
146
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
150 Qt.
151
152 Ten pakiet zawiera wersję dla Qt 4.
153
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
160
161 %description -n sip-PyQt4-%{name}
162 Python bindings for the QScintilla2 - SIP development files.
163
164 %description -n sip-PyQt4-%{name} -l pl.UTF-8
165 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
166 SIP.
167
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
175
176 %description -n python-PyQt4-%{name}
177 Python 2 bindings for the QScintilla2 (PyQt4 version).
178
179 %description -n python-PyQt4-%{name} -l pl.UTF-8
180 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
181
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
188
189 %description -n python3-PyQt4-%{name}
190 Python 3 bindings for the QScintilla2 (PyQt4 version).
191
192 %description -n python3-PyQt4-%{name} -l pl.UTF-8
193 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
194
195 %package qt5
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
198 Group:          X11/Libraries
199
200 %description qt5
201 QScintilla2 is a port to Qt of the Scintilla editing component.
202 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
203
204 This package contains the Qt 5 port.
205
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}.
209
210 Ten pakiet zawiera port Qt 5.
211
212 %package qt5-devel
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
219
220 %description qt5-devel
221 This package contains the header files necessary to develop
222 applications using QScintilla2 for Qt 5.
223
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.
227
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
234
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.
238
239 This package contains the Qt 5 version.
240
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
244 Qt.
245
246 Ten pakiet zawiera wersję dla Qt 5.
247
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}
253
254 %description -n sip-PyQt5-%{name}
255 Python bindings for the QScintilla2 - SIP development files.
256
257 %description -n sip-PyQt5-%{name} -l pl.UTF-8
258 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
259 SIP.
260
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
267
268 %description -n python-PyQt5-%{name}
269 Python 2 bindings for the QScintilla2 (PyQt5 version).
270
271 %description -n python-PyQt5-%{name} -l pl.UTF-8
272 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
273
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
280
281 %description -n python3-PyQt5-%{name}
282 Python 3 bindings for the QScintilla2 (PyQt5 version).
283
284 %description -n python3-PyQt5-%{name} -l pl.UTF-8
285 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
286
287 %prep
288 %setup -q -n QScintilla-gpl-%{version}
289 %patch0 -p1
290 %patch1 -p1
291 %patch2 -p1
292 %patch3 -p1
293 %patch4 -p1
294 %patch5 -p1
295
296 %build
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)
302 %{__make}
303 cd ../designer-Qt4Qt5
304 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
305 %{__make}
306 cd ..
307
308 %if %{with python2}
309 cd Python2
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 \
314         --verbose \
315         -c -j 3 \
316         -n ../../Qt4Qt5 \
317         -o ../Qt4Qt5 \
318         --apidir=%{_datadir}/${qt}/qsci \
319         --pyqt=PyQt${qt#qt}
320 %{__make}
321 cd ..
322 %endif
323 %if %{with python3}
324 cd Python3
325 PATH=%{_libdir}/${qt}/bin:$PATH \
326 %{__python3} ../../Python/configure.py \
327         --verbose \
328         -c -j 3 \
329         -n ../../Qt4Qt5 \
330         -o ../Qt4Qt5 \
331         --apidir=%{_datadir}/${qt}/qsci \
332         --pyqt=PyQt${qt#qt}
333 %{__make}
334 cd ..
335 %endif
336 cd ..
337 done
338
339 %install
340 rm -rf $RPM_BUILD_ROOT
341
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
347 %if %{with python3}
348 %{__make} -C build-${qt}/Python3 install \
349         INSTALL_ROOT=$RPM_BUILD_ROOT
350 %endif
351 %if %{with python2}
352 %{__make} -C build-${qt}/Python2 install \
353         INSTALL_ROOT=$RPM_BUILD_ROOT
354 %endif
355 done
356
357 # unnecessary symlink
358 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.11.3
359
360 %if %{with qt4}
361 # move Qt4 translations to PLD-specific directory scheme
362 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
363 do
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
368 done
369
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
373 %endif
374
375 %clean
376 rm -rf $RPM_BUILD_ROOT
377
378 %post   qt4 -p /sbin/ldconfig
379 %postun qt4 -p /sbin/ldconfig
380
381 %post   qt5 -p /sbin/ldconfig
382 %postun qt5 -p /sbin/ldconfig
383
384 %files apidocs
385 %defattr(644,root,root,755)
386 %doc doc/{Scintilla,html-Qt4Qt5}
387
388 %if %{with qt4}
389 %files qt4
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
406
407 %files qt4-devel
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
414
415 %files -n QtDesigner-plugin-%{name}
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
418
419 %files -n sip-PyQt4-%{name}
420 %defattr(644,root,root,755)
421 %{_sipfilesdir}/PyQt4/Qsci
422
423 %if %{with python2}
424 %files -n python-PyQt4-%{name}
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
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 %endif
434 %endif
435
436 %if %{with qt5}
437 %files qt5
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
452
453 %files qt5-devel
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
458
459 %files -n Qt5Designer-plugin-%{name}
460 %defattr(644,root,root,755)
461 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
462
463 %files -n sip-PyQt5-%{name}
464 %defattr(644,root,root,755)
465 %{_sipfilesdir}/PyQt5/Qsci
466
467 %if %{with python2}
468 %files -n python-PyQt5-%{name}
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
471 %endif
472
473 %if %{with python3}
474 %files -n python3-PyQt5-%{name}
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so
477 %endif
478 %endif
This page took 0.082064 seconds and 2 git commands to generate.