Skip to content
jordansissel edited this page Mar 21, 2011 · 1 revision

FPM Internals

This is less about "fpm" internals (which are boring) and more about how fpm uses some of the package systems.

RPM

fpm uses rpmbuild to build rpms. This is mainly because of two reasons. First, that rpm spec files are pretty integral to the rpm experience. Second, that I haven't bothered hacking anything that uses librpm directly.

RPMs are basically cpio file with a proprietary blob at the top (a serialized C struct?) that describes the rpm.

If you want to unpack an rpm, rpm2cpio is a great tool to help with this. If you have an RPM with silly dependencies, you can use fpm to edit those dependencies, or use rpm2cpio to extract it and use fpm to repack it.

DEB

fpm hand crafts deb packages from scratch using zero debian tools. fpm will roll up the data.tar.gz and generate the required control.tar.gz and debian-binary files and pack them into a .deb

Deb files are an ar(1) archive of 3 files: debian-binary, control.tar.gz, and data.tar.gz.

You can see this by running 'ar t something.deb'

The 'control.tar.gz' file is basically the 'debian' directory you see when you package debian files. It contains maintainer scripts, the control file, etc.

The 'data.tar.gz' file is the data you want. Literally untarring it from / will install the software, free of debian.

A "deb" version of rpm2cpio would be this:

ar p mypackage.deb data.tar.gz | tar -zxf -

This will unpack data.tar.gz from the deb into your current directory. Use tar -C to unpack elsewhere.

Clone this wiki locally