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

Last change on this file since 21787 was 21689, checked in by dmik, 14 years ago

Spec for release 0.7.1-3.

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