fpm
fpm copied to clipboard
Using fpm to modify an existing package
I have an existing RPM that I would like to modify one file in and then repackage, preserving metadata, pre/post scripts, dependencies, and so on.
I see that fpm supports using rpm as a source and a target, so in principle it can "convert" my source RPM into my destination RPM, but I don't see any flags or documentation on sandwiching my file modification into the conversion process.
I considered using rpm2cpio
and cpio
to extract the rpm into a directory, make the change, and then use fpm to repackage it into an RPM, but then I'm on my own when it comes to reproducing all the package metadata.
Is this a supported use case? If not, could it be?
Maybe you can do it with the --exclude
flag and the full name, otherwise rpm to dir, delete your file, dir to rpm? You'd need to repopulate metadata and dependencies that way though. If it's a one off thing you need to do, the -e
flag will let you edit the rpm spec and you can just delete the file you need from there too.
Did you have success with this method? I'm having trouble simply dropping a directory structure into a target directory. This would be helpful as the only real change I need to make is to one file.
Hmm… I’m trying to think of how to achieve this…
I’m not sure exactly how to achieve it, but maybe we could add some kind of script feature where you can change file contents before the rpm is output, but after it has been input?
On Mon, Dec 20, 2021 at 6:30 PM Danny Fowler @.***> wrote:
Did you have success with this method? I'm having trouble simply dropping a directory structure into a target directory. This would be helpful as the only real change I need to make is to one file.
— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/issues/1165#issuecomment-998418670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2X75RT2MEGJKNYCLKLUR7RE7ANCNFSM4CK2YHBA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm not sure how this could/would be implemented, but I too would like to do something like this. My use-case is that I'm using a dotnet created package (which is pretty basic) - I'd like to add some supporting files to the package, and preferably be able to change the systemd service unit for the app as well (as it's pretty basic). Using FPM to make theis package in place of the dotnet tools isn't feasible (being dotnet, it spews files all over the place, and only dotnet can make sense of them).
I guess I'd like a "merge existing package and a new directory" feature - which I guess could be generalised into merge any two inputs to one output. Perhaps something like fpm -s deb -s2 dir -t deb
, perhaps?
As it stands, in my use-case, I'm starting to wonder if "unzipping" my source package and re-building it would be the best option.
I had the same usecase and ended up using rpmrebuild. It has a plugin system that lets you replace the rpm contents and rewrite the spec file line-by-line. It was a little cumbersome but it got the job done. Being able to use fpm instead would've been great. I second the idea for multiple inputs and a single output. That combined with the --exclude
flag would've let me fix the issue with fpm.
I agree. I’m not sure what the interface would look like, but being able to do additional modifications such as these directly through fpm. I keep thinking about this, and please continue providing feedback as you are able <3
On Fri, Apr 29, 2022, at 3:07 PM, John Gibson wrote:
I had the same usecase and ended up using rpmrebuild http://rpmrebuild.sourceforge.net/. It has a plugin system that lets you replace the rpm contents and rewrite the spec file line-by-line. It was a little cumbersome but it got the job done. Being able to use fpm instead would've been great. I second the idea for multiple inputs and a single output. That combined with the
--exclude
flag would've let me fix the issue with fpm.— Reply to this email directly, view it on GitHub https://github.com/jordansissel/fpm/issues/1165#issuecomment-1113795491, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABAF2VXVHGIBDZHGRTMLH3VHRMTPANCNFSM4CK2YHBA. You are receiving this because you commented.Message ID: @.***>