]> git.pld-linux.org Git - packages/qscintilla2.git/blob - qscintilla2.spec
7573ba14740f1dc4017331705c074cf1e6396a62
[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 # - QScintilla2 for Qt5
7 #
8 # Conditonal build:
9 %bcond_without  python2 # CPython 2.x module
10 %bcond_without  python3 # CPython 3.x module
11 %bcond_without  qt4     # Qt4 library and modules
12 %bcond_without  qt5     # Qt5 library and modules
13
14 %define         scintilla_ver   3.3.6
15 %define         sip_ver         4.16
16 Summary:        QScintilla2 - a port to Qt of the Scintilla editing component
17 Summary(pl.UTF-8):      QScintilla2 - port komponentu edytora Scintilla dla biblioteki Qt
18 Name:           qscintilla2
19 Version:        2.8.4
20 Release:        1
21 License:        GPL v2 or GPL v3 with Riverbank GPL Exception v1.1
22 Group:          X11/Libraries
23 Source0:        http://downloads.sourceforge.net/pyqt/QScintilla-gpl-%{version}.tar.gz
24 # Source0-md5:  28aec903ff48ae541295a4fb9c96f8ea
25 Patch0:         %{name}-internal_build.patch
26 Patch1:         %{name}-multiqt.patch
27 Patch2:         %{name}-make.patch
28 Patch3:         %{name}-outoftree.patch
29 URL:            http://www.riverbankcomputing.co.uk/software/qscintilla/
30 %if %{with python2}
31 BuildRequires:  python-PyQt4-devel >= 4.8.2
32 BuildRequires:  python-sip-devel >= 2:%{sip_ver}
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-PyQt4-devel >= 4.8.2
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:  qt4-build >= 4.8
44 BuildRequires:  qt4-qmake >= 4.8
45 %endif
46 %if %{with qt5}
47 BuildRequires:  Qt5Designer-devel >= 5
48 BuildRequires:  Qt5Gui-devel >= 5
49 BuildRequires:  qt5-build >= 5
50 BuildRequires:  qt5-qmake >= 5
51 %endif
52 BuildConflicts: qscintilla2-devel
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %define         _sipfilesdir    %{_datadir}/sip
56
57 %description
58 QScintilla2 is a port to Qt of the Scintilla editing component.
59 This version of QScintilla is based on Scintilla v%{scintilla_ver}.
60
61 %description -l pl.UTF-8
62 QScintilla2 to port komponentu edytora Scintilla dla biblioteki Qt.
63 Ta wersja QScintilli jest oparta na Scintilli %{scintilla_ver}.
64
65 %package devel
66 Summary:        Development files for the QScintilla2
67 Summary(pl.UTF-8):      Pliki nagłówkowe dla komponentu QScintilla2
68 Group:          X11/Development/Libraries
69 Requires:       %{name} = %{version}-%{release}
70 Requires:       QtGui-devel
71
72 %description devel
73 This package contains the header files necessary to develop
74 applications using QScintilla2.
75
76 %description devel -l pl.UTF-8
77 Ten pakiet zawiera pliki nagłówkowe potrzebne do tworzenia programów z
78 użyciem komponentu QScintilla2.
79
80 %package -n QtDesigner-plugin-%{name}
81 Summary:        QScintilla2 plugin for Qt Designer
82 Summary(pl.UTF-8):      Wtyczka QScintilla2 dla Qt Designera
83 Group:          X11/Development/Libraries
84 Requires:       %{name} = %{version}-%{release}
85 Requires:       QtDesigner
86
87 %description -n QtDesigner-plugin-%{name}
88 QScintilla2 plugin for Qt Designer that allows QScintilla instances
89 to be included in GUI designs just like any other Qt widget.
90
91 %description -n QtDesigner-plugin-%{name} -l pl.UTF-8
92 Wtyczka WScintilla2 dla Qt Designera pozwalająca na włączanie
93 instancji QScintilli w projekty GUI w ten sam sposób, co inne widgety
94 Qt.
95
96 %package -n python-%{name}
97 Summary:        Python bindings for the QScintilla2
98 Summary(pl.UTF-8):      Wiązania Pythona dla komponentu QScintilla2
99 Group:          Libraries/Python
100 Requires:       %{name} = %{version}-%{release}
101 %requires_ge    python-PyQt4
102
103 %description -n python-%{name}
104 Python bindings for the QScintilla2.
105
106 %description -n python-%{name} -l pl.UTF-8
107 Wiązania Pythona dla komponentu QScintilla2.
108
109 %package -n python-%{name}-devel
110 Summary:        Python bindings for the QScintilla2 - development files
111 Summary(pl.UTF-8):      Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne
112 Group:          Development/Languages/Python
113 Requires:       python-%{name} = %{version}-%{release}
114 Requires:       python-PyQt4-devel >= 4.8.2
115
116 %description -n python-%{name}-devel
117 Python bindings for the QScintilla2 - development files.
118
119 %description -n python-%{name}-devel -l pl.UTF-8
120 Wiązania Pythona dla komponentu QScintilla2 - pliki programistyczne.
121
122 %prep
123 %setup -q -n QScintilla-gpl-%{version}
124 %patch0 -p1
125 %patch1 -p1
126 %patch2 -p1
127 %patch3 -p1
128
129 %build
130 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
131 install -d build-${qt}/{Qt4Qt5,designer-Qt4Qt5,Python2,Python3}
132 cd build-${qt}/Qt4Qt5
133 qmake-${qt} ../../Qt4Qt5/qscintilla.pro
134 %{__make}
135 cd ../designer-Qt4Qt5
136 qmake-${qt} ../../designer-Qt4Qt5/designer.pro
137 %{__make}
138 cd ..
139
140 %if %{with python2}
141 cd Python2
142 # setup PATH to get proper qmake
143 # pass --apidir because configure.py default is inconsistent with sources (no /qsci subdir)
144 PATH=%{_libdir}/${qt}/bin:$PATH \
145 %{__python} ../../Python/configure.py \
146         --verbose \
147         -c -j 3 \
148         -n ../../Qt4Qt5 \
149         -o ../Qt4Qt5 \
150         --apidir=%{_datadir}/${qt}/qsci
151 %{__make}
152 cd ..
153 %endif
154 %if %{with python3}
155 cd Python3
156 PATH=%{_libdir}/${qt}/bin:$PATH \
157 %{__python3} ../../Python/configure.py \
158         --verbose \
159         -c -j 3 \
160         -n ../../Qt4Qt5 \
161         -o ../Qt4Qt5 \
162         --apidir=%{_datadir}/${qt}/qsci
163 %{__make}
164 cd ..
165 %endif
166 cd ..
167 done
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171 #install -d $RPM_BUILD_ROOT%{_datadir}/qt5/qsci/api
172
173 for qt in %{?with_qt4:qt4} %{?with_qt5:qt5} ; do
174 %{__make} -C build-${qt}/Qt4Qt5 install \
175         INSTALL_ROOT=$RPM_BUILD_ROOT
176 %{__make} -C build-${qt}/designer-Qt4Qt5 install \
177         INSTALL_ROOT=$RPM_BUILD_ROOT
178 %if %{with python3}
179 %{__make} -C build-${qt}/Python3 install \
180         INSTALL_ROOT=$RPM_BUILD_ROOT
181 %endif
182 %if %{with python2}
183 %{__make} -C build-${qt}/Python2 install \
184         INSTALL_ROOT=$RPM_BUILD_ROOT
185 %endif
186 done
187
188 for file in $RPM_BUILD_ROOT%{_datadir}/locale/*.qm
189 do
190         lang=`echo $file | sed -r 's:.*/[a-zA-Z]*_(.*).qm:\1:'`
191         [ "$lang" == "pt_br" ] && lang=pt_BR
192         install -d $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES
193         mv -f $file $RPM_BUILD_ROOT%{_datadir}/locale/$lang/LC_MESSAGES/qscintilla2.qm
194 done
195
196 # unnecessary symlink
197 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libqscintilla2.so.11.3
198
199 %clean
200 rm -rf $RPM_BUILD_ROOT
201
202 %post   -p /sbin/ldconfig
203 %postun -p /sbin/ldconfig
204
205 %files
206 %defattr(644,root,root,755)
207 %doc GPL_EXCEPTION.TXT NEWS OPENSOURCE-NOTICE.TXT README
208 %attr(755,root,root) %{_libdir}/libqscintilla2.so.*.*.*
209 %attr(755,root,root) %ghost %{_libdir}/libqscintilla2.so.11
210 %lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/qscintilla2.qm
211 %lang(de) %{_datadir}/locale/de/LC_MESSAGES/qscintilla2.qm
212 %lang(es) %{_datadir}/locale/es/LC_MESSAGES/qscintilla2.qm
213 %lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/qscintilla2.qm
214 %lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/qscintilla2.qm
215 %dir %{_datadir}/qt4/qsci
216 %dir %{_datadir}/qt4/qsci/api
217 %dir %{_datadir}/qt5/qsci
218 %dir %{_datadir}/qt5/qsci/api
219
220 %files devel
221 %defattr(644,root,root,755)
222 %doc doc/Scintilla/*
223 %attr(755,root,root) %{_libdir}/libqscintilla2.so
224 %{_includedir}/qt4/Qsci
225 %{_datadir}/qt4/mkspecs/features/qscintilla2.prf
226
227 %files -n QtDesigner-plugin-%{name}
228 %defattr(644,root,root,755)
229 %attr(755,root,root) %{_libdir}/qt4/plugins/designer/libqscintillaplugin.so
230
231 %files -n python-%{name}
232 %defattr(644,root,root,755)
233 %attr(755,root,root) %{py_sitedir}/PyQt4/Qsci.so
234 %dir %{_datadir}/qt4/qsci/api/python
235 %{_datadir}/qt4/qsci/api/python/Python-*.api
236 %{_datadir}/qt4/qsci/api/python/QScintilla2.api
237
238 %files -n python-%{name}-devel
239 %defattr(644,root,root,755)
240 %{_sipfilesdir}/PyQt4/Qsci
This page took 0.093908 seconds and 2 git commands to generate.