]> git.pld-linux.org Git - packages/qscintilla2.git/blob - qscintilla2.spec
39040f7f61d5c5b76e30220bcd405c0736e42275
[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.9.1
21 Release:        2
22 License:        GPL v3
23 Group:          X11/Libraries
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/
34 %if %{with python2}
35 BuildRequires:  python-sip-devel >= 2:%{sip_ver}
36 %endif
37 %if %{with python3}
38 BuildRequires:  python3-sip-devel >= 2:%{sip_ver}
39 %endif
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  rpmbuild(macros) >= 1.558
42 %if %{with qt4}
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}
48 %if %{with python2}
49 BuildRequires:  python-PyQt4 >= %{pyqt4_ver}
50 %endif
51 %if %{with python3}
52 BuildRequires:  python3-PyQt4 >= %{pyqt4_ver}
53 %endif
54 %endif
55 %if %{with qt5}
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}
64 %if %{with python2}
65 BuildRequires:  python-PyQt5 >= %{pyqt5_ver}
66 %endif
67 %if %{with python3}
68 BuildRequires:  python3-PyQt5 >= %{pyqt5_ver}
69 %endif
70 %endif
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)
75
76 %define         _sipfilesdir    %{_datadir}/sip
77
78 %description
79 QScintilla2 is a port to Qt of the Scintilla editing component.
80 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
81
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}.
85
86 %package apidocs
87 Summary:        QScintilla2 API documentation
88 Summary(pl.UTF-8):      Dokumentacja API biblioteki QScintilla2
89 Group:          Documentation
90 %if "%{_rpmversion}" >= "5"
91 BuildArch:      noarch
92 %endif
93
94 %description apidocs
95 QScintilla2 API documentation.
96
97 %description apidocs -l pl.UTF-8
98 Dokumentacja API biblioteki QScintilla2.
99
100 %package qt4
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
103 Group:          X11/Libraries
104 %ifarch %{x8664} ppc64 s390x sparc64
105 Provides:       libqscintilla2.so.11()(64bit)
106 %else
107 Provides:       libqscintilla2.so.11
108 %endif
109 Obsoletes:      qscintilla2 < 2.8.4
110
111 %description qt4
112 QScintilla2 is a port to Qt of the Scintilla editing component.
113 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
114
115 This package contains the Qt 4 port.
116
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}.
120
121 Ten pakiet zawiera port Qt 4.
122
123 %package qt4-devel
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
130
131 %description qt4-devel
132 This package contains the header files necessary to develop
133 applications using QScintilla2 for Qt 4.
134
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.
138
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
145
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.
149
150 This package contains the Qt 4 version.
151
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
155 Qt.
156
157 Ten pakiet zawiera wersję dla Qt 4.
158
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
165
166 %description -n sip-PyQt4-%{name}
167 Python bindings for the QScintilla2 - SIP development files.
168
169 %description -n sip-PyQt4-%{name} -l pl.UTF-8
170 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
171 SIP.
172
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
180
181 %description -n python-PyQt4-%{name}
182 Python 2 bindings for the QScintilla2 (PyQt4 version).
183
184 %description -n python-PyQt4-%{name} -l pl.UTF-8
185 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt4).
186
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
193
194 %description -n python3-PyQt4-%{name}
195 Python 3 bindings for the QScintilla2 (PyQt4 version).
196
197 %description -n python3-PyQt4-%{name} -l pl.UTF-8
198 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt4).
199
200 %package qt5
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
203 Group:          X11/Libraries
204
205 %description qt5
206 QScintilla2 is a port to Qt of the Scintilla editing component.
207 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
208
209 This package contains the Qt 5 port.
210
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}.
214
215 Ten pakiet zawiera port Qt 5.
216
217 %package qt5-devel
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
224
225 %description qt5-devel
226 This package contains the header files necessary to develop
227 applications using QScintilla2 for Qt 5.
228
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.
232
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
239
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.
243
244 This package contains the Qt 5 version.
245
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
249 Qt.
250
251 Ten pakiet zawiera wersję dla Qt 5.
252
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}
258
259 %description -n sip-PyQt5-%{name}
260 Python bindings for the QScintilla2 - SIP development files.
261
262 %description -n sip-PyQt5-%{name} -l pl.UTF-8
263 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
264 SIP.
265
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
272
273 %description -n python-PyQt5-%{name}
274 Python 2 bindings for the QScintilla2 (PyQt5 version).
275
276 %description -n python-PyQt5-%{name} -l pl.UTF-8
277 Wiązania Pythona 2 dla komponentu QScintilla2 (wersja dla PyQt5).
278
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
285
286 %description -n python3-PyQt5-%{name}
287 Python 3 bindings for the QScintilla2 (PyQt5 version).
288
289 %description -n python3-PyQt5-%{name} -l pl.UTF-8
290 Wiązania Pythona 3 dla komponentu QScintilla2 (wersja dla PyQt5).
291
292 %prep
293 %setup -q -n QScintilla-gpl-%{version}
294 %patch0 -p1
295 %patch1 -p1
296 %patch2 -p1
297 %patch3 -p1
298 %patch4 -p1
299 %patch5 -p1
300 %patch6 -p1
301
302 %build
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)
308 %{__make}
309 cd ../designer-Qt4Qt5
310 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
311 %{__make}
312 cd ..
313
314 %if %{with python2}
315 cd Python2
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 \
320         --verbose \
321         -c -j 3 \
322         -n ../../Qt4Qt5 \
323         -o ../Qt4Qt5 \
324         --apidir=%{_datadir}/${qt}/qsci \
325         --pyqt=PyQt${qt#qt}
326 %{__make}
327 cd ..
328 %endif
329 %if %{with python3}
330 cd Python3
331 PATH=%{_libdir}/${qt}/bin:$PATH \
332 %{__python3} ../../Python/configure.py \
333         --verbose \
334         -c -j 3 \
335         -n ../../Qt4Qt5 \
336         -o ../Qt4Qt5 \
337         --apidir=%{_datadir}/${qt}/qsci \
338         --pyqt=PyQt${qt#qt}
339 %{__make}
340 cd ..
341 %endif
342 cd ..
343 done
344
345 %install
346 rm -rf $RPM_BUILD_ROOT
347
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
353 %if %{with python3}
354 %{__make} -C build-${qt}/Python3 install \
355         INSTALL_ROOT=$RPM_BUILD_ROOT
356 %endif
357 %if %{with python2}
358 %{__make} -C build-${qt}/Python2 install \
359         INSTALL_ROOT=$RPM_BUILD_ROOT
360 %endif
361 done
362
363 # unnecessary symlink
364 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2*.so.12.0
365
366 %if %{with qt4}
367 # move Qt4 translations to PLD-specific directory scheme
368 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
369 do
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
374 done
375
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
379 %endif
380
381 %clean
382 rm -rf $RPM_BUILD_ROOT
383
384 %post   qt4 -p /sbin/ldconfig
385 %postun qt4 -p /sbin/ldconfig
386
387 %post   qt5 -p /sbin/ldconfig
388 %postun qt5 -p /sbin/ldconfig
389
390 %files apidocs
391 %defattr(644,root,root,755)
392 %doc doc/{Scintilla,html-Qt4Qt5}
393
394 %if %{with qt4}
395 %files qt4
396 %defattr(644,root,root,755)
397 %doc NEWS README
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
412
413 %files qt4-devel
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
420
421 %files -n QtDesigner-plugin-%{name}
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
424
425 %files -n sip-PyQt4-%{name}
426 %defattr(644,root,root,755)
427 %{_sipfilesdir}/PyQt4/Qsci
428
429 %if %{with python2}
430 %files -n python-PyQt4-%{name}
431 %defattr(644,root,root,755)
432 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
433 %endif
434
435 %if %{with python3}
436 %files -n python3-PyQt4-%{name}
437 %defattr(644,root,root,755)
438 %attr(755,root,root) %{py3_sitedir}/PyQt4/Qsci.so
439 %endif
440 %endif
441
442 %if %{with qt5}
443 %files qt5
444 %defattr(644,root,root,755)
445 %doc NEWS README
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
458
459 %files qt5-devel
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
464
465 %files -n Qt5Designer-plugin-%{name}
466 %defattr(644,root,root,755)
467 %attr(755,root,root) %{_libdir}/qt5/plugins/designer/libqscintillaplugin.so
468
469 %files -n sip-PyQt5-%{name}
470 %defattr(644,root,root,755)
471 %{_sipfilesdir}/PyQt5/Qsci
472
473 %if %{with python2}
474 %files -n python-PyQt5-%{name}
475 %defattr(644,root,root,755)
476 %attr(755,root,root) %{py_sitedir}/PyQt5/Qsci.so
477 %endif
478
479 %if %{with python3}
480 %files -n python3-PyQt5-%{name}
481 %defattr(644,root,root,755)
482 %attr(755,root,root) %{py3_sitedir}/PyQt5/Qsci.so
483 %endif
484 %endif
This page took 0.148109 seconds and 2 git commands to generate.