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

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

Release 0.7.1.

  • Property svn:eol-style set to native
File size: 12.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 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%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)
144
145%postun -n lib%{name}
146
147CFGSYS_CHANGED=
148%if "%{odin_bindir}" != "%{_bindir}"
149export ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
150%cube {DELSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST} %{os2_config_sys} >nul
151CFGSYS_CHANGED=y
152%endif
153%if "%{odin_systemdir}" != "%{_libdir}"
154export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
155%cube {DELSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST} %{os2_config_sys} >nul
156%endif
157if [ -n "$CFGSYS_CHANGED" ]; then
158 echo; echo "NOTE:"
159 echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
160 echo "computer in order to activate these changes."
161 echo
162fi
163
164#------------------------------------------------------------------------------
165%package -n lib%{name}-capi20
166#------------------------------------------------------------------------------
167
168Summary: Odin CAPI 2.0 library
169Group: System Environment/Libraries
170
171Requires: lib%{name} = %{version}-%{release}
172
173%description -n lib%{name}-capi20
174%{descr_brief}
175
176This package contains the Common ISDN Application Programming Interface (CAPI)
177runtime library needed for applications working with ISDN devices.
178
179Note that this library requires a native OS/2 CAPI library to be installed (it
180is usually supplied with the ISDN device drivers). You may use a virtual package
181libcapi20-dummy to satisfy this requirement if you have installed the necessary
182CAPI DLLs manually.
183
184%files -n lib%{name}-capi20
185%defattr(-,root,root,-)
186%{odin_systemdir}/capi2032.dll
187
188#------------------------------------------------------------------------------
189%package -n lib%{name}-security
190#------------------------------------------------------------------------------
191
192Summary: Odin security library
193Group: System Environment/Libraries
194
195Requires: lib%{name} = %{version}-%{release}
196
197%description -n lib%{name}-security
198%{descr_brief}
199
200This package contains the Windows Secure Service Provider Interface (SSPI)
201runtime library needed for applications using this interface.
202
203Note that this library requires a native OS/2 NETAPI library to be installed
204(which is part of the IBM Peer component or the IBM HPFS386 package). You may
205use a virtual package libnetapi-dummy to satisfy this requirement if you have
206installed the necessary NETAPI DLLs manually.
207
208%files -n lib%{name}-security
209%defattr(-,root,root,-)
210%{odin_systemdir}/secur32.dll
211
212#------------------------------------------------------------------------------
213%package exe-tools
214#------------------------------------------------------------------------------
215
216Summary: Odin EXE tools
217Group: System Environment/Tools
218
219Requires: lib%{name} = %{version}-%{release}
220
221%description exe-tools
222%{descr_brief}
223
224This package contains command line tools used to convert Windows executables
225to OS/2 executables so that they can be run on OS/2 in the Odin environment.
226
227Note that these tools are NOT CURRENTLY SUPPORTED and therefore not recommended
228for general use. They are only provided for testing purposes.
229
230%files exe-tools
231%defattr(-,root,root,-)
232%{odin_bindir}/pe.exe
233%{odin_bindir}/pec.exe
234%{odin_bindir}/xx2lx.exe
235
236#------------------------------------------------------------------------------
237%package win32k
238#------------------------------------------------------------------------------
239
240Summary: Odin Win32k driver
241Group: System Environment/Libraries
242
243Requires: lib%{name} = %{version}-%{release}
244
245%description win32k
246%{descr_brief}
247
248This package contains a special driver (win32k.sys) that makes native Win32
249executables equal to native OS/2 executables so that they may be started in
250the OS/2 environment directly, bypassing the conversion phase.
251
252Note that this driver is NOT CURRENTLY SUPPORTED and therefore not recommended
253for general use. It is only provided for testing purposes.
254
255%files win32k
256%defattr(-,root,root,-)
257%{odin_systemdir}/win32k.sys
258%{odin_systemdir}/win32kCC.exe
259%{odin_systemdir}/kRx.exe
260
261%post win32k
262export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
263%cube {ADDLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
264echo; echo "NOTE:"
265echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
266echo "computer in order to activate these changes."
267echo
268
269%postun win32k
270export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
271%cube {DELLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys"} %{os2_config_sys} >nul
272echo; echo "NOTE:"
273echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
274echo "computer in order to activate these changes."
275echo
276
277#------------------------------------------------------------------------------
278%package doc
279#------------------------------------------------------------------------------
280
281Summary: Odin documentation
282Group: Documentation
283BuildArch: noarch
284
285Requires: lib%{name} = %{version}-%{release}
286
287%description doc
288%{descr_brief}
289
290This package contains Odin user's manual.
291
292%files doc
293%defattr(-,root,root,-)
294%doc %{pkg_docdir}/odinuser.inf
295
296%post doc
297%wps_object_create_begin -n %{name}-doc
298%{pkg_wps_folder_create}
299%{pkg_wps_base}_README:WPProgram|Read Me|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/Readme.txt}
300%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
301%{pkg_wps_base}_LICENSE:WPProgram|License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/LICENSE.TXT}
302%{pkg_wps_base}_WGSS50_LICENSE:WPProgram|WGSS50 License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/WGSS50.lic}
303%{pkg_wps_base}_MANUAL:WPProgram|User's Manual|%{pkg_wps_folder_id}|%{pkg_wps_view_inf %{pkg_docdir}/odinuser.inf}
304%wps_object_create_end
305
306%postun doc
307%wps_object_delete_all -n %{name}-doc
308
309#------------------------------------------------------------------------------
310%prep
311#------------------------------------------------------------------------------
312
313%if 0%{?test_mode}
314%setup -TD
315%else
316# @todo move the zip to the right place!
317%setup -q
318%endif
319
320#------------------------------------------------------------------------------
321%build
322#------------------------------------------------------------------------------
323
324#------------------------------------------------------------------------------
325%install
326#------------------------------------------------------------------------------
327
328rm -rf %{buildroot}
329
330mkdir -p %{buildroot}%{pkg_docdir}
331cp *.txt %{buildroot}%{pkg_docdir}/
332cp LICENSE.TXT %{buildroot}%{pkg_docdir}/
333cp ChangeLog %{buildroot}%{pkg_docdir}/
334cp WGSS50.lic %{buildroot}%{pkg_docdir}/
335cp odinuser.inf %{buildroot}%{pkg_docdir}/
336
337mkdir -p %{buildroot}%{odin_windowsdir}/
338
339mkdir -p %{buildroot}%{odin_systemdir}/
340cp -dp system32/*.dll %{buildroot}%{odin_systemdir}/
341cp -dp system32/*.exe %{buildroot}%{odin_systemdir}/
342cp -dp system32/win32k.sys %{buildroot}%{odin_systemdir}/
343
344mkdir -p %{buildroot}%{odin_bindir}/
345cp system32/*.exe %{buildroot}%{odin_bindir}/
346
347# these are internal tools that should not be in PATH
348mv %{buildroot}%{odin_bindir}/odininst.exe %{buildroot}%{odin_systemdir}/
349mv %{buildroot}%{odin_bindir}/win32kCC.exe %{buildroot}%{odin_systemdir}/
350mv %{buildroot}%{odin_bindir}/kRx.exe %{buildroot}%{odin_systemdir}/
351
352#------------------------------------------------------------------------------
353%clean
354#------------------------------------------------------------------------------
355
356%if !0%{?test_mode}
357rm -rf %{buildroot}
358%endif
359
360#------------------------------------------------------------------------------
361%changelog
362
363* Fri Sep 30 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-1
364- New release 0.7.1. See %{pkg_docdir}/ChangeLog for more information.
Note: See TracBrowser for help on using the repository browser.