Repository navigation
Conversation
- Use explicit RPM boolean rich dependencies in Requires: (libcurl($FARCH) or libcurl4($FARCH)) and (libgcc($FARCH) or libgcc_s1($FARCH)) so the Fedora and openSUSE RPMs are cross-compatible across Fedora, openSUSE Leap 15/16/Tumbleweed, and RHEL/Rocky Linux. - Use cross-distro Recommends: for 32-bit multilib packages: (glibc-devel(x86-32) or glibc-devel-32bit), (libgcc(x86-32) or libgcc_s1-32bit), and (libcurl(x86-32) or libcurl4-32bit) so 64-bit-only systems are not blocked and fixed the invalid gcc-32bit($FARCH) typo. - Exclude bundled 32-bit /usr/lib/libphobos2.so* from automatic requirement generation via __requires_exclude_from on x86_64 packages. - Add Provides and Obsoletes for phobos-devel, phobos-devel-static, and dub to avoid file collisions when upgrading over split openSUSE packages. - Allow dmd_rpm.sh to run on build environments with /etc/os-release and make fakeroot optional if rpmbuild is available.
|
Tested on Fedora 44, Leap 16, Tumbleweed, Alma 8 and 9 with dmd 2.110.0. It works, with one bug. The 32-bit require exclusion does the job. Without it the 32-bit libphobos pulls libgcc_s.so.1 and friends into the 64-bit package. Rich deps resolve on all of these distros. Leap 16 upgrades over the distro split stack cleanly. The fakeroot and _topdir/_tmppath changes work too. The bug: Obsoletes: libphobos2-0_109 is hardcoded, but this script builds every release. A 2.110 build has soname .so.0.110, and Tumbleweed already ships libphobos2-0_113. Derive the name from SO_VERSION instead. Smaller stuff:
|
- Derive PHOBOS_LIB_PKG dynamically from SO_VERSION (libphobos2-0_xxx) - Use Suggests: instead of Recommends: for 32-bit multilib packages - Avoid mixing version namespaces on dub fallback - Inspect ID and ID_LIKE in /etc/os-release - Specify RHEL/Rocky/CentOS 8+ in readme
|
Thanks a lot for the thorough review and testing across the 5 container distributions, @dejlek! I have addressed all the points in the latest commit (
|
|
Retested the new commit. The obsoletes name, Suggests, the os-release check and the readme are all good now. Two things left. Obsoletes: dub <= $DUB_VER still misses a newer distro dub. On Tumbleweed the upgrade aborts on a /usr/bin/dub conflict when the distro dub is newer than the bundled one. An unversioned Obsoletes: dub is the only reliable fix. And the dub version goes into the metadata unchecked. When dub --version printed something unexpected I got dub = run-0 in Provides and Obsoletes. Validate the format and fall back when it does not match. One behavior change worth knowing: the derived obsoletes name means a soname bump leaves the old libphobos2 package orphaned. Harmless, since the file names differ, but different from before. |
Summary of Changes
This PR modernizes the RPM packaging in
linux/dmd_rpm.shto fix compatibility on openSUSE Leap 16, openSUSE Tumbleweed, Rocky Linux / RHEL, and Fedora:RPM Boolean Rich Dependencies (
Requires:):(libcurl($FARCH) or libcurl4($FARCH))and(libgcc($FARCH) or libgcc_s1($FARCH)).libcurl4is used (there is nolibcurlorlibcurl4-32bit). On Fedora/RHEL,libcurlis used. This allows the RPM packages to be cross-compatible across all RPM-based distros.32-bit Multilib Isolation & Weak Dependencies (
Recommends:):/usr/lib/libphobos2.so*) previously caused RPM'sfind-requiresto inject an automatic 32-bitRequires: libgcc_s.so.1into the 64-bit package, which fails on standard 64-bit systems where 32-bitlibgcc_s.so.1is not installed by default. Added%global __requires_exclude_from ^/usr/lib/libphobos2\\.so.*$onx86_64to prevent this leak.glibc-devel(x86-32) or glibc-devel-32bit,libgcc(x86-32) or libgcc_s1-32bit,libcurl(x86-32) or libcurl4-32bit) from hardRequires:toRecommends:. This prevents installation failures on 64-bit-only installations while still pulling in multilib packages when requested/available.gcc-32bit($FARCH)evaluated to non-existentgcc-32bit(x86-64).Smooth openSUSE Upgrades (
Provides:&Obsoletes:):ProvidesandObsoletesforphobos-devel,phobos-devel-static, anddubto prevent file conflicts when upgrading over openSUSE's distribution-split packages.Build System Compatibility:
/etc/os-releasesodmd_rpm.shcan be executed on any modern Linux distribution.fakerootoptional ifrpmbuildis already installed._topdirand_tmppathto ensure clean builds in unprivileged or containerized build environments.