Debain package is a tar file that contains the files required by an application along with some script and description about the application and its depedency. This tutorial will guide you to create a simple debian package by hand.
- Create the directory to hold the project
Please replace by package name, by version and by the architecture that the package has been created for.
- Create a directory call “DEBIAN” inside the project directory
This directory contains the metadata about the package.
Copy files into project root directory and include the final paths For example files that needs to be put into /usr/bin should be placed into /tmp/package_version_architecture/usr/bin.
Create and add necessary control to the control file
Control file contains information about the package being installed like name, version, description, dependencies, etc. A sample control file is given below.
Package: my-program Version: 1.0 Architecture: all Essential: no Priority: optional Depends: packages;my-program;needs;to;run Maintainer: Your Name Description: A short description of my-program that will be displayed when the package is being selected for installation.
Add “preinst” and/or “postinst” script if required When the debian package is installed preinst and postinst scripts are executed before or after the installation of the package.
Now generate packages using the following command.