Search code examples
rpmrpmbuildrpm-specself-extracting

How do you create an rpm from a self-extracting executable?


I have a .bin file (Linux self extracting binary files), say installme.bin

I want to make an RPM out of it.

What would be the simplest strategy?

An almost empty spec file with:
%post
./installme.bin

Would it work?

Many thanks in advance


Solution

  • It probably would install the software, but it wouldn't work properly:

    • If installme.bin asks questions, that violates RPM guidelines. There should be no user interaction during an install as you the installs may be unattended. There might not even be a console attached to the process, so interaction is a no no.
    • The RPM would not contain a list of files that were installed. This is essential for uninstalling the RPM as without it all the files installed by installme.bin would remain on the system.
    • Any automatic dependencies would not be generated.

    Unfortunately the only way to get around this is to install the package manually, then tar up the files that have been created and use that as the source file for the RPM. Depending on how well crafted the bin file is, that may or may not be an easy task. Typically these bin files ask where you want to install to. Try it as a non-root user and put it somewhere under your home directory. That way you can be sure that its not dumping files outside of what your user can write to. Once you know what its creating, install it as root in the final location - in case the install can't be moved once it has been installed.