source: packaging/qt.spec@ 1050

Last change on this file since 1050 was 1041, checked in by Dmitry A. Kuminov, 14 years ago

packaging: Added script to create ZIP distribution archives.

The old WPI stuff is oudated and moved to the "unsupported"
subdirectory.

File size: 10.6 KB
Line 
1#
2# http://svn.netlabs.org/qt4
3#
4
5%define test_mode 1
6
7%define ver_major 4
8%define ver_minore 7
9%define ver_patch 3
10
11%define rpm_release 1
12
13%define svn_revision 816
14
15%define descr_brief Qt is a software toolkit for developing applications.
16
17%define pkg_wps_base QT4
18%define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER>
19%define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Qt 4|<WP_DESKTOP>
20%define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
21
22%define qt_ qt
23%define qtM %{qt_}%{ver_major}
24
25%define qt_prefix %{_libdir}/%{qtM}
26%define qt_datadir %{_datadir}/%{qtM}
27%define qt_libdir %{_libdir}
28%define qt_headerdir %{_includedir}/%{qtM}
29%define qt_bindir %{qt_prefix}/bin
30%define qt_plugindir %{qt_prefix}/plugins
31%define qt_demosdir %{qt_prefix}/demos
32%define qt_examplesdir %{qt_prefix}/examples
33%define qt_docdir %{qt_datadir}/doc
34%define qt_translationdir %{qt_datadir}/translations
35%define qt_sysconfdir %{_sysconfdir}/xdg
36
37#------------------------------------------------------------------------------
38# main package
39#------------------------------------------------------------------------------
40
41Name: %{qt_}
42Summary: Qt runtime
43Group: System Environment/Libraries
44Version: %{ver_major}.%{ver_minore}.%{ver_patch}
45Release: %{rpm_release}
46Vendor: netlabs.org
47
48Provides: %{qtM} = %{version}-%{release}
49
50# @todo?
51#Requires: libc >= 0.6.3
52
53License: LGPLv2 with exceptions or GPLv3 with exceptions
54Url: http://www.qtsoftware.com/
55
56Source: qt.zip
57
58%description
59%{descr_brief}
60
61This package contains runtime Qt libraries for console applications, including
62core, network and XML modules.
63
64%files
65%defattr(-,root,root,-)
66%doc README
67%{_libdir}/QtCore%{ver_major}.dll
68
69%pre
70/*.cmd*/
71
72 packages.1 = 'netlabs.org\Qt4\Runtime'
73 packages.0 = 1
74
75 ver = ''
76 do i = 1 to packages.0
77 ver = GetPkgVersion(packages.i)
78 if (ver \== '') then leave
79 end
80 if (ver == '') then exit 0
81
82 say; say 'ERROR:'; say
83 say 'You have a WPI package "'packages.i'" version 'ver
84 say 'installed on your system.'; say
85 say 'You cannot have both the WPI and RPM package installed at the same time.'
86 say 'Please de-install the specified WPI package using the WarpIn utility'
87 say 'and try again.'; say
88 exit 1
89
90 GetPkgVersion: procedure
91 parse arg aPkgId
92 rc = rxFuncAdd('SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs')
93 rc = SysLoadFuncs()
94 WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x)
95 if (WarpInDir \== '') then do
96 rc = SysFileTree(WarpInDir'\DATBAS_?.INI', 'inis', 'FO')
97 if (rc == 0) then do
98 do i = 1 to inis.0
99 rc = SysIni(inis.i, 'ALL:', 'apps')
100 if (rc == '') then do
101 do j = 1 to apps.0
102 apps.j = strip(apps.j, 'T', '0'x)
103 if (left(apps.j, length(aPkgId)) == aPkgId) then do
104 /* found the app */
105 ver = right(apps.j, length(apps.j) - length(aPkgId) - 1)
106 ver = translate(ver, '.', '\')
107 return ver
108 end
109 end
110 end
111 else do
112 say; say 'ERROR:'; say
113 say 'Failed to access the file "'inis.i'".'; say
114 say 'Please close the WarpIn application or, if it is not running, make sure'
115 say 'that this file is not locked by another process and try again.'; say
116 exit 5
117 end
118 end
119 end
120 end
121 return ''
122
123%post
124
125%wps_object_create_begin
126%{pkg_wps_folder_create}
127#%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
128%wps_object_create_end
129
130%postun
131
132%wps_object_delete_all
133
134#------------------------------------------------------------------------------
135%package pm
136#------------------------------------------------------------------------------
137
138Summary: Qt GUI runtime
139Group: System Environment/Libraries
140
141Requires: %{qt_} = %{version}-%{release}
142
143Provides: %{qtM}-pm = %{version}-%{release}
144
145%description pm
146%{descr_brief}
147
148This package contains runtime Qt libraries for Presentation Manager GUI
149applications.
150
151%files pm
152%defattr(-,root,root,-)
153%{_libdir}/QtGui%{ver_major}.dll
154
155#------------------------------------------------------------------------------
156%package demos
157#------------------------------------------------------------------------------
158Summary: Demonstration applications for Qt
159Group: Documentation
160
161Requires: %{qt_}-pm = %{version}-%{release}
162
163Provides: %{qtM}-demos = %{version}-%{release}
164
165%description demos
166%{descr_brief}
167
168This package contains the demo Qt applications along with their source code.
169These applications demonstrate the possibilities of the Qt toolkit.
170
171%files demos
172%defattr(-,root,root,-)
173%{qt_bindir}/qtdemo.exe
174# @todo put shortcuts to /usr/bin
175#%if "%{qt_bindir}" != "%{_bindir}"
176#%{_bindir}/qtdemo.exe copied from launcher.exe
177#%endif
178%{qt_demosdir}/
179
180%post demos
181%wps_object_create_begin -n %{name}-demos
182%{wps_qt4_folder}
183QT4_DEMO:WPProgram|Examples and Demos|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/qtdemo.exe))
184%wps_object_create_end
185
186%postun demos
187%wps_object_delete_all -n %{name}-demos
188
189#------------------------------------------------------------------------------
190%package examples
191#------------------------------------------------------------------------------
192Summary: Programming examples for Qt
193Group: Documentation
194
195Requires: %{qt_}-pm = %{version}-%{release}
196
197Provides: %{qtM}-examples = %{version}-%{release}
198
199%description examples
200%{descr_brief}
201
202This package contains the sample Qt applications along with their source code.
203These applications are used to learn how to program with the Qt toolkit.
204
205%files examples
206%defattr(-,root,root,-)
207%{qt_examplesdir}/
208
209#------------------------------------------------------------------------------
210%package linguist
211#------------------------------------------------------------------------------
212Summary: Qt Linguist tool
213Group: Development/Tools
214
215Requires: %{qt_}-pm = %{version}-%{release}
216
217Provides: %{qtM}-linguist = %{version}-%{release}
218
219%description linguist
220%{descr_brief}
221
222This package contains the Qt Linguist tool used to edit the translation files
223for Qt applications.
224
225%files linguist
226%defattr(-,root,root,-)
227%{qt_bindir}/linguist.exe
228
229%post linguist
230%wps_object_create_begin -n %{name}-linguist
231%{wps_qt4_folder}
232QT4_LINGUIST:WPProgram|Linguist|<QT4_FOLDER>|EXENAME=((%{qt_bindir}/linguist.exe))
233%wps_object_create_end
234
235%postun linguist
236%wps_object_delete_all -n %{name}-linguist
237
238#------------------------------------------------------------------------------
239%package assistant
240#------------------------------------------------------------------------------
241Summary: Qt Assistant tool
242Group: Development/Tools
243
244Requires: %{qt_}-pm = %{version}-%{release}
245
246Provides: %{qtM}-assistant = %{version}-%{release}
247
248%description assistant
249%{descr_brief}
250
251This package contains the Qt Assistant tool used to read and search the Qt
252Toolkit reference documentation.
253
254%files assistant
255%defattr(-,root,root,-)
256%{qt_bindir}/assistant.exe
257
258#------------------------------------------------------------------------------
259%package doc
260#------------------------------------------------------------------------------
261Summary: API documentation for Qt
262Group: Documentation
263BuildArch: noarch
264
265Requires: %{qt_}-assistant = %{version}-%{release}
266
267Provides: %{qtM}-doc = %{version}-%{release}
268
269%description doc
270%{descr_brief}
271
272This package contains the Qt Toolkit reference documentation that provides the
273detailed description of all Qt classes and tools.
274
275%files doc
276%defattr(-,root,root,-)
277%{qt_docdir}/qch/*.qch
278
279# @todo assistant.exe -remove-search-index
280
281#------------------------------------------------------------------------------
282%package devel
283#------------------------------------------------------------------------------
284Summary: Development files for Qt
285Group: Development/Libraries
286
287Requires: %{qt_}-pm = %{version}-%{release}
288
289Provides: %{qt_}-designer = %{version}-%{release}
290
291Provides: %{qtM}-devel = %{version}-%{release}
292Provides: %{qtM}-designer = %{version}-%{release}
293
294%description devel
295%{descr_brief}
296
297This package contains the headers, libraries and tools necessary to develop
298applications using the Qt toolkit. Includes the Qt Designer tool.
299
300%files devel
301%defattr(-,root,root,-)
302%{qt_bindir}/designer.exe
303
304#------------------------------------------------------------------------------
305%prep
306#------------------------------------------------------------------------------
307
308%if 0%{?test_mode}
309%setup -TD
310%else
311%setup -q
312%endif
313
314#------------------------------------------------------------------------------
315%build
316#------------------------------------------------------------------------------
317
318#configure.cmd \
319# --official-build-quiet %{svn_revision} \
320# -prefix "%{qt_prefix}" \
321# -datadir "%{qt_datadir}" \
322# -libdir "%{qt_libdir}" \
323# -headerdir "%{qt_headerdir}" \
324# -bindir "%{qt_bindir}" \
325# -plugindir "%{qt_plugindir}" \
326# -demosdir "%{qt_demosdir}" \
327# -examplesdir "%{qt_examplesdir}" \
328# -docdir "%{qt_docdir}" \
329# -translationdir "%{qt_translationdir}" \
330# -sysconfdir "%{qt_sysconfdir}" \
331
332#------------------------------------------------------------------------------
333%install
334#------------------------------------------------------------------------------
335
336rm -rf %{buildroot}
337
338#make install INSTALL_ROOT=%{buildroot}
339
340mkdir -p %{buildroot}/%{qt_libdir}
341cp QtCore4.dll %{buildroot}/%{qt_libdir}/
342cp QtGui4.dll %{buildroot}/%{qt_libdir}/
343mkdir -p %{buildroot}/%{qt_bindir}
344cp qtdemo.exe %{buildroot}/%{qt_bindir}/
345cp designer.exe %{buildroot}/%{qt_bindir}/
346cp linguist.exe %{buildroot}/%{qt_bindir}/
347cp assistant.exe %{buildroot}/%{qt_bindir}/
348mkdir -p %{buildroot}/%{qt_demosdir}
349cp -R demos/* %{buildroot}/%{qt_demosdir}/
350mkdir -p %{buildroot}/%{qt_examplesdir}
351cp -R examples/* %{buildroot}/%{qt_examplesdir}/
352mkdir -p %{buildroot}/%{qt_docdir}
353cp -R doc/* %{buildroot}/%{qt_docdir}/
354
355#------------------------------------------------------------------------------
356%clean
357#------------------------------------------------------------------------------
358
359rm -rf %{buildroot}
360
361#------------------------------------------------------------------------------
362%changelog
363
364* Sun Oct 31 2010 Dmitry A. Kuminov <coding/dmik.org> - 4.6.3-1
365- test version
366
Note: See TracBrowser for help on using the repository browser.