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

Last change on this file since 1330 was 1210, checked in by dmik, 8 years ago

spec: odin: Release version 0.9.0-1.

File size: 14.6 KB
Line 
1%define test_mode 0
2
3%define ver_major 0
4%define ver_minor 9
5%define ver_patch 0
6
7%define rpm_release 1
8
9Name: odin
10Vendor: netlabs.org
11License: Project Odin Software License
12Url: http://svn.netlabs.org/odin32/
13
14Version: %{ver_major}.%{ver_minor}.%{ver_patch}
15Release: %{rpm_release}
16
17%scm_source svn http://svn.netlabs.org/repos/odin32/tags/%{version} 22145
18
19%define descr_brief Odin is a set of libraries that provide a Win32-compatible runtime environment.\
20This environment is necesasry to run Win32 applications on OS/2 as well as\
21native OS/2 applications built from Win32 sources using Odin SDK.
22
23%define pkg_docdir %{_docdir}/%{name}-%{version}
24
25%define pkg_wps_base ODIN
26%define pkg_wps_folder_id <%{pkg_wps_base}_FOLDER>
27%define pkg_wps_folder_create %{pkg_wps_base}_FOLDER:WPFolder|Odin|<WP_DESKTOP>
28%define pkg_wps_view_txt() EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
29%define pkg_wps_view_inf() EXENAME=view.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
30
31#------------------------------------------------------------------------------
32# commons
33#------------------------------------------------------------------------------
34
35# installation paths
36%define odin_libdir %{_libdir}
37%define odin_bindir %{_bindir}
38%define odin_systemdir %{odin_libdir}
39%define odin_sysexedir %{_libdir}/odin
40%define odin_windowsdir %{_var}/lib/odin
41
42#------------------------------------------------------------------------------
43# main package
44#------------------------------------------------------------------------------
45
46Summary: Odin (dummy)
47Group: System Environment/Libraries
48
49%description
50%{descr_brief}
51
52This package is not actually generated (due to the missing %files section).
53It is present only because RPM requires Summary: and %description sections for
54the main package to exist.
55
56BuildRequires: kbuild
57BuildRequires: os2tk45-headers os2tk45-rc os2tk45-utils
58
59#------------------------------------------------------------------------------
60%package -n lib%{name}
61#------------------------------------------------------------------------------
62
63Summary: Odin runtime
64Group: System Environment/Libraries
65
66# For os2_dos_path, os2_langdir etc. macros
67Requires: os2-rpm >= 0-4
68# For -e in scriptlets
69Requires: rpm >= 4.9
70
71%description -n lib%{name}
72%{descr_brief}
73
74This package contains core Odin runtime libraries.
75
76%files -n lib%{name}
77%doc %{pkg_docdir}/
78%exclude %{pkg_docdir}/odinuser.inf
79%if "%{odin_libdir}" != "%{_libdir}"
80%dir %{odin_libdir}/
81%endif
82%if "%{odin_bindir}" != "%{_bindir}"
83%dir %{odin_bindir}/
84%endif
85%{odin_bindir}/*.exe
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%dir %{odin_systemdir}/
91%endif
92%{odin_systemdir}/*.dll
93%exclude %{odin_systemdir}/capi2032.dll
94%exclude %{odin_systemdir}/secur32.dll
95%exclude %{odin_systemdir}/schannel.dll
96%dir %{odin_sysexedir}/
97%{odin_sysexedir}/*.exe
98%if 0%{?have_win32k}
99%exclude %{odin_systemdir}/win32k.sys
100%exclude %{odin_sysexedir}/win32kCC.exe
101%exclude %{odin_sysexedir}/kRx.exe
102%endif
103# files/directories generated by odininst.exe removed on uninstall
104%ghost %{odin_systemdir}/Drivers/
105%ghost %{odin_systemdir}/Drivers/etc/
106%ghost %{odin_systemdir}/ODIN.INI
107# files/directories generated by odininst.exe preserved on uninstall
108%ghost %config %{odin_windowsdir}/
109
110%pre -n lib%{name}
111%warpin_conflicts_begin
112Odin\Odin\Odin Core Files
113Odin\Odin\Odin System Files
114Odin\Odin\Odin .sym files
115Odin\Odin\Changes to Config.sys
116%warpin_conflicts_end
117
118%post -n lib%{name} -e
119
120ODIN_SYSTEMDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_systemdir}}}"
121ODIN_BINDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_bindir}}}"
122
123%if "%{odin_systemdir}" != "%{_libdir}"
124export ODIN_SYSTEMDIR_D
125%cube {ADDSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST AFTER} %{os2_config_sys} >nul
126%endif
127%if "%{odin_bindir}" != "%{_bindir}"
128export ODIN_BINDIR_D
129%cube {ADDSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST AFTER} %{os2_config_sys} >nul
130%endif
131
132# initialize system directories, registry and INI files
133
134ODIN_WINDOWSDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_windowsdir}}}"
135cat > "%{odin_systemdir}/ODIN.INI" <<EOF
136[DEVDIRECTORIES]
137WINDOWS=$ODIN_WINDOWSDIR_D
138
139[ODINSYSTEM]
140PE_EXE=$ODIN_BINDIR_D\PE.EXE
141PEC_EXE=$ODIN_BINDIR_D\PEC.EXE
142W16ODIN_EXE=$ODIN_BINDIR_D\W16ODIN.EXE
143EOF
144
145%%{__mkdir_p} %{odin_windowsdir}
146(cd "%{odin_systemdir}/"; "%{odin_sysexedir}"/odininst.exe)
147
148rexxtry.cmd 1>nul 2>nul <<EOF
149call rxfuncadd SysIni, rexxutil, SysIni
150call SysIni 'USER', 'KLIBC', 'OdinPath', '$ODIN_SYSTEMDIR_D'||'00'x
151exit
152EOF
153
154%postun -n lib%{name} -e
155
156if [ "$1" -eq 0 ]; then # (upon removal)
157 rexxtry.cmd 1>nul 2>nul <<EOF
158call rxfuncadd SysIni, rexxutil, SysIni
159call SysIni 'USER', 'KLIBC', 'OdinPath', 'DELETE:'
160exit
161EOF
162
163%if "%{odin_bindir}" != "%{_bindir}"
164 export ODIN_BINDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_bindir}}}"
165 %cube {DELSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST} %{os2_config_sys} >nul
166%endif
167%if "%{odin_systemdir}" != "%{_libdir}"
168 export ODIN_SYSTEMDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_systemdir}}}"
169 %cube {DELSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST} %{os2_config_sys} >nul
170%endif
171fi
172
173#------------------------------------------------------------------------------
174%package -n lib%{name}-capi20
175#------------------------------------------------------------------------------
176
177Summary: Odin CAPI 2.0 library
178Group: System Environment/Libraries
179
180Requires: lib%{name} = %{version}-%{release}
181
182%description -n lib%{name}-capi20
183%{descr_brief}
184
185This package contains the Common ISDN Application Programming Interface (CAPI)
186runtime library needed for applications working with ISDN devices.
187
188Note that this library requires a native OS/2 CAPI library to be installed (it
189is usually supplied with the ISDN device drivers). You may use a virtual package
190libcapi20-dummy to satisfy this requirement if you have installed the necessary
191CAPI DLLs manually.
192
193%files -n lib%{name}-capi20
194%{odin_systemdir}/capi2032.dll
195
196#------------------------------------------------------------------------------
197%package -n lib%{name}-security
198#------------------------------------------------------------------------------
199
200Summary: Odin security library
201Group: System Environment/Libraries
202
203Requires: lib%{name} = %{version}-%{release}
204
205%description -n lib%{name}-security
206%{descr_brief}
207
208This package contains the Windows Secure Service Provider Interface (SSPI)
209runtime library needed for applications using this interface.
210
211Note that this library requires a native OS/2 NETAPI library to be installed
212(which is part of the IBM Peer component or the IBM HPFS386 package). You may
213use a virtual package libnetapi-dummy to satisfy this requirement if you have
214installed the necessary NETAPI DLLs manually.
215
216%files -n lib%{name}-security
217%{odin_systemdir}/secur32.dll
218%{odin_systemdir}/schannel.dll
219
220#------------------------------------------------------------------------------
221%package exe-tools
222#------------------------------------------------------------------------------
223
224Summary: Odin EXE tools
225Group: System Environment/Tools
226
227Requires: lib%{name} = %{version}-%{release}
228
229%description exe-tools
230%{descr_brief}
231
232This package contains command line tools used to convert Windows executables
233to OS/2 executables so that they can be run on OS/2 in the Odin environment.
234
235Note that these tools are NOT CURRENTLY SUPPORTED and therefore not recommended
236for general use. They are only provided for testing purposes.
237
238%files exe-tools
239%{odin_bindir}/pe.exe
240%{odin_bindir}/pec.exe
241%{odin_bindir}/xx2lx.exe
242
243%if 0%{?have_win32k}
244
245#------------------------------------------------------------------------------
246%package win32k
247#------------------------------------------------------------------------------
248
249Summary: Odin Win32k driver
250Group: System Environment/Libraries
251
252Requires: lib%{name} = %{version}-%{release}
253
254%description win32k
255%{descr_brief}
256
257This package contains a special driver (win32k.sys) that makes native Win32
258executables equal to native OS/2 executables so that they may be started in
259the OS/2 environment directly, bypassing the conversion phase.
260
261Note that this driver is NOT CURRENTLY SUPPORTED and therefore not recommended
262for general use. It is only provided for testing purposes.
263
264%files win32k
265%{odin_systemdir}/win32k.sys
266%{odin_sysexedir}/win32kCC.exe
267%{odin_sysexedir}/kRx.exe
268
269%post win32k -e
270export ODIN_SYSTEMDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_systemdir}}}"
271%cube {ADDLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
272
273%postun win32k -e
274if [ "$1" -eq 0 ]; then # (upon removal)
275 export ODIN_SYSTEMDIR_D="%%{os2_expand_dos_vars %{os2_dos_path %{odin_systemdir}}}"
276 %cube {DELLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys"} %{os2_config_sys} >nul
277fi
278
279%endif
280
281#------------------------------------------------------------------------------
282%package doc
283#------------------------------------------------------------------------------
284
285Summary: Odin documentation
286Group: Documentation
287BuildArch: noarch
288
289Requires: lib%{name} = %{version}-%{release}
290
291%description doc
292%{descr_brief}
293
294This package contains Odin user's manual.
295
296%files doc
297%defattr(-,root,root,-)
298%doc %{pkg_docdir}/odinuser.inf
299
300%post doc
301if [ "$1" -ge 1 ]; then # (upon update)
302 %wps_object_delete_all -n %{name}-doc
303fi
304%wps_object_create_begin -n %{name}-doc
305%{pkg_wps_folder_create}
306%{pkg_wps_base}_README:WPProgram|Read Me|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/Readme.txt}
307%{pkg_wps_base}_CHANGELOG:WPProgram|ChangeLog|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/ChangeLog}
308%{pkg_wps_base}_LICENSE:WPProgram|License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/LICENSE.TXT}
309%{pkg_wps_base}_WGSS50_LICENSE:WPProgram|WGSS50 License|%{pkg_wps_folder_id}|%{pkg_wps_view_txt %{pkg_docdir}/WGSS50.lic}
310%{pkg_wps_base}_MANUAL:WPProgram|User's Manual|%{pkg_wps_folder_id}|%{pkg_wps_view_inf %{pkg_docdir}/odinuser.inf}
311%wps_object_create_end
312
313%postun doc
314if [ "$1" -eq 0 ]; then # (upon removal)
315 %wps_object_delete_all -n %{name}-doc
316fi
317
318#------------------------------------------------------------------------------
319# Note: Odin exception handler wants .sym and won't read .dbg files so we supply
320# the list of files for the debug package in debugfiles.list ourselves (below).
321%define _strip_opts --no-debuginfo
322%debug_package
323#------------------------------------------------------------------------------
324
325#------------------------------------------------------------------------------
326%prep
327#------------------------------------------------------------------------------
328
329%scm_setup
330
331#------------------------------------------------------------------------------
332%build
333#------------------------------------------------------------------------------
334
335%define kmk_env \\\
336 CFLAGS="%{optflags}" \\\
337 CXXFLAGS="%{optflags}" \\\
338 PATH_INS=%{buildroot}/ \\\
339 INST_BIN=%{odin_bindir}/ \\\
340 INST_LIB=%{odin_libdir}/ \\\
341 INST_DLL=%{odin_systemdir}/ \\\
342 INST_DEBUG=./
343
344kmk %{?_smp_mflags} %{kmk_env}
345
346#------------------------------------------------------------------------------
347%install
348#------------------------------------------------------------------------------
349
350%{__rm} -rf %{buildroot}
351
352kmk install %{kmk_env}
353
354%{__mkdir_p} %{buildroot}%{pkg_docdir}
355%{__cp} -a \
356 doc/Logging.txt \
357 doc/Odin.ini.txt \
358 doc/Readme.txt \
359 doc/ReportingBugs.txt \
360 doc/odinuser.inf \
361 LICENSE.TXT \
362 ChangeLog \
363 WGSS50.lic \
364 %{buildroot}%{pkg_docdir}/
365
366%{__mkdir_p} %{buildroot}%{odin_windowsdir}/
367
368%{__mkdir_p} %{buildroot}%{odin_sysexedir}/
369
370# these are internal tools that should not be in PATH
371%{__mv} %{buildroot}%{odin_bindir}/odininst.* %{buildroot}%{odin_sysexedir}/
372%if 0%{?have_win32k}
373%{__mv} %{buildroot}%{odin_bindir}/win32kCC.* %{buildroot}%{odin_sysexedir}/
374%{__mv} %{buildroot}%{odin_bindir}/kRx.* %{buildroot}%{odin_sysexedir}/
375%endif
376
377# wgss
378%{__cp} -a bin/wgss50.* %{buildroot}%{odin_systemdir}/
379
380# we don't need static libraries
381%{__rm} %{buildroot}%{odin_libdir}/*.lib
382
383# list all .sym files for debug_package ourselves (see note above)
384%{__rm} -f debugfiles.list
385for f in `find %{buildroot} -name *.sym` ; do
386 echo ${f#%{buildroot}} >> debugfiles.list
387done
388
389#------------------------------------------------------------------------------
390%clean
391#------------------------------------------------------------------------------
392
393%if !0%{?test_mode}
394%{__rm} -rf %{buildroot}
395%endif
396
397#------------------------------------------------------------------------------
398%changelog
399* Sun Jul 30 2017 Dmitriy Kuminov <coding@dmik.org> - 0.9.0-1
400- New release 0.9.0. See %{pkg_docdir}/ChangeLog for more information.
401- Update SPEC to use latest OS/2 RPM environment guidelines (scm_source etc.)
402 which includes building Odin from sources rather than using zipped binaries
403 when building RPMs and also makes RPM a primary distribution format for Odin.
404- Add schannel.dll to odin-security sub-package.
405
406* Sun Feb 17 2013 Dmitriy Kuminov <coding/dmik.org> - 0.8.9-1
407- New release 0.8.9. See %{pkg_docdir}/ChangeLog for more information.
408
409* Mon Dec 31 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.8-1
410- New release 0.8.8. See %{pkg_docdir}/ChangeLog for more information.
411
412* Wed Dec 19 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.7-1
413- New release 0.8.7. See %{pkg_docdir}/ChangeLog for more information.
414
415* Tue Oct 23 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.6-1
416- New release 0.8.6. See %{pkg_docdir}/ChangeLog for more information.
417
418* Sat Jul 21 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.5-1
419- New release 0.8.5. See %{pkg_docdir}/ChangeLog for more information.
420
421* Mon Mar 19 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.4-1
422- New release 0.8.4. See %{pkg_docdir}/ChangeLog for more information.
423
424* Tue Feb 07 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.3-1
425- New release 0.8.3. See %{pkg_docdir}/ChangeLog for more information.
426
427* Fri Dec 30 2011 Dmitriy Kuminov <coding/dmik.org> - 0.8.2-1
428- New release 0.8.2. See %{pkg_docdir}/ChangeLog for more information.
429
430* Mon Dec 19 2011 Dmitriy Kuminov <coding/dmik.org> - 0.8.1-1
431- New release 0.8.1. See %{pkg_docdir}/ChangeLog for more information.
432
433* Mon Oct 03 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-3
434- Remove executables from "libodin" (they are provided by "odin-exe-tools").
435
436* Sun Oct 02 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-2
437- Add "KLIBC\OdinPath" to OS2.INI needed for some applications.
438- Fix unexpected deletion of WPS objects when updating the "odin-doc" package
439 ("yum reinstall odin-doc" is still requred after updating to this version).
440
441* Fri Sep 30 2011 Dmitriy Kuminov <coding/dmik.org> - 0.7.1-1
442- New release 0.7.1. See %{pkg_docdir}/ChangeLog for more information.
Note: See TracBrowser for help on using the repository browser.