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:
-
Setup the source repositories. See the Downloads page for details.
-
Setting up rpm building enironment:
rpmdev-setuptree
-
Get the source:
yumdownloader --source <package-name>
This will download an rpm file in the current folder containing the source of the selected package.
-
Install build dependencies:
yum-builddep <full rpm name>
-
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:
-
Setup source repositories: See the Downloads page for details.
-
Update the local package cache:
apt-get update
-
Get the sources:
apt-get source <package_name>
-
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.
-
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>
-
Get into source directory, executing the command:
cd <SOURCE_DIR>
-
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.
|
|