source: trunk/tools/install/odin.spec@ 21684

Last change on this file since 21684 was 21680, checked in by dmik, 14 years ago

odin.spec: A lot of changes.

Split up to more independent packages, install to /usr/lib (so that no config.sys changes are necessary), store Windows directory (AppData, Desktop, My Documents, etc.) as well as Program Files in /var/lib/odin.

  • Property svn:eol-style set to native
File size: 12.1 KB
Line 
1#
2# http://svn.netlabs.org/odin32
3#
4%define test_mode 1
5
6%define ver_major 0
7%define ver_minor 1
8%define ver_patch 0
9
10%define rpm_release 1
11
12Name: odin
13Vendor: netlabs.org
14License: Project Odin Software License
15Url: http://svn.netlabs.org/odin32/
16
17Version: %{ver_major}.%{ver_minor}.%{ver_patch}
18Release: %{rpm_release}
19
20Source: %{name}-%{version}.zip
21
22%define descr_brief Odin is a set of libraries that provide a Win32-compatible runtime environment.\
23This environment is necesasry to run Win32 applications on OS/2 as well as\
24native OS/2 applications built from Win32 sources using Odin SDK.
25
26%define pkg_docdir %{_docdir}/%{name}
27
28%define pkg_wps_base ODIN
29%define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER>
30%define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Odin|<WP_DESKTOP>
31%define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
32%define pkg_wps_view_inf() EXENAME=view.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
33
34#------------------------------------------------------------------------------
35# commons
36#------------------------------------------------------------------------------
37
38# installation paths
39%define odin_libdir %{_libdir}
40%define odin_bindir %{_bindir}
41%define odin_systemdir %{odin_libdir}
42%define odin_windowsdir %{_var}/lib/odin
43
44# disable lxlite compression (this causes problems for some DLLs)
45%define __os_install_post %{nil}
46
47#------------------------------------------------------------------------------
48# main package
49#------------------------------------------------------------------------------
50
51Summary: Odin (dummy)
52Group: System Environment/Libraries
53
54%description
55%{descr_brief}
56
57This package is not actually generated (due to the missing %files section).
58It is present only because RPM requires Summary: and %description sections for
59the main package to exist.
60
61#------------------------------------------------------------------------------
62%package -n lib%{name}
63#------------------------------------------------------------------------------
64
65Summary: Odin runtime
66Group: System Environment/Libraries
67
68%description -n lib%{name}
69%{descr_brief}
70
71This package contains core Odin runtime libraries.
72
73%files -n lib%{name}
74%defattr(-,root,root,-)
75%doc %{pkg_docdir}/
76%exclude %{pkg_docdir}/odinuser.inf
77%if "%{odin_libdir}" != "%{_libdir}"
78%dir %{odin_libdir}/
79%endif
80%if "%{odin_bindir}" != "%{_bindir}"
81%{odin_bindir}/
82%else
83%{odin_bindir}/*.exe
84%endif
85%exclude %{odin_bindir}/pe.exe
86%exclude %{odin_bindir}/pec.exe
87%exclude %{odin_bindir}/xx2lx.exe
88%if "%{odin_systemdir}" != "%{odin_libdir}"
89%{odin_systemdir}/
90%else
91%{odin_systemdir}/*
92%endif
93%exclude %{odin_systemdir}/capi2032.dll
94%exclude %{odin_systemdir}/secur32.dll
95%exclude %{odin_systemdir}/schannel.dll
96%exclude %{odin_systemdir}/win32k.sys
97%exclude %{odin_systemdir}/win32kCC.exe
98%exclude %{odin_systemdir}/kRx.exe
99# files/directories generated by odininst.exe removed on uninstall
100%attr(0755,root,root) %ghost %{odin_systemdir}/Drivers/
101%attr(0755,root,root) %ghost %{odin_systemdir}/Drivers/etc/
102%attr(0644,root,root) %ghost %{odin_systemdir}/ODIN.INI
103# files/directories generated by odininst.exe preserved on uninstall
104%attr(0755,root,root) %ghost %config %{odin_windowsdir}/
105
106%pre -n lib%{name}
107%warpin_conflicts_begin
108Odin\Odin\Odin Core Files
109Odin\Odin\Odin System Files
110Odin\Odin\Odin .sym files
111Odin\Odin\Changes to Config.sys
112%warpin_conflicts_end
113
114%post -n lib%{name}
115
116CFGSYS_CHANGED=
117%if "%{odin_systemdir}" != "%{_libdir}"
118export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
119%cube {ADDSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST AFTER} %{os2_config_sys} >nul
120CFGSYS_CHANGED=y
121%endif
122%if "%{odin_bindir}" != "%{_bindir}"
123export ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
124%cube {ADDSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST AFTER} %{os2_config_sys} >nul
125%endif
126if [ -n "$CFGSYS_CHANGED" ]; then
127 echo; echo "NOTE:"
128 echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
129 echo "computer in order to activate these changes."
130 echo
131fi
132
133#initialize system directories, registry and INI files
134ODIN_WINDOWSDIR_D=$(echo "%{odin_windowsdir}" | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')
135echo \
136"[DEVDIRECTORIES]
137WINDOWS=$ODIN_WINDOWSDIR_D
138" \
139> "%{odin_systemdir}/ODIN.INI"
140# mkdir -p fails on /@unixroot, replace it with the real value
141mkdir -p "$(echo %{odin_windowsdir} | sed -re 's,/@unixroot,'$UNIXROOT',g')"
142(cd "%{odin_systemdir}/"; "%{odin_systemdir}"/odininst.exe)
143
144%postun -n lib%{name}
145
146CFGSYS_CHANGED=
147%if "%{odin_bindir}" != "%{_bindir}"
148export ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
149%cube {DELSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST} %{os2_config_sys} >nul
150CFGSYS_CHANGED=y
151%endif
152%if "%{odin_systemdir}" != "%{_libdir}"
153export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
154%cube {DELSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST} %{os2_config_sys} >nul
155%endif
156if [ -n "$CFGSYS_CHANGED" ]; then
157 echo; echo "NOTE:"
158 echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
159 echo "computer in order to activate these changes."
160 echo
161fi
162
163#------------------------------------------------------------------------------
164%package -n lib%{name}-capi20
165#------------------------------------------------------------------------------
166
167Summary: Odin CAPI 2.0 library
168Group: System Environment/Libraries
169
170Requires: lib%{name} = %{version}-%{release}
171
172%description -n lib%{name}-capi20
173%{descr_brief}
174
175This package contains the Common ISDN Application Programming Interface (CAPI)
176runtime library needed for applications working with ISDN devices.
177
178Note that this library requires a native OS/2 CAPI library to be installed (it
179is usually supplied with the ISDN device drivers). You may use a virtual package
180libcapi20-dummy to satisfy this requirement if you have installed the necessary
181CAPI DLLs manually.
182
183%files -n lib%{name}-capi20
184%defattr(-,root,root,-)
185%{odin_systemdir}/capi2032.dll
186
187#------------------------------------------------------------------------------
188%package -n lib%{name}-security
189#------------------------------------------------------------------------------
190
191Summary: Odin security library
192Group: System Environment/Libraries
193
194Requires: lib%{name} = %{version}-%{release}
195
196%description -n lib%{name}-security
197%{descr_brief}
198
199This package contains the Windows Secure Service Provider Interface (SSPI)
200runtime library needed for applications using this interface.
201
202Note that this library requires a native OS/2 NETAPI library to be installed
203(which is part of the IBM Peer component or the IBM HPFS386 package). You may
204use a virtual package libnetapi-dummy to satisfy this requirement if you have
205installed the necessary NETAPI DLLs manually.
206
207%files -n lib%{name}-security
208%defattr(-,root,root,-)
209%{odin_systemdir}/secur32.dll
210
211#------------------------------------------------------------------------------
212%package exe-tools
213#------------------------------------------------------------------------------
214
215Summary: Odin EXE tools
216Group: System Environment/Tools
217
218Requires: lib%{name} = %{version}-%{release}
219
220%description exe-tools
221%{descr_brief}
222
223This package contains command line tools used to convert Windows executables
224to OS/2 executables so that they can be run on OS/2 in the Odin environment.
225
226Note that these tools are NOT CURRENTLY SUPPORTED and therefore not recommended
227for general use. They are only provided for testing purposes.
228
229%files exe-tools
230%defattr(-,root,root,-)
231%{odin_bindir}/pe.exe
232%{odin_bindir}/pec.exe
233%{odin_bindir}/xx2lx.exe
234
235#------------------------------------------------------------------------------
236%package win32k
237#------------------------------------------------------------------------------
238
239Summary: Odin Win32k driver
240Group: System Environment/Libraries
241
242Requires: lib%{name} = %{version}-%{release}
243
244%description win32k
245%{descr_brief}
246
247This package contains a special driver (win32k.sys) that makes native Win32
248executables equal to native OS/2 executables so that they may be started in
249the OS/2 environment directly, bypassing the conversion phase.
250
251Note that this driver is NOT CURRENTLY SUPPORTED and therefore not recommended
252for general use. It is only provided for testing purposes.
253
254%files win32k
255%defattr(-,root,root,-)
256%{odin_systemdir}/win32k.sys
257%{odin_systemdir}/win32kCC.exe
258%{odin_systemdir}/kRx.exe
259
260%post win32k
261export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
262%cube {ADDLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
263echo; echo "NOTE:"
264echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
265echo "computer in order to activate these changes."
266echo
267
268%postun win32k
269export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
270%cube {DELLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys"} %{os2_config_sys} >nul
271echo; echo "NOTE:"
272echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
273echo "computer in order to activate these changes."
274echo
275
276#------------------------------------------------------------------------------
277%package doc
278#------------------------------------------------------------------------------
279
280Summary: Odin documentation
281Group: Documentation
282BuildArch: noarch
283
284Requires: lib%{name} = %{version}-%{release}
285
286%description doc
287%{descr_brief}
288
289This package contains Odin user's manual.
290
291%files doc
292%defattr(-,root,root,-)
293%doc %{pkg_docdir}/odinuser.inf
294
295%post doc
296%wps_object_create_begin -n %{name}-doc
297%{pkg_wps_folder_create}
298%{pkg_wps_base}_README:WPProgram|Read Me|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/Readme.txt}
299%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
300%{pkg_wps_base}_LICENSE:WPProgram|License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/LICENSE.TXT}
301%{pkg_wps_base}_WGSS50_LICENSE:WPProgram|WGSS50 License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/WGSS50.lic}
302%{pkg_wps_base}_MANUAL:WPProgram|User's Manual|%{pkg_wps_folder_id}|%{pkg_wps_view_inf %{pkg_docdir}/odinuser.inf}
303%wps_object_create_end
304
305%postun doc
306%wps_object_delete_all -n %{name}-doc
307
308#------------------------------------------------------------------------------
309%prep
310#------------------------------------------------------------------------------
311
312%if 0%{?test_mode}
313%setup -TD
314%else
315# @todo move the zip to the right place!
316%setup -q
317%endif
318
319#------------------------------------------------------------------------------
320%build
321#------------------------------------------------------------------------------
322
323#------------------------------------------------------------------------------
324%install
325#------------------------------------------------------------------------------
326
327rm -rf %{buildroot}
328
329mkdir -p %{buildroot}%{pkg_docdir}
330cp *.txt %{buildroot}%{pkg_docdir}/
331cp LICENSE.TXT %{buildroot}%{pkg_docdir}/
332cp ChangeLog %{buildroot}%{pkg_docdir}/
333cp WGSS50.lic %{buildroot}%{pkg_docdir}/
334cp odinuser.inf %{buildroot}%{pkg_docdir}/
335
336mkdir -p %{buildroot}%{odin_windowsdir}/
337
338mkdir -p %{buildroot}%{odin_systemdir}/
339cp -dp system32/*.dll %{buildroot}%{odin_systemdir}/
340cp -dp system32/*.exe %{buildroot}%{odin_systemdir}/
341cp -dp system32/win32k.sys %{buildroot}%{odin_systemdir}/
342
343mkdir -p %{buildroot}%{odin_bindir}/
344cp system32/*.exe %{buildroot}%{odin_bindir}/
345
346# these are internal tools that should not be in PATH
347mv %{buildroot}%{odin_bindir}/odininst.exe %{buildroot}%{odin_systemdir}/
348mv %{buildroot}%{odin_bindir}/win32kCC.exe %{buildroot}%{odin_systemdir}/
349mv %{buildroot}%{odin_bindir}/kRx.exe %{buildroot}%{odin_systemdir}/
350
351#------------------------------------------------------------------------------
352%clean
353#------------------------------------------------------------------------------
354
355%if !0%{?test_mode}
356rm -rf %{buildroot}
357%endif
358
359#------------------------------------------------------------------------------
360%changelog
361
Note: See TracBrowser for help on using the repository browser.