Changeset 1210 for spec/trunk/SPECS


Ignore:
Timestamp:
Jul 30, 2017, 3:44:13 PM (8 years ago)
Author:
dmik
Message:

spec: odin: Release version 0.9.0-1.

Location:
spec/trunk/SPECS
Files:
1 deleted
1 copied

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/odin.spec

    r1208 r1210  
    1 #
    2 # http://svn.netlabs.org/odin32
    3 #
    4 
    51%define test_mode   0
    62
    73%define ver_major   0
    8 %define ver_minor   8
    9 %define ver_patch   9
     4%define ver_minor   9
     5%define ver_patch   0
    106
    117%define rpm_release 1
     
    1915Release:    %{rpm_release}
    2016
    21 Source:     %{name}-%{version}.zip
     17%scm_source svn http://svn.netlabs.org/repos/odin32/tags/%{version} 22145
    2218
    2319%define descr_brief Odin is a set of libraries that provide a Win32-compatible runtime environment.\
     
    2521native OS/2 applications built from Win32 sources using Odin SDK.
    2622
    27 %define pkg_docdir      %{_docdir}/%{name}
     23%define pkg_docdir      %{_docdir}/%{name}-%{version}
    2824
    2925%define pkg_wps_base            ODIN
     
    4137%define odin_bindir     %{_bindir}
    4238%define odin_systemdir  %{odin_libdir}
     39%define odin_sysexedir  %{_libdir}/odin
    4340%define odin_windowsdir %{_var}/lib/odin
    44 
    45 # disable lxlite compression (this causes problems for some DLLs)
    46 %define __os_install_post   %{nil}
    4741
    4842#------------------------------------------------------------------------------
     
    6054the main package to exist.
    6155
     56BuildRequires: kbuild
     57BuildRequires: os2tk45-headers os2tk45-rc os2tk45-utils
     58
    6259#------------------------------------------------------------------------------
    6360%package -n lib%{name}
     
    6764Group:      System Environment/Libraries
    6865
     66# For os2_dos_path, os2_langdir etc. macros
     67Requires: os2-rpm >= 0-4
     68# For -e in scriptlets
     69Requires: rpm >= 4.9
     70
    6971%description -n lib%{name}
    7072%{descr_brief}
     
    7375
    7476%files -n lib%{name}
    75 %defattr(-,root,root,-)
    7677%doc %{pkg_docdir}/
    7778%exclude %{pkg_docdir}/odinuser.inf
     
    8081%endif
    8182%if "%{odin_bindir}" != "%{_bindir}"
    82 %{odin_bindir}/
    83 %else
     83%dir %{odin_bindir}/
     84%endif
    8485%{odin_bindir}/*.exe
    85 %endif
    8686%exclude %{odin_bindir}/pe.exe
    8787%exclude %{odin_bindir}/pec.exe
    8888%exclude %{odin_bindir}/xx2lx.exe
    8989%if "%{odin_systemdir}" != "%{odin_libdir}"
    90 %{odin_systemdir}/
    91 %else
    92 %{odin_systemdir}/*
    93 %endif
     90%dir %{odin_systemdir}/
     91%endif
     92%{odin_systemdir}/*.dll
    9493%exclude %{odin_systemdir}/capi2032.dll
    9594%exclude %{odin_systemdir}/secur32.dll
    9695%exclude %{odin_systemdir}/schannel.dll
     96%dir %{odin_sysexedir}/
     97%{odin_sysexedir}/*.exe
    9798%if 0%{?have_win32k}
    9899%exclude %{odin_systemdir}/win32k.sys
    99 %exclude %{odin_systemdir}/win32kCC.exe
    100 %exclude %{odin_systemdir}/kRx.exe
     100%exclude %{odin_sysexedir}/win32kCC.exe
     101%exclude %{odin_sysexedir}/kRx.exe
    101102%endif
    102103# 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
     104%ghost %{odin_systemdir}/Drivers/
     105%ghost %{odin_systemdir}/Drivers/etc/
     106%ghost %{odin_systemdir}/ODIN.INI
    106107# files/directories generated by odininst.exe preserved on uninstall
    107 %attr(0755,root,root) %ghost %config %{odin_windowsdir}/
     108%ghost %config %{odin_windowsdir}/
    108109
    109110%pre -n lib%{name}
     
    115116%warpin_conflicts_end
    116117
    117 %post -n lib%{name}
    118 
    119 ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
    120 ODIN_BINDIR_D="$(echo %{odin_bindir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
    121 
    122 CFGSYS_CHANGED=
     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
    123123%if "%{odin_systemdir}" != "%{_libdir}"
    124124export ODIN_SYSTEMDIR_D
    125125%cube {ADDSTRING ";%ODIN_SYSTEMDIR_D%" IN "LIBPATH=" (FIRST AFTER} %{os2_config_sys} >nul
    126 CFGSYS_CHANGED=y
    127126%endif
    128127%if "%{odin_bindir}" != "%{_bindir}"
    129128export ODIN_BINDIR_D
    130129%cube {ADDSTRING ";%ODIN_BINDIR_D%" IN "SET PATH=" (FIRST AFTER} %{os2_config_sys} >nul
    131 CFGSYS_CHANGED=y
    132 %endif
    133 if [ -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
    138 fi
    139 
    140 #initialize system directories, registry and INI files
    141 ODIN_WINDOWSDIR_D=$(echo "%{odin_windowsdir}" | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')
    142 echo \
    143 "[DEVDIRECTORIES]
     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]
    144137WINDOWS=$ODIN_WINDOWSDIR_D
    145 " \
    146 > "%{odin_systemdir}/ODIN.INI"
    147 echo \
    148 "[ODINSYSTEM]
    149 PE_EXE=$ODIN_BINDIR_D\\PE.EXE
    150 PEC_EXE=$ODIN_BINDIR_D\\PEC.EXE
    151 W16ODIN_EXE=$ODIN_BINDIR_D\\W16ODIN.EXE
    152 " \
    153 >> "%{odin_systemdir}/ODIN.INI"
    154 # mkdir -p fails on /@unixroot, replace it with the real value
    155 mkdir -p "$(echo %{odin_windowsdir} | sed -re 's,/@unixroot,'$UNIXROOT',g')"
    156 (cd "%{odin_systemdir}/"; "%{odin_systemdir}"/odininst.exe)
    157 ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
     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
    158148rexxtry.cmd 1>nul 2>nul <<EOF
    159149call rxfuncadd SysIni, rexxutil, SysIni
     
    162152EOF
    163153
    164 %postun -n lib%{name}
     154%postun -n lib%{name} -e
    165155
    166156if [ "$1" -eq 0 ]; then # (upon removal)
    167     rexxtry.cmd 1>nul 2>nul <<EOF
     157  rexxtry.cmd 1>nul 2>nul <<EOF
    168158call rxfuncadd SysIni, rexxutil, SysIni
    169159call SysIni 'USER', 'KLIBC', 'OdinPath', 'DELETE:'
     
    171161EOF
    172162
    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
     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
    189171fi
    190172
     
    210192
    211193%files -n lib%{name}-capi20
    212 %defattr(-,root,root,-)
    213194%{odin_systemdir}/capi2032.dll
    214195
     
    234215
    235216%files -n lib%{name}-security
    236 %defattr(-,root,root,-)
    237217%{odin_systemdir}/secur32.dll
     218%{odin_systemdir}/schannel.dll
    238219
    239220#------------------------------------------------------------------------------
     
    256237
    257238%files exe-tools
    258 %defattr(-,root,root,-)
    259239%{odin_bindir}/pe.exe
    260240%{odin_bindir}/pec.exe
     
    283263
    284264%files win32k
    285 %defattr(-,root,root,-)
    286265%{odin_systemdir}/win32k.sys
    287 %{odin_systemdir}/win32kCC.exe
    288 %{odin_systemdir}/kRx.exe
    289 
    290 %post win32k
    291 export ODIN_SYSTEMDIR_D="$(echo %{odin_systemdir} | sed -re 's,/@unixroot,'$UNIXROOT',g' -e 's,/,\\,g')"
     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}}}"
    292271%cube {ADDLINE "DEVICE=%ODIN_SYSTEMDIR_D%\win32k.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
    293 echo; echo "NOTE:"
    294 echo; echo "The boot configuration has been changed. You need to reboot your"
    295 echo "computer in order to activate these changes."
    296 echo
    297 
    298 %postun win32k
     272
     273%postun win32k -e
    299274if [ "$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
     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
    306277fi
    307278
     
    329300%post doc
    330301if [ "$1" -ge 1 ]; then # (upon update)
    331     %wps_object_delete_all -n %{name}-doc
     302  %wps_object_delete_all -n %{name}-doc
    332303fi
    333304%wps_object_create_begin -n %{name}-doc
     
    342313%postun doc
    343314if [ "$1" -eq 0 ]; then # (upon removal)
    344     %wps_object_delete_all -n %{name}-doc
     315  %wps_object_delete_all -n %{name}-doc
    345316fi
    346317
    347318#------------------------------------------------------------------------------
     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#------------------------------------------------------------------------------
    348326%prep
    349327#------------------------------------------------------------------------------
    350328
    351 %if 0%{?test_mode}
    352 %setup -TD
    353 %else
    354 # @todo move the zip to the right place!
    355 %setup -q
    356 %endif
     329%scm_setup
    357330
    358331#------------------------------------------------------------------------------
     
    360333#------------------------------------------------------------------------------
    361334
     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
    362346#------------------------------------------------------------------------------
    363347%install
    364348#------------------------------------------------------------------------------
    365349
    366 rm -rf %{buildroot}
    367 
    368 mkdir -p %{buildroot}%{pkg_docdir}
    369 cp *.txt %{buildroot}%{pkg_docdir}/
    370 cp LICENSE.TXT %{buildroot}%{pkg_docdir}/
    371 cp ChangeLog %{buildroot}%{pkg_docdir}/
    372 cp WGSS50.lic %{buildroot}%{pkg_docdir}/
    373 cp odinuser.inf %{buildroot}%{pkg_docdir}/
    374 
    375 mkdir -p %{buildroot}%{odin_windowsdir}/
    376 
    377 mkdir -p %{buildroot}%{odin_systemdir}/
    378 cp -dp system32/*.dll %{buildroot}%{odin_systemdir}/
     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}/
    379372%if 0%{?have_win32k}
    380 cp -dp system32/win32k.sys %{buildroot}%{odin_systemdir}/
    381 %endif
    382 
    383 mkdir -p %{buildroot}%{odin_bindir}/
    384 cp -dp system32/*.exe %{buildroot}%{odin_bindir}/
    385 
    386 # these are internal tools that should not be in PATH
    387 mv %{buildroot}%{odin_bindir}/odininst.exe %{buildroot}%{odin_systemdir}/
    388 %if 0%{?have_win32k}
    389 mv %{buildroot}%{odin_bindir}/win32kCC.exe %{buildroot}%{odin_systemdir}/
    390 mv %{buildroot}%{odin_bindir}/kRx.exe %{buildroot}%{odin_systemdir}/
    391 %endif
     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
    392388
    393389#------------------------------------------------------------------------------
     
    396392
    397393%if !0%{?test_mode}
    398 rm -rf %{buildroot}
     394%{__rm} -rf %{buildroot}
    399395%endif
    400396
    401397#------------------------------------------------------------------------------
    402398%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.
    403405
    404406* Sun Feb 17 2013 Dmitriy Kuminov <coding/dmik.org> - 0.8.9-1
    405 - <List changes here>
     407- New release 0.8.9. See %{pkg_docdir}/ChangeLog for more information.
    406408
    407409* Mon Dec 31 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.8-1
     
    420422- New release 0.8.4. See %{pkg_docdir}/ChangeLog for more information.
    421423
    422 * Mon Feb 07 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.3-1
     424* Tue Feb 07 2012 Dmitriy Kuminov <coding/dmik.org> - 0.8.3-1
    423425- New release 0.8.3. See %{pkg_docdir}/ChangeLog for more information.
    424426
Note: See TracChangeset for help on using the changeset viewer.