-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow building multiple RPM packages #837
Allow building multiple RPM packages #837
Conversation
%if "%{unstable}" == "false" | ||
Name: tanzu-cli | ||
Provides: tanzu-cli | ||
Obsoletes: tanzu-cli < %{rpm_package_version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that we were using Provides
and Obsoletes
wrongly. Those fields are meant to be used when we rename a package (e.g., tanzu-cli
-> newname-cli
) so that the new package can indicate it replaces the old package. We were not using it correctly. Ref: https://docs.fedoraproject.org/en-US/packaging-guidelines/#renaming-or-replacing-existing-packages
Those fields do not support using a variable, so removing them allowed me to inject the name of the package.
As a separate change, we could use those fields to allow the tanzu-cli
package to replace an already installed tanzu-cli-unstable
package; I tried it and couldn't get it to work quickly, so I left it for later, since it is not relevant to the Centos9 issue.
This allows to have different packages signed with different keys. To achieve this, the building of RPM packages is now done by hack/rpm/build_package.sh while building the final repository is now done by hack/rpm/build_package_repo.sh. This approach allows to call hack/rpm/build_package.sh more than once with different RPM_PACKAGE_NAME and then build the repo with all the new packages as a last step. Signed-off-by: Marc Khouzam <[email protected]>
97ad194
to
59a80d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for all the investigation and reaching to a solution to support centos usecase. 👏
This allows to have different packages signed with different keys. To achieve this, the building of RPM packages is now done by hack/rpm/build_package.sh while building the final repository is now done by hack/rpm/build_package_repo.sh. This approach allows to call hack/rpm/build_package.sh more than once with different RPM_PACKAGE_NAME and then build the repo with all the new packages as a last step. Signed-off-by: Marc Khouzam <[email protected]>
This allows to have different packages signed with different keys. To achieve this, the building of RPM packages is now done by hack/rpm/build_package.sh while building the final repository is now done by hack/rpm/build_package_repo.sh. This approach allows to call hack/rpm/build_package.sh more than once with different RPM_PACKAGE_NAME and then build the repo with all the new packages as a last step. Signed-off-by: Marc Khouzam <[email protected]>
What this PR does / why we need it
This PR splits the RPM package-building script into two scripts:
The first script can be called more than once by specifying the new
RPM_PACKAGE_NAME
with a different name. This allows to build the same RPM package but with a different name, The value in doing this is that a different signer can be used for the different package; for example, a different signing key could be used for a second package.This will allow to build a package specific to Centos8/9 which will be signed with a special key that works on those OS:s.
Which issue(s) this PR fixes
Fixes # N/A
Describe testing done for PR
I have built the package and repo locally using the same make target as before and confirms it builds like before and is installable. This is not a signed package. Notice I fake a version to build a
tanzu-cli
package instead of atanzu-cli-unstable
packageI have build the unstable package ONLY and then built a second unstable package ONLY by overriding the name, which is what we will do for Centos8/9, then built a repo containing both:
I have testing that both packages can be installed using docker.
I've also ran the above tests with the
rpm-*-in-docker
make targets to confirm they work as expected.Release note
Additional information
Special notes for your reviewer