Commit 1daae25
authored
Packaging: Enable RPM package relocation via --prefix
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.
Assisted-by: Claude Code
Assisted-by: DeepSeek1 parent 83022b5 commit 1daae25
6 files changed
Lines changed: 169 additions & 37 deletions
File tree
- .github/workflows
- devops/build/packaging/rpm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
664 | 667 | | |
665 | 668 | | |
666 | 669 | | |
| |||
920 | 923 | | |
921 | 924 | | |
922 | 925 | | |
923 | | - | |
| 926 | + | |
924 | 927 | | |
925 | | - | |
| 928 | + | |
926 | 929 | | |
927 | 930 | | |
928 | 931 | | |
| |||
942 | 945 | | |
943 | 946 | | |
944 | 947 | | |
945 | | - | |
| 948 | + | |
946 | 949 | | |
947 | 950 | | |
948 | 951 | | |
| |||
1330 | 1333 | | |
1331 | 1334 | | |
1332 | 1335 | | |
1333 | | - | |
| 1336 | + | |
1334 | 1337 | | |
1335 | 1338 | | |
1336 | 1339 | | |
| |||
1423 | 1426 | | |
1424 | 1427 | | |
1425 | 1428 | | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1426 | 1433 | | |
1427 | 1434 | | |
1428 | 1435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
663 | 666 | | |
664 | 667 | | |
665 | 668 | | |
| |||
919 | 922 | | |
920 | 923 | | |
921 | 924 | | |
922 | | - | |
| 925 | + | |
923 | 926 | | |
924 | | - | |
| 927 | + | |
925 | 928 | | |
926 | 929 | | |
927 | 930 | | |
| |||
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
944 | | - | |
| 947 | + | |
945 | 948 | | |
946 | 949 | | |
947 | 950 | | |
| |||
1329 | 1332 | | |
1330 | 1333 | | |
1331 | 1334 | | |
1332 | | - | |
| 1335 | + | |
1333 | 1336 | | |
1334 | 1337 | | |
1335 | 1338 | | |
| |||
1414 | 1417 | | |
1415 | 1418 | | |
1416 | 1419 | | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1417 | 1424 | | |
1418 | 1425 | | |
1419 | 1426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
662 | 665 | | |
663 | 666 | | |
664 | 667 | | |
| |||
918 | 921 | | |
919 | 922 | | |
920 | 923 | | |
921 | | - | |
| 924 | + | |
922 | 925 | | |
923 | | - | |
| 926 | + | |
924 | 927 | | |
925 | 928 | | |
926 | 929 | | |
| |||
940 | 943 | | |
941 | 944 | | |
942 | 945 | | |
943 | | - | |
| 946 | + | |
944 | 947 | | |
945 | 948 | | |
946 | 949 | | |
| |||
1328 | 1331 | | |
1329 | 1332 | | |
1330 | 1333 | | |
1331 | | - | |
| 1334 | + | |
1332 | 1335 | | |
1333 | 1336 | | |
1334 | 1337 | | |
| |||
1421 | 1424 | | |
1422 | 1425 | | |
1423 | 1426 | | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1424 | 1431 | | |
1425 | 1432 | | |
1426 | 1433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
506 | 509 | | |
507 | 510 | | |
508 | 511 | | |
| |||
723 | 726 | | |
724 | 727 | | |
725 | 728 | | |
726 | | - | |
| 729 | + | |
727 | 730 | | |
728 | | - | |
| 731 | + | |
729 | 732 | | |
730 | 733 | | |
731 | 734 | | |
| |||
745 | 748 | | |
746 | 749 | | |
747 | 750 | | |
748 | | - | |
| 751 | + | |
749 | 752 | | |
750 | 753 | | |
751 | 754 | | |
| |||
1095 | 1098 | | |
1096 | 1099 | | |
1097 | 1100 | | |
1098 | | - | |
| 1101 | + | |
1099 | 1102 | | |
1100 | 1103 | | |
1101 | 1104 | | |
| |||
Lines changed: 100 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
19 | 43 | | |
20 | | - | |
21 | 44 | | |
22 | 45 | | |
23 | 46 | | |
| |||
27 | 50 | | |
28 | 51 | | |
29 | 52 | | |
30 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
31 | 58 | | |
32 | 59 | | |
33 | 60 | | |
| |||
37 | 64 | | |
38 | 65 | | |
39 | 66 | | |
40 | | - | |
| 67 | + | |
41 | 68 | | |
42 | 69 | | |
43 | 70 | | |
44 | | - | |
| 71 | + | |
45 | 72 | | |
46 | 73 | | |
47 | 74 | | |
| |||
62 | 89 | | |
63 | 90 | | |
64 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
65 | 96 | | |
66 | 97 | | |
67 | 98 | | |
| |||
105 | 136 | | |
106 | 137 | | |
107 | 138 | | |
| 139 | + | |
108 | 140 | | |
109 | 141 | | |
110 | 142 | | |
| |||
145 | 177 | | |
146 | 178 | | |
147 | 179 | | |
148 | | - | |
| 180 | + | |
149 | 181 | | |
150 | 182 | | |
151 | 183 | | |
152 | 184 | | |
153 | 185 | | |
154 | 186 | | |
155 | 187 | | |
156 | | - | |
| 188 | + | |
| 189 | + | |
157 | 190 | | |
158 | 191 | | |
159 | 192 | | |
160 | 193 | | |
161 | 194 | | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 195 | + | |
166 | 196 | | |
167 | 197 | | |
168 | | - | |
169 | | - | |
| 198 | + | |
| 199 | + | |
170 | 200 | | |
171 | 201 | | |
172 | 202 | | |
173 | 203 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
178 | 241 | | |
179 | 242 | | |
| 243 | + | |
| 244 | + | |
180 | 245 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
185 | 262 | | |
| 263 | + | |
| 264 | + | |
0 commit comments