| 391 | == Generating legacy runtime packages == |
| 392 | |
| 393 | Many dynamic libraries use versioning in DLL names to express incompatible ABI changes (i.e. if the old version is named `libxyz1.dll`, the new one becomes `libxyz2.dll` and so on). This way, an old application built against `libxyz1.dll` will continue to work even when `libxyz2.dll` gets installed. However, this popular deployment approach is not directly supported by RPM (you cannot have two versions of the same package installed at the same time, even if the file names differ). |
| 394 | |
| 395 | In order to nicely solve this problem, an extension was added to RPM for OS/2 that allows users to have two incompatible versions of the same runtime DLL installed side by side and at the same time keep the normal package update functionality fully intact. This extension works in a fully automatic manner, provided that the packager uses the source:/rpmbuild-bot script. |
| 396 | |
| 397 | Given a package named `package`, the following steps need to be done in order to generate legacy runtime packages with `rpmbuild-bot.sh`: |
| 398 | |
| 399 | ==== 1. Add a rpmbuild-bot configuration entry ==== |
| 400 | |
| 401 | Add an entry named `RPMBUILD_BOT_LEGACY_package` to `rpmbuild-bot-env.sh` containing a package specification string in the following format: |
| 402 | {{{ |
| 403 | ABI|NAME|VERSION-RELEASE|[FILEMASK]|[ARCH] |
| 404 | }}} |
| 405 | ABI is the ABI version (normally, a suffix added to the DLL basename to differentiate between incompatible DLL versions), NAME is a name of the old package where to take the DLL from (usually is the same as `package`), VERSION-RELEASE is the version of the old package and FILEMASK is a file mask for runtime DLLs (by default, `*.dll`). You may specify more than one ABI specification (separated by a space) tho this variable if you need to provide more than one version of legacy runtime DLLs. |
| 406 | |
| 407 | Given the above information, `rpmbuild-bot` will automatically extract the runtime DLLs from the specified RPM package located in the stable repository (the one specified in a`RPMBUILD_BOT_UPLOAD_REPO_STABLE` variable) and make these DLLs available for `rpmbuild` by storing them in a SOURCES directory of its directory tree. |
| 408 | |
| 409 | Note that `rpmbuild-bot` will properly handle all supported target platforms (as specified in `RPMBUILD_BOT_ARCH_LIST`) when extracting old runtime DLLs in order to make sure that the automatically generated legacy sub-package will carry a DLL built for the same target platform as the main package. If an old version of the DLL didn't exist for this platform, `rpmbuild-bot` will fail. In such a case you should force a specific platform of the old DLL to be used for all target platforms of the new package by using an optional ARCH field in the legacy package specification string. |
| 410 | |
| 411 | ==== 2. Add a magic macro to package.spec ==== |
| 412 | |
| 413 | Add a `%legacy_runtime_packages` macro just before the `%prep` section of the .spec file. This will cause `rpmbuild` to create a sub-package named `package-legacy-ABI` for each ABI listed in the configuration variable for this package. There are a few things to note about the generated legacy sub-packages: |
| 414 | |
| 415 | 1. The legacy sub-package will carry a version and release number of the original package (i.e. the package where the legacy runtime DLL is taken from), not the main package version. This is done to for simpler identification purposes and also to refer to a particular version from other .spec files when necessary. |
| 416 | |
| 417 | 2. The legacy sub-package will have `Provides:` field set to the old version (i.e. the version of the original package) and `Obsoletes:` field set to less or equal to the old version. This serves for two purposes: to provide smooth package updates with `yum update` (it will simply replace the old `package` with the new `package-legacy-ABI`) and also to keep other software packages which still depend on the old runtime installable. |
| 418 | |
| 419 | |