| 167 | == Handling documentation in Info format == |
| 168 | |
| 169 | Many packages provide extended documentation in Info format (`.info` files in `/@unixroot/usr/share/info`). These `.info` files need special processing when the package is installed (and removed) so that the Info reader could properly find them. Many `.spec` files already contain the required commands but they need tailoring to OS/2. This tailoring is rather easy and consists of 3 steps. |
| 170 | |
| 171 | 1. Fix the `Requires:` statements. You will usually find this in a `.spec` file: |
| 172 | {{{ |
| 173 | #Requires(post): /sbin/install-info |
| 174 | #Requires(preun): /sbin/install-info |
| 175 | }}} |
| 176 | Replace this block with these lines: |
| 177 | {{{ |
| 178 | # @todo Replace with `%info_requires` when it's available. |
| 179 | Requires(post): %{_sbindir}/install-info.exe |
| 180 | Requires(preun): %{_sbindir}/install-info.exe |
| 181 | }}} |
| 182 | |
| 183 | 2. Fix the post-install script. Replace lines looking like this: |
| 184 | {{{ |
| 185 | %post |
| 186 | /sbin/install-info %{_infodir}/foobar.info %{_infodir}/dir 2>/dev/null || : |
| 187 | }}} |
| 188 | with this: |
| 189 | {{{ |
| 190 | %post |
| 191 | # @todo Replace with `%info_post foobar.info` when it's available. |
| 192 | if [ -f %{_infodir}/foobar.info ]; then |
| 193 | %{_sbindir}/install-info.exe %{_infodir}/foobar.info %{_infodir}/dir || : |
| 194 | fi |
| 195 | }}} |
| 196 | |
| 197 | 3. Fix the pre-uninstall script. Replace lines looking like this: |
| 198 | {{{ |
| 199 | %preun |
| 200 | if [ $1 -eq 0 ]; then |
| 201 | /sbin/install-info --delete %{_infodir}/help2man.info \ |
| 202 | %{_infodir}/dir 2>/dev/null || : |
| 203 | fi |
| 204 | }}} |
| 205 | with this: |
| 206 | {{{ |
| 207 | %preun |
| 208 | # @todo Replace with `%info_preun foobar.info` when it's available. |
| 209 | if [ $1 -eq 0 ]; then |
| 210 | if [ -f %{_infodir}/foobar.info ]; then |
| 211 | %{_sbindir}/install-info.exe --delete %{_infodir}/foobar.info %{_infodir}/dir || : |
| 212 | fi |
| 213 | fi |
| 214 | }}} |
| 215 | |
| 216 | Note that the lines you insert contain a `@todo` block which you should leave in. It is to remind to replace these lines with simpler constructs when #119 is fixed. |
| 217 | |