Any way to register source-built software with rpm/yum database

rpmsoftware installation

When I install a software from its binary package using rpm or yum, I can later query for meta-information (rpm -qi PACKAGE, rpm -ql PACKAGE, …) and can uninstall it (rpm -e PACKAGE).

But with the software that I build and install from its sources, I have to keep hanging on to the build directory forever to later be able to uninstall it, since removing the build directory would make it impossible for me to later uninstall the software! Even if you could hold on to the build directory forever, querying for meta-information isn't easy either, unless you know the intricacies of make files.

Question: Is there any way to, sort of, 'register' the binaries being installed (which is usually during the make install step for most software packages) with the rpm/yum database, to allow easy uninstall later and for meta-information querying?

Best Answer

One option to achieve your goal is to "roll" your own RPM. It's not a trivial task, but once you understand the process, it can be done fairly painlessly in just a few steps (depending on the level of sophistication required for the software). I have to install a lot of built from source software for my customers, and I find that when possible, taking the time to create an RPM is administratively beneficial over the life of the software. I still control the build process, I just take the effort a step further and wrap up the built software into a tidy RPM package.

From my experience, benefits of installing the software as an RPM include

  • Users are able to query the RPM database to find out information about the installed software
  • I can easily push the package out to multiple machines via a custom yum repository
  • Installation and removal of the software becomes simplistic
  • I can take advantage of all the benefits of using the RPM package manager
  • I am able to keep different versions of the software "in archive" by keeping the RPM and SRPM files
  • I can share my efforts of a custom built RPM with a wider community

The Fedora Project wiki has a good tutorial explaining the process and steps to create a custom RPM. This is a great starting point and gives you an idea of the power available to you when customizing your own RPM.

Related Question