source: spec/trunk/SPECS/odin/odin.spec@ 1036

Last change on this file since 1036 was 331, checked in by dmik, 13 years ago

spec: odin: Release 0.8.9-1.

File size: 14.6 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 8
9%define ver_patch 9
10
11%define rpm_release 1
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%if 0%{?have_win32k}
98%exclude %{odin_systemdir}/win32k.sys
99%exclude %{odin_systemdir}/win32kCC.exe
100%exclude %{odin_systemdir}/kRx.exe
101%endif
102# files/directories generated by odininst.exe removed on uninstall
103%attr(0755,root,root) %ghost %{odin_systemdir}/Drivers/
104%attr(0755,root,root) %ghost %{odin_systemdir}/Drivers/etc/
105%attr(0644,root,root) %ghost %{odin_systemdir}/ODIN.INI
106# files/directories generated by odininst.exe preserved on uninstall
107%attr(0755,root,root) %ghost %config %{odin_windowsdir}/
108
109%pre -n lib%{name}
110%warpin_conflicts_begin
111Odin\Odin\Odin Core Files
112Odin\Odin\Odin System Files
113Odin\Odin\Odin .sym files
114Odin\Odin\Changes to Config.sys
115%warpin_conflicts_end
116
117%post -n lib%{name}
118
119ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
120ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
121
122CFGSYS_CHANGED=
123%if "%{odin_systemdir}" != "%{_libdir}"
124export ODIN_SYSTEMDIR_D
125%cube {ADDSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST AFTER} %{os2_config_sys} >nul
126CFGSYS_CHANGED=y
127%endif
128%if "%{odin_bindir}" != "%{_bindir}"
129export ODIN_BINDIR_D
130%cube {ADDSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST AFTER} %{os2_config_sys} >nul
131CFGSYS_CHANGED=y
132%endif
133if [ -n "$CFGSYS_CHANGED" ]; then
134 echo; echo "NOTE:"
135 echo; echo "The boot configuration has been changed. You need to reboot your"
136 echo "computer in order to activate these changes."
137 echo
138fi
139
140#initialize system directories, registry and INI files
141ODIN_WINDOWSDIR_D=$(echo "%{odin_windowsdir}" | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')
142echo \
143"[DEVDIRECTORIES]
144WINDOWS=$ODIN_WINDOWSDIR_D
145" \
146> "%{odin_systemdir}/ODIN.INI"
147echo \
148"[ODINSYSTEM]
149PE_EXE=$ODIN_BINDIR_D\\PE.EXE
150PEC_EXE=$ODIN_BINDIR_D\\PEC.EXE
151W16ODIN_EXE=$ODIN_BINDIR_D\\W16ODIN.EXE
152" \
153>> "%{odin_systemdir}/ODIN.INI"
154# mkdir -p fails on /@unixroot, replace it with the real value
155mkdir -p "$(echo %{odin_windowsdir} | sed -re 's,/@unixroot,'$UNIXROOT',g')"
156(cd "%{odin_systemdir}/"; "%{odin_systemdir}"/odininst.exe)
157ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
158rexxtry.cmd 1>nul 2>nul <<EOF
159call rxfuncadd SysIni, rexxutil, SysIni
160call SysIni 'USER', 'KLIBC', 'OdinPath', '$ODIN_SYSTEMDIR_D'||'00'x
161exit
162EOF
163
164%postun -n lib%{name}
165
166if [ "$1" -eq 0 ]; then # (upon removal)
167 rexxtry.cmd 1>nul 2>nul <<EOF
168call rxfuncadd SysIni, rexxutil, SysIni
169call SysIni 'USER', 'KLIBC', 'OdinPath', 'DELETE:'
170exit
171EOF
172
173 CFGSYS_CHANGED=
174 %if "%{odin_bindir}" != "%{_bindir}"
175 export ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
176 %cube {DELSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST} %{os2_config_sys} >nul
177 CFGSYS_CHANGED=y
178 %endif
179 %if "%{odin_systemdir}" != "%{_libdir}"
180 export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
181 %cube {DELSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST} %{os2_config_sys} >nul
182 %endif
183 if [ -n "$CFGSYS_CHANGED" ]; then
184 echo; echo "NOTE:"
185 echo; echo "The boot configuration has been changed. You need to reboot your"
186 echo "computer in order to activate these changes."
187 echo
188 fi
189fi
190
191#------------------------------------------------------------------------------
192%package -n lib%{name}-capi20
193#------------------------------------------------------------------------------
194
195Summary: Odin CAPI 2.0 library
196Group: System Environment/Libraries
197
198Requires: lib%{name} = %{version}-%{release}
199
200%description -n lib%{name}-capi20
201%{descr_brief}
202
203This package contains the Common ISDN Application Programming Interface (CAPI)
204runtime library needed for applications working with ISDN devices.
205
206Note that this library requires a native OS/2 CAPI library to be installed (it
207is usually supplied with the ISDN device drivers). You may use a virtual package
208libcapi20-dummy to satisfy this requirement if you have installed the necessary
209CAPI DLLs manually.
210
211%files -n lib%{name}-capi20
212%defattr(-,root,root,-)
213%{odin_systemdir}/capi2032.dll
214
215#------------------------------------------------------------------------------
216%package -n lib%{name}-security
217#------------------------------------------------------------------------------
218
219Summary: Odin security library
220Group: System Environment/Libraries
221
222Requires: lib%{name} = %{version}-%{release}
223
224%description -n lib%{name}-security
225%{descr_brief}
226
227This package contains the Windows Secure Service Provider Interface (SSPI)
228runtime library needed for applications using this interface.
229
230Note that this library requires a native OS/2 NETAPI library to be installed
231(which is part of the IBM Peer component or the IBM HPFS386 package). You may
232use a virtual package libnetapi-dummy to satisfy this requirement if you have
233installed the necessary NETAPI DLLs manually.
234
235%files -n lib%{name}-security
236%defattr(-,root,root,-)
237%{odin_systemdir}/secur32.dll
238
239#------------------------------------------------------------------------------
240%package exe-tools
241#------------------------------------------------------------------------------
242
243Summary: Odin EXE tools
244Group: System Environment/Tools
245
246Requires: lib%{name} = %{version}-%{release}
247
248%description exe-tools
249%{descr_brief}
250
251This package contains command line tools used to convert Windows executables
252to OS/2 executables so that they can be run on OS/2 in the Odin environment.
253
254Note that these tools are NOT CURRENTLY SUPPORTED and therefore not recommended
255for general use. They are only provided for testing purposes.
256
257%files exe-tools
258%defattr(-,root,root,-)
259%{odin_bindir}/pe.exe
260%{odin_bindir}/pec.exe
261%{odin_bindir}/xx2lx.exe
262
263%if 0%{?have_win32k}
264
265#------------------------------------------------------------------------------
266%package win32k
267#------------------------------------------------------------------------------
268
269Summary: Odin Win32k driver
270Group: System Environment/Libraries
271
272Requires: lib%{name} = %{version}-%{release}
273
274%description win32k
275%{descr_brief}
276
277This package contains a special driver (win32k.sys) that makes native Win32
278executables equal to native OS/2 executables so that they may be started in
279the OS/2 environment directly, bypassing the conversion phase.
280
281Note that this driver is NOT CURRENTLY SUPPORTED and therefore not recommended
282for general use. It is only provided for testing purposes.
283
284%files win32k
285%defattr(-,root,root,-)
286%{odin_systemdir}/win32k.sys
287%{odin_systemdir}/win32kCC.exe
288%{odin_systemdir}/kRx.exe
289
290%post win32k
291export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
292%cube {ADDLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
293echo; echo "NOTE:"
294echo; echo "The boot configuration has been changed. You need to reboot your"
295echo "computer in order to activate these changes."
296echo
297
298%postun win32k
299if [ "$1" -eq 0 ]; then # (upon removal)
300 export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
301 %cube {DELLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys"} %{os2_config_sys} >nul
302 echo; echo "NOTE:"
303 echo; echo "The boot configuration has been changed. You need to reboot your"
304 echo "computer in order to activate these changes."
305 echo
306fi
307
308%endif
309
310#------------------------------------------------------------------------------
311%package doc
312#------------------------------------------------------------------------------
313
314Summary: Odin documentation
315Group: Documentation
316BuildArch: noarch
317
318Requires: lib%{name} = %{version}-%{release}
319
320%description doc
321%{descr_brief}
322
323This package contains Odin user's manual.
324
325%files doc
326%defattr(-,root,root,-)
327%doc %{pkg_docdir}/odinuser.inf
328
329%post doc
330if [ "$1" -ge 1 ]; then # (upon update)
331 %wps_object_delete_all -n %{name}-doc
332fi
333%wps_object_create_begin -n %{name}-doc
334%{pkg_wps_folder_create}
335%{pkg_wps_base}_README:WPProgram|Read Me|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/Readme.txt}
336%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
337%{pkg_wps_base}_LICENSE:WPProgram|License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/LICENSE.TXT}
338%{pkg_wps_base}_WGSS50_LICENSE:WPProgram|WGSS50 License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/WGSS50.lic}
339%{pkg_wps_base}_MANUAL:WPProgram|User's Manual|%{pkg_wps_folder_id}|%{pkg_wps_view_inf %{pkg_docdir}/odinuser.inf}
340%wps_object_create_end
341
342%postun doc
343if [ "$1" -eq 0 ]; then # (upon removal)
344 %wps_object_delete_all -n %{name}-doc
345fi
346
347#------------------------------------------------------------------------------
348%prep
349#------------------------------------------------------------------------------
350
351%if 0%{?test_mode}
352%setup -TD
353%else
354# @todo move the zip to the right place!
355%setup -q
356%endif
357
358#------------------------------------------------------------------------------
359%build
360#------------------------------------------------------------------------------
361
362#------------------------------------------------------------------------------
363%install
364#------------------------------------------------------------------------------
365
366rm -rf %{buildroot}
367
368mkdir -p %{buildroot}%{pkg_docdir}
369cp *.txt %{buildroot}%{pkg_docdir}/
370cp LICENSE.TXT %{buildroot}%{pkg_docdir}/
371cp ChangeLog %{buildroot}%{pkg_docdir}/
372cp WGSS50.lic %{buildroot}%{pkg_docdir}/
373cp odinuser.inf %{buildroot}%{pkg_docdir}/
374
375mkdir -p %{buildroot}%{odin_windowsdir}/
376
377mkdir -p %{buildroot}%{odin_systemdir}/
378cp -dp system32/*.dll %{buildroot}%{odin_systemdir}/
379%if 0%{?have_win32k}
380cp -dp system32/win32k.sys %{buildroot}%{odin_systemdir}/
381%endif
382
383mkdir -p %{buildroot}%{odin_bindir}/
384cp -dp system32/*.exe %{buildroot}%{odin_bindir}/
385
386# these are internal tools that should not be in PATH
387mv %{buildroot}%{odin_bindir}/odininst.exe %{buildroot}%{odin_systemdir}/
388%if 0%{?have_win32k}
389mv %{buildroot}%{odin_bindir}/win32kCC.exe %{buildroot}%{odin_systemdir}/
390mv %{buildroot}%{odin_bindir}/kRx.exe %{buildroot}%{odin_systemdir}/
391%endif
392
393#------------------------------------------------------------------------------
394%clean
395#------------------------------------------------------------------------------
396
397%if !0%{?test_mode}
398rm -rf %{buildroot}
399%endif
400
401#------------------------------------------------------------------------------
402%changelog
403
404* Sun Feb 17 2013 Dmitriy Kuminov <coding/dmik.org> - 0.8.9-1
405- <List changes here>
406
407* Mon Dec 31 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.8-1
408- New release 0.8.8. See %{pkg_docdir}/ChangeLog for more information.
409
410* Wed Dec 19 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.7-1
411- New release 0.8.7. See %{pkg_docdir}/ChangeLog for more information.
412
413* Tue Oct 23 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.6-1
414- New release 0.8.6. See %{pkg_docdir}/ChangeLog for more information.
415
416* Sat Jul 21 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.5-1
417- New release 0.8.5. See %{pkg_docdir}/ChangeLog for more information.
418
419* Mon Mar 19 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.4-1
420- New release 0.8.4. See %{pkg_docdir}/ChangeLog for more information.
421
422* Mon Feb 07 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.3-1
423- New release 0.8.3. See %{pkg_docdir}/ChangeLog for more information.
424
425* Fri Dec 30 2011 Dmitriy Kuminov <coding/dmik.org> - 0.8.2-1
426- New release 0.8.2. See %{pkg_docdir}/ChangeLog for more information.
427
428* Mon Dec 19 2011 Dmitriy Kuminov <coding/dmik.org> - 0.8.1-1
429- New release 0.8.1. See %{pkg_docdir}/ChangeLog for more information.
430
431* Mon Oct 03 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-3
432- Remove executables from "libodin" (they are provided by "odin-exe-tools").
433
434* Sun Oct 02 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-2
435- Add "KLIBC\OdinPath" to OS2.INI needed for some applications.
436- Fix unexpected deletion of WPS objects when updating the "odin-doc" package
437 ("yum reinstall odin-doc" is still requred after updating to this version).
438
439* Fri Sep 30 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-1
440- New release 0.7.1. See %{pkg_docdir}/ChangeLog for more information.
Note: See TracBrowser for help on using the repository browser.