RPM packages are a great way of packaging and distributing software, unfortunately some stand alone software is distributed as a zip or tar file to be installed that way. By converting these into an RPM you can use your package manager as a distribution and removal tool. For this example we will be creating an RPM for the Example Software.

  • The first thing to do is install the RPM development tools, you should only require rpmbuild.
  • Create a folder to be used as a RPM development area and then create a file called .rpmmacros in your home folder that contains the following line: %_topdir <your build folder>
  • Set up your RPM build area by creating the following folders – BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
  • Get a copy of your tar.gz or zipped software and place it in the SOURCES directory.
  • Now the key part of this is to create the .spec file as this describes the build and installation part of the RPM.
  • Create a new file in the SPECS folder called example.spec, fill it out with the following information –

  •  After your spec file is created run rpmbuild -bb ./SPECS/example.spec – fix any errors that are produced, most likely problems will come from getting the correct version/name and target architecture.
  • Find your completed RPM in ./RPMS/<ARCH>