Itis also possible to build Debian packages yourself, either from a partial alien conversion (as previously discussed), or from scratch using the original software. The procedure can vary from simple to complex, depending on what the package is to provide, and is well covered in the Debian maintainer's guide and the Debian policy manual, both available online or as installable packages in Debian, and in many other online resources. A good online starting place is the Debian packaging Wiki page at https://wiki. debian. org/HowToPackageForDebian.
Manual builds, either from scratch or from a partial alien conversion, are the recommended way to handle software that cannot be obtained instandard Debian format.
Details vary greatly, depending on the actual software involved. Generally, a package is built from source code, but itis also possible to build a package from a binary only software release as well. The general procedure for this is as follows:
- Obtain the source (or binary files) and place in an appropriate package building directory.
- Create the necessary Debian packaging files, which include additional documentation as necessary, optional script files specific to Debian packages, files to control the package building process, and files required by Debian package managers.
- Test the build. Ifnecessary, add patches to correct any problems in packaging, or that are required for the software to compile or run properly in a Debian environment.
- Repeat steps 2 and 3 until the final product installs and runs on your distribution.
The packages available to Debian developers are included in the distribution for anyone to use. The primary ones used in building your own packages are:
- build-essential (packages essential for building Debian packages)
- dpkg-dev (package development tools)
- fakeroot (allows users to build as if they were the root user)
- dh-make (tools to create files in the debian package build directory)
- debhelper (helper programs for the debian/rules file)
- cdbs (optional, additional helper programs for the debian/rules file)
- quilt (debian package patch management)
It is all but impossible to give any general example, as every package will differ in all but the first step. However, there are many good examples and tutorials available online, and the full package source of all Debian packages included in the distribution is available for anyone to examine and learn from.