| 1 | Summary: IBM OS/2 Developer's Toolkit Version 4.5 | 
|---|
| 2 | Name: os2tk45 | 
|---|
| 3 | Version: 4.5.2 | 
|---|
| 4 | Release: 2%{?dist} | 
|---|
| 5 | Group: System Environment/Libraries | 
|---|
| 6 | License: IBM | 
|---|
| 7 | Vendor: bww bitwise works GmbH | 
|---|
| 8 |  | 
|---|
| 9 | %define github_name os2tk45 | 
|---|
| 10 | %define github_url  https://github.com/bitwiseworks/%{github_name}/archive | 
|---|
| 11 | %define github_rev  660fdb07c929623bd9043c88f2734f08c741e714 | 
|---|
| 12 |  | 
|---|
| 13 | Source: %{github_name}-%{github_rev}.zip | 
|---|
| 14 |  | 
|---|
| 15 | BuildRequires: curl zip | 
|---|
| 16 |  | 
|---|
| 17 | # os2-base 0.0.0-12 sets up BOOK and HELP for UNIXROOT in config.sys | 
|---|
| 18 | Requires: os2-base >= 0.0.0-12 | 
|---|
| 19 |  | 
|---|
| 20 | # Act like a meta-package and install all essential subpackages | 
|---|
| 21 | Requires: %{name}-headers = %{version} | 
|---|
| 22 | Requires: %{name}-libs = %{version} | 
|---|
| 23 | Requires: %{name}-books = %{version} | 
|---|
| 24 |  | 
|---|
| 25 | %description | 
|---|
| 26 | The IBM OS/2 Developer's Toolkit Version 4.5 provides development support | 
|---|
| 27 | for new features in the "OS/2 Warp Server for e-business" operating system | 
|---|
| 28 | and eComStation. | 
|---|
| 29 |  | 
|---|
| 30 | %package readme | 
|---|
| 31 | Summary: IBM OS/2 Developer's Toolkit readme | 
|---|
| 32 | BuildArch: noarch | 
|---|
| 33 |  | 
|---|
| 34 | %description readme | 
|---|
| 35 | Provides IBM OS/2 Developer's Toolkit readme and changelog files. | 
|---|
| 36 |  | 
|---|
| 37 | %package headers | 
|---|
| 38 | Summary: IBM OS/2 Developer's Toolkit headers | 
|---|
| 39 | Requires: %{name}-readme = %{version}-%{release} | 
|---|
| 40 | BuildArch: noarch | 
|---|
| 41 |  | 
|---|
| 42 | %description headers | 
|---|
| 43 | Provides IBM OS/2 Developer's Toolkit header files. | 
|---|
| 44 |  | 
|---|
| 45 | %package libs | 
|---|
| 46 | Summary: IBM OS/2 Developer's Toolkit libraries | 
|---|
| 47 | Requires: %{name}-readme = %{version}-%{release} | 
|---|
| 48 | BuildArch: noarch | 
|---|
| 49 |  | 
|---|
| 50 | %description libs | 
|---|
| 51 | Provides IBM OS/2 Developer's Toolkit library files. | 
|---|
| 52 |  | 
|---|
| 53 | %package books | 
|---|
| 54 | Summary: IBM OS/2 Developer's Toolkit books | 
|---|
| 55 | Requires: %{name}-readme = %{version}-%{release} | 
|---|
| 56 | BuildArch: noarch | 
|---|
| 57 |  | 
|---|
| 58 | %description books | 
|---|
| 59 | Provides IBM OS/2 Developer's Toolkit book files in INF and HLP formats. | 
|---|
| 60 |  | 
|---|
| 61 | %prep | 
|---|
| 62 | %if %(sh -c 'if test -f "%{_sourcedir}/%{github_name}-%{github_rev}.zip" ; then echo 1 ; else echo 0 ; fi') | 
|---|
| 63 | %setup -n "%{github_name}-%{github_rev}" -q | 
|---|
| 64 | %else | 
|---|
| 65 | %setup -n "%{github_name}-%{github_rev}" -Tc | 
|---|
| 66 | rm -f "%{_sourcedir}/%{github_name}-%{github_rev}.zip" | 
|---|
| 67 | curl -sSL "%{github_url}/%{github_rev}.zip" -o "%{_sourcedir}/%{github_name}-%{github_rev}.zip" | 
|---|
| 68 | unzip "%{_sourcedir}/%{github_name}-%{github_rev}.zip" -d .. | 
|---|
| 69 | %endif | 
|---|
| 70 |  | 
|---|
| 71 | %build | 
|---|
| 72 |  | 
|---|
| 73 | %install | 
|---|
| 74 |  | 
|---|
| 75 | mkdir -p %{buildroot}%{_includedir}/os2tk45 | 
|---|
| 76 | cp -pR h/* %{buildroot}%{_includedir}/os2tk45/ | 
|---|
| 77 | # copy inc directory inside to avoid one more dir under include | 
|---|
| 78 | cp -pR inc %{buildroot}%{_includedir}/os2tk45/ | 
|---|
| 79 | # remove LIBC stuff, will go to a separate subpackage one day | 
|---|
| 80 | rm -rf %{buildroot}%{_includedir}/os2tk45/libc | 
|---|
| 81 | # remove SOM stuff, it will go to a separate subpackage one day | 
|---|
| 82 | rm %{buildroot}%{_includedir}/os2tk45/wincfg.*h | 
|---|
| 83 | rm %{buildroot}%{_includedir}/os2tk45/wp*.*h | 
|---|
| 84 |  | 
|---|
| 85 | mkdir -p %{buildroot}%{_libdir} | 
|---|
| 86 | cp -pR lib/* %{buildroot}%{_libdir}/ | 
|---|
| 87 | # remove LIBC stuff, will go to a separate subpackage one day | 
|---|
| 88 | rm %{buildroot}%{_libdir}/libc*.lib | 
|---|
| 89 |  | 
|---|
| 90 | mkdir -p %{buildroot}%{_datadir}/os2/book | 
|---|
| 91 | cp -p book/* %{buildroot}%{_datadir}/os2/book/ | 
|---|
| 92 |  | 
|---|
| 93 | %files | 
|---|
| 94 |  | 
|---|
| 95 | %files readme | 
|---|
| 96 | %doc readme | 
|---|
| 97 | %doc changelog | 
|---|
| 98 |  | 
|---|
| 99 | %files headers | 
|---|
| 100 | %{_includedir}/os2tk45 | 
|---|
| 101 |  | 
|---|
| 102 | %files libs | 
|---|
| 103 | %{_libdir}/*.lib | 
|---|
| 104 |  | 
|---|
| 105 | %files books | 
|---|
| 106 | %{_datadir}/os2/book/* | 
|---|
| 107 |  | 
|---|
| 108 | %post headers | 
|---|
| 109 | if [ "$1" = 1 ] ; then | 
|---|
| 110 | # execute only on first install | 
|---|
| 111 | %cube {ADDSTRING "%UNIXROOT%\usr\include\os2tk45\inc;%UNIXROOT%\usr\include\os2tk45\gl;%UNIXROOT%\usr\include\os2tk45;" IN "SET INCLUDE=" (FIRST IFNEW BEFORE ADDBOTTOM RS(%%)} c:\config.sys > NUL | 
|---|
| 112 | fi | 
|---|
| 113 |  | 
|---|
| 114 | %postun headers | 
|---|
| 115 | if [ "$1" = 0 ] ; then | 
|---|
| 116 | # execute only on last uninstall | 
|---|
| 117 | %cube {DELSTRING "%UNIXROOT%\usr\include\os2tk45\inc;%UNIXROOT%\usr\include\os2tk45\gl;%UNIXROOT%\usr\include\os2tk45;" IN "SET INCLUDE=" (FIRST RS(%%)} c:\config.sys > NUL | 
|---|
| 118 | fi | 
|---|
| 119 |  | 
|---|
| 120 | %post libs | 
|---|
| 121 | if [ "$1" = 1 ] ; then | 
|---|
| 122 | # execute only on first install | 
|---|
| 123 | %cube {ADDSTRING "%UNIXROOT%\usr\lib;" IN "SET LIB=" (FIRST IFNEW BEFORE ADDBOTTOM RS(%%)} c:\config.sys > NUL | 
|---|
| 124 | fi | 
|---|
| 125 |  | 
|---|
| 126 | %postun libs | 
|---|
| 127 | if [ "$1" = 0 ] ; then | 
|---|
| 128 | # execute only on last uninstall | 
|---|
| 129 | fi | 
|---|
| 130 |  | 
|---|
| 131 | %post books | 
|---|
| 132 | if [ "$1" = 1 ] ; then | 
|---|
| 133 | # execute only on first install | 
|---|
| 134 | %cube {REPLINE "SET CPREF=" WITH "SET CPREF=CP1.INF+CP2.INF+CP3.INF" (ADDBOTTOM} c:\config.sys > NUL | 
|---|
| 135 | %cube {REPLINE "SET GPIREF=" WITH "SET GPIREF=GPI1.INF+GPI2.INF+GPI3.INF+GPI4.INF" (ADDBOTTOM} c:\config.sys > NUL | 
|---|
| 136 | %cube {REPLINE "SET MMREF=" WITH "SET MMREF=MMREF1.INF+MMREF2.INF+MMREF3.INF" (ADDBOTTOM} c:\config.sys > NUL | 
|---|
| 137 | %cube {REPLINE "SET PMREF=" WITH "SET PMREF=PM1.INF+PM2.INF+PM3.INF+PM4.INF+PM5.INF" (ADDBOTTOM} c:\config.sys > NUL | 
|---|
| 138 | %cube {REPLINE "SET WPSREF=" WITH "SET WPSREF=WPS1.INF+WPS2.INF+WPS3.INF" (ADDBOTTOM} c:\config.sys > NUL | 
|---|
| 139 | fi | 
|---|
| 140 |  | 
|---|
| 141 | %postun books | 
|---|
| 142 | if [ "$1" = 0 ] ; then | 
|---|
| 143 | # execute only on last uninstall | 
|---|
| 144 | %cube {DELLINE "SET CPREF="} c:\config.sys > NUL | 
|---|
| 145 | %cube {DELLINE "SET GPIREF="} c:\config.sys > NUL | 
|---|
| 146 | %cube {DELLINE "SET MMREF="} c:\config.sys > NUL | 
|---|
| 147 | %cube {DELLINE "SET PMREF="} c:\config.sys > NUL | 
|---|
| 148 | %cube {DELLINE "SET WPSREF="} c:\config.sys > NUL | 
|---|
| 149 | fi | 
|---|
| 150 |  | 
|---|
| 151 | %changelog | 
|---|
| 152 | * Wed Jan 27 2016 Dmitriy Kuminov <coding@dmik.org> 4.5.2-2 | 
|---|
| 153 | - Add libs package. | 
|---|
| 154 | - Remove LIBC related files from headers and libraries. | 
|---|
| 155 |  | 
|---|
| 156 | * Wed Jan 27 2016 Dmitriy Kuminov <coding@dmik.org> 4.5.2-1 | 
|---|
| 157 | - Initial package for Toolkit version 4.5.2. | 
|---|
| 158 | - Remove ancient DOS EOF symbol (0x1A) from headers. | 
|---|