Changeset 21680 for trunk/tools/install


Ignore:
Timestamp:
Sep 30, 2011, 6:03:05 PM (14 years ago)
Author:
dmik
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/install/odin.spec

    r21678 r21680  
    22# http://svn.netlabs.org/odin32
    33#
    4 
    5 %define test_build  1
     4%define test_mode   1
    65
    76%define ver_major   0
     
    1110%define rpm_release 1
    1211
    13 %define pkg_name        odin
     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
    1421
    1522%define descr_brief Odin is a set of libraries that provide a Win32-compatible runtime environment.\
     
    1724native OS/2 applications built from Win32 sources using Odin SDK.
    1825
     26%define pkg_docdir      %{_docdir}/%{name}
     27
    1928%define pkg_wps_base            ODIN
    2029%define pkg_wps_folder_id       <%{pkg_wps_base}_FOLDER>
    2130%define pkg_wps_folder_create   %{pkg_wps_base}_FOLDER:WPFolder|Odin|<WP_DESKTOP>
    22 %define pkg_wps_reader()        EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=((%*))
    23 
    24 %define pkg_name_ver    %{pkg_name}-%{ver_major}.%{ver_minor}.%{ver_patch}
     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}
    2546
    2647#------------------------------------------------------------------------------
     
    2849#------------------------------------------------------------------------------
    2950
    30 Name:       %{pkg_name}
     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
    3165Summary:    Odin runtime
    3266Group:      System Environment/Libraries
    33 Version:    %{ver_major}.%{ver_minor}.%{ver_patch}
    34 Release:    %{rpm_release}
    35 Vendor:     netlabs.org
    36 
    37 # @todo?
    38 #Requires:   libc >= 0.6.3
    39 
    40 License:    Project Odin Software License
    41 Url:        http://svn.netlabs.org/odin32/
    42 
    43 Source:     odin.zip
    44 
    45 #BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root
    46 
    47 # @todo
    48 #BuildRequires:
    49 
    50 %description
    51 %{descr_brief}
    52 
    53 This package contains Odin runtime libraries and utilities.
    54 
    55 %files
    56 %defattr(-,root,root,-)
    57 %doc %{_docdir}/%{pkg_name_ver}/Readme.txt
    58 #%{_libdir}/wgss50.dll
    59 #%{_libdir}/odincrt.dll
    60 #%{_libdir}/ntdll.dll
    61 #%{_libdir}/kernel32.dll
    62 
    63 %pre
    64 /*.cmd*/
    65 
    66     packages.1 = 'Odin\Odin\Odin Core Files'
    67     packages.2 = 'Odin\Odin\Odin System Files'
    68     packages.3 = 'Odin\Odin\Odin .sym files'
    69     packages.4 = 'Odin\Odin\Changes to Config.sys'
    70     packages.0 = 4
    71 
    72     ver = ''
    73     do i = 1 to packages.0
    74         ver = GetPkgVersion(packages.i)
    75         if (ver \== '') then leave
    76     end
    77     if (ver == '') then exit 0
    78 
    79     say; say 'ERROR:'; say
    80     say 'You have a WPI package "'packages.i'" version 'ver
    81     say 'installed on your system.'; say
    82     say 'You cannot have both the WPI and RPM package installed at the same time.'
    83     say 'Please de-install the specified WPI package using the WarpIn utility'
    84     say 'and try again.'; say
    85     exit 1
    86 
    87     GetPkgVersion: procedure
    88         parse arg aPkgId
    89         rc = rxFuncAdd('SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs')
    90         rc = SysLoadFuncs()
    91         WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x)
    92         if (WarpInDir \== '') then do
    93             rc = SysFileTree(WarpInDir'\DATBAS_?.INI', 'inis', 'FO')
    94             if (rc == 0) then do
    95                 do i = 1 to inis.0
    96                     rc = SysIni(inis.i, 'ALL:', 'apps')
    97                     if (rc == '') then do
    98                         do j = 1 to apps.0
    99                             apps.j = strip(apps.j, 'T', '0'x)
    100                             if (left(apps.j, length(aPkgId)) == aPkgId) then do
    101                                 /* found the app */
    102                                 ver = right(apps.j, length(apps.j) - length(aPkgId) - 1)
    103                                 ver = translate(ver, '.', '\')
    104                                 return ver
    105                             end
    106                         end
    107                     end
    108                     else do
    109                         say; say 'ERROR:'; say
    110                         say 'Failed to access the file "'inis.i'".'; say
    111                         say 'Please close the WarpIn application or, if it is not running, make sure'
    112                         say 'that this file is not locked by another process and try again.'; say
    113                         exit 5
    114                     end
    115                 end
    116             end
    117         end
    118         return ''
    119 
    120 %post
    121 %wps_object_create_begin
    122 %{pkg_wps_folder_create}
    123 %{pkg_wps_base}_README:WPProgram|Read Me|%{pkg_wps_folder_id}|%{pkg_wps_reader %{_docdir}/%{pkg_name_ver}/Readme.txt}
    124 %wps_object_create_end
    125 
    126 %postun
    127 %wps_object_delete_all
     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
    128234
    129235#------------------------------------------------------------------------------
     
    134240Group:      System Environment/Libraries
    135241
    136 Requires:   %{pkg_name} = %{version}-%{release}
     242Requires:   lib%{name} = %{version}-%{release}
    137243
    138244%description win32k
     
    148254%files win32k
    149255%defattr(-,root,root,-)
    150 %{_libdir}/win32k.sys
     256%{odin_systemdir}/win32k.sys
     257%{odin_systemdir}/win32kCC.exe
     258%{odin_systemdir}/kRx.exe
    151259
    152260%post win32k
    153 %cube {ADDLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} %{os2_config_sys}.yum >nul
     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
    154263echo; echo "NOTE:"
    155264echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
     
    158267
    159268%postun win32k
    160 %cube {DELLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\win32k.sys"} %{os2_config_sys} %{os2_config_sys}.yum >nul
     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
    161271echo; echo "NOTE:"
    162272echo; echo "The file '%{os2_config_sys}' has been changed. You need to reboot your"
     
    165275
    166276#------------------------------------------------------------------------------
     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#------------------------------------------------------------------------------
    167309%prep
    168310#------------------------------------------------------------------------------
    169311
    170 %if 0%{?test_build}
     312%if 0%{?test_mode}
    171313%setup -TD
    172314%else
     
    185327rm -rf %{buildroot}
    186328
    187 mkdir -p %{buildroot}%{_libdir}
    188 #cp system32/wgss50.dll %{buildroot}%{_libdir}/
    189 #cp system32/odincrt.dll %{buildroot}%{_libdir}/
    190 #cp system32/ntdll.dll %{buildroot}%{_libdir}/
    191 #cp system32/kernel32.dll %{buildroot}%{_libdir}/
    192 cp system32/win32k.sys %{buildroot}%{_libdir}/
    193 mkdir -p %{buildroot}%{_docdir}/%{pkg_name_ver}
    194 cp Readme.txt %{buildroot}%{_docdir}/%{pkg_name_ver}/
     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}/
    195350
    196351#------------------------------------------------------------------------------
     
    198353#------------------------------------------------------------------------------
    199354
     355%if !0%{?test_mode}
    200356rm -rf %{buildroot}
     357%endif
    201358
    202359#------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.