Cheating with FPM
Building operating system deliverables such as RPMs with a spec file is very useful knowledge. However, sometimes you don't need the rigor of a real spec file. The spec file is, after all, optimized for the scenario where you are not yourself the originator of the code base.
There is a Ruby-based tool called FPM, which can generate source RPMs suitable for building, directly from the command line.
The tool is available on GitHub at https://github.com/jordansissel/fpm.
On Fedora, you can install FPM like this:
yum install rubygems yum install ruby yum install ruby-devel gcc gem install fpm
This will install a shell script that wraps the FPM Ruby program.
One of the interesting aspects of FPM is that it can generate different types of package; among the supported types are RPM and Debian.
Here is a simple example to make a "hello world" shell script:
#!/bin/sh echo 'Hello World!'
We would like the shell script to be installed in /usr/local/bin
, so create a directory in your home...