Downloads‎ > ‎Documentation‎ > ‎Guides‎ > ‎

Package Building Guide

1) Building RPM packages in yum-based systems:

In order to build rpm packages one needs to install and setup the rpm build tools. To do this you should install the following packages:

rpmdevtools and yum-utils

Note: In some distributions to find the rpmdevtools you should look in the EPEL repository. See here for more details.

To build rpm packages one can use the following procedure:

  1. Setup the source repositories. See the Downloads page for details.

  2. Setting up rpm building enironment:
    rpmdev-setuptree

  3. Get the source:
    yumdownloader --source <package-name>
    This will download an rpm file in the current folder containing the source of the selected package.

  4. Install build dependencies:
    yum-builddep <full rpm name>

  5. Rebuild the package:
    rpmbuild --rebuild <full rpm name>

2) Building DEB packages:

In order to build DEB packages one needs to install and setup the DEB build tools. To do this you should install the following packages:

dpkg-dev and debhelper

To build DEB packages one can use the following procedure:

  1. Setup source repositories: See the Downloads page for details.

  2. Update the local package cache:
    apt-get update

  3. Get the sources:
    apt-get source <package_name>

  4. This command will get into current directory more files (the source tarball file ending in orig.tar.gz, a .dsc file and a file ending in debian.tar.gz, containing debian file needed to build DEB package from sources). The tar.gz files are unpacked in a subdirectory. Let us call it SOURCE_DIR.

  5. Get all the dependencies needed to build the DEB from sources, running the following command as root or with sudo:
    apt-get build-dep <package_name>

  6. Get into source directory, executing the command:
    cd <SOURCE_DIR>

  7. Build the DEB packages execution the following command:
    dpkg-buildpackage

The DEB files containing the binaries built from the sources are created in the parent directory of SOURCE_DIR.