Skip to content
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

Add support for creating relocatable RPM packages using nfpm #640

Closed
2 tasks done
mihaimyh opened this issue Mar 31, 2023 · 6 comments · Fixed by #691
Closed
2 tasks done

Add support for creating relocatable RPM packages using nfpm #640

mihaimyh opened this issue Mar 31, 2023 · 6 comments · Fixed by #691
Assignees
Labels
enhancement New feature or request

Comments

@mihaimyh
Copy link

Is your feature request related to a problem? Please describe.

I am currently using nfpm to create RPM packages, but I have encountered a limitation with the tool: it does not appear to support creating relocatable RPM packages. This restricts the flexibility and usability of the RPM packages generated by nfpm, as users are not able to easily relocate the package to a different installation prefix.

Describe the solution you'd like

I would like to request the addition of a feature that enables the creation of relocatable RPM packages with nfpm. By supporting relocatable packages, users would have the flexibility to install the RPM in a custom location of their choice.

According to the RPM documentation, a relocatable RPM package is defined as follows:

"A relocatable package is an RPM package that can be installed in a different location (or directory) than the default one. This can be useful when a user wants to have the same package installed in multiple locations or when the user does not have write access to the default installation location. To create a relocatable package, the RPM must be built to allow relocation, and the user must specify the installation prefix during the installation."

To implement this feature, nfpm should provide an option or configuration setting that allows users to specify whether the generated RPM package should be relocatable or not. Additionally, it should include the necessary metadata within the RPM package to enable relocation during installation.

Describe alternatives you've considered

An alternative would be to manually create and modify the RPM package to support relocation, but this is not as efficient or convenient as having native support within nfpm.

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

This feature would greatly enhance the usability and flexibility of the RPM packages generated by nfpm, allowing users to have more control over their installations and making the tool even more powerful.

Thank you for considering this feature request.

@mihaimyh mihaimyh added the enhancement New feature or request label Mar 31, 2023
@jarondl
Copy link
Contributor

jarondl commented Jul 9, 2023

This requires google/rpmpack#79, which seems pretty easy to do, I'll give it a shot.

Edit: google/rpmpack#84 is my attempt to allow prefixes. Now nfpm needs to try giving rpmpack a prefix.

@jarondl
Copy link
Contributor

jarondl commented Jul 9, 2023

I somehow missed the fact that nfpm forked rpmpack in #548...... Oh no... WHY would they do that? And if they do this, why not cleanly with a set of patches? I cannot easily tell what was changed locally here.
@djgilcrease can we revert that? Can we unfork and get back to a dependency?
I'm willing to work on the PR if you can tell me it has a chance.

@djgilcrease
Copy link
Contributor

I don't mind, the reason we forked it was because we had an open patch for 3 months with no response. I think it has been merged since then.

jarondl added a commit to jarondl/nfpm that referenced this issue Jul 10, 2023
Go back to using upstream github.com/google/rpmpack instead of nfpm's
forked version.

See goreleaser#640
@caarlos0
Copy link
Member

thanks @jarondl @djgilcrease , I was looking into the our forked rpmpack just last week, planning to see if I could unfork it soon... seems like you beat me to it hehe

caarlos0 pushed a commit that referenced this issue Jul 10, 2023
Go back to using upstream github.com/google/rpmpack instead of nfpm's
forked version.

See #640
@jarondl
Copy link
Contributor

jarondl commented Jul 10, 2023

I don't mind, the reason we forked it was because we had an open patch for 3 months with no response. I think it has been merged since then.

Oh no sorry about that. I think you mean google/rpmpack#77 which was indeed merged. I'm glad we are black to using rpmpack as a dependency.

Now back to the actual issue here - @caarlos0 have you seen my addition of Prefixes ? (google/rpmpack#84)

To make a package relocatable, you need to supply a value for Prefixes. I see that you are assigned to this issue, let me know if you have any implementation questions.

@caarlos0
Copy link
Member

hey @jarondl , just PRd it: #691

btw, thanks for all the help! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants