What is FPM?¶
fpm is a command-line program designed to help you build packages.
Building a package might look something like this:
fpm -s <source type> -t <target type> [list of sources]...
“Source type” is what your package is coming from; a directory (dir), a rubygem (gem), an rpm (rpm), a python package (python), a php pear module (pear), etc.
“Target type” is what your output package form should be. Most common are “rpm” and “deb” but others exist (solaris, etc)
You have a few options for learning to run FPM:
- If you’re impatient, just scan through fpm –help; you’ll need various options, and they’re reasonably straightforward. Impatient learning is totally welcome, and if you run into issues, ask questions in #fpm on freenode irc or on email@example.com!
- The documentation has explanations and examples. If you run into problems, I welcome you to ask questions in #fpm on freenode irc or on firstname.lastname@example.org!
To give you an idea of what fpm can do, here’s a few use cases:
- Take a directory and turn it into an RPM::
- fpm -s dir -t rpm ...
- Convert a .deb into an rpm::
- fpm -s deb -t rpm ...
- Convert a rubygem into a deb package::
- fpm -s gem -t deb ...
- Convert a .tar.gz into an OSX .pkg file::
- fpm -s tar -t osxpkg
- Convert a .zip into an rpm::
- fpm -s zip -t rpm ...
- Change properties of an existing rpm::
- fpm -s rpm -t rpm
- Create an deb that automatically installs a service::
- fpm -s pleaserun -t deb
Below is a 10-minute video demonstrating fpm’s simplicity of use:
Now that you’ve seen a bit of what fpm can do, it’s time to install fpm.