tuhaihe commented on PR #1758:
URL: https://github.com/apache/cloudberry/pull/1758#issuecomment-5056385888
Updates:
```
Rework the RPM packaging so Cloudberry can be installed to a custom
location and so multiple major versions can coexist, aligning the
behavior with Greenplum's packaging model.
Relocation (rpm --prefix):
- Split the hardcoded install path into base_dir + name components and
set Prefix to the base directory (/usr/local) so RPM's relocate
engine can substitute it correctly.
- Move the convenience symlink out of %files and create it in %post
using RPM_INSTALL_PREFIX, so it follows the actual --prefix (with a
fallback to the default base_dir). %postun removes the symlink only
when it still points to the version being erased.
- Disable build-id links so they are not emitted outside the
relocatable prefix.
Major-version coexistence:
- Embed the major version in the package Name
(apache-cloudberry-db-incubating-<major>), derived from %{version},
so different major versions register as distinct packages and can be
installed side by side (dnf) or under separate prefixes (rpm -i).
- Obsolete the previous unversioned package name on upgrade; this does
not match the versioned names, so majors still coexist.
- In %post, move the generic symlink only when the existing target is
the same major version, leaving other majors untouched. The version
is parsed from the target directory name rather than by sourcing
environment files or executing installed binaries.
- Keep the published file name in the historical format (without the
"-<major>" segment) by renaming artifacts in build-rpm.sh; the file
name does not affect the Name/Version stored in the RPM header.
Packaging correctness and hardening:
- Stop changing installed files to gpadmin ownership in %post; the
package tree stays root-owned.
- Do not expose bundled private shared libraries (libpq.so.5, etc.) as
Provides, and do not require them from the system; they ship in the
package and are resolved via RPATH.
- Validate that version/release macros are supplied, mark
cloudberry-env.sh as %config(noreplace), copy the tree with cp -a to
preserve hidden files and attributes, add coreutils scriptlet
dependencies, add python3 to the el9 runtime requires, and update the
license tag to the SPDX identifier Apache-2.0.
CI workflows:
- Query the installed package by glob (rpm -qa 'apache-...*') instead of
the fixed name, since the registered Name now carries the major.
- Keep locating the published artifact by its historical file name,
which build-rpm.sh restores after the build.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]