• Install dh-make

sudo apt-get install build-essential dh-make

  • Put your source code in tar.gz into a directory. File format is in <filename>-<version>

mkdir mysource

mv mysource-01.tar.gz mysource/

cd mysource

tar -xvzf mysource-01.tar.gz

  • Create the initial Debian package

cd mysource-01

dh_make -f ../mysource-01.tar.gz

  • It will prompt to ask the type of package. Then hit enter to confirm.

Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch?
[s/i/m/l/k/n] s

  • A debian folder will be created under mysource-01 with all the necessary debian files

total 108
drwxr-xr-x 3 root root 4096 Dec 6 11:39 .
drwxr-xr-x 3 root root 4096 Dec 6 11:39 ..
-rw-r–r– 1 root root 190 Dec 6 11:39 changelog
-rw-r–r– 1 root root 2 Dec 6 11:39 compat
-rw-r–r– 1 root root 525 Dec 6 11:39 control
-rw-r–r– 1 root root 1679 Dec 6 11:39 copyright
-rw-r–r– 1 root root 0 Dec 6 11:39 docs
-rw-r–r– 1 root root 4596 Dec 6 11:39 init.d.ex
-rw-r–r– 1 root root 1646 Dec 6 11:39 manpage.1.ex
-rw-r–r– 1 root root 4663 Dec 6 11:39 manpage.sgml.ex
-rw-r–r– 1 root root 11018 Dec 6 11:39 manpage.xml.ex
-rw-r–r– 1 root root 129 Dec 6 11:39 menu.ex
-rw-r–r– 1 root root 134 Dec 6 11:39 mysource.cron.d.ex
-rw-r–r– 1 root root 238 Dec 6 11:39 mysource.default.ex
-rw-r–r– 1 root root 526 Dec 6 11:39 mysource.doc-base.EX
-rw-r–r– 1 root root 958 Dec 6 11:39 postinst.ex
-rw-r–r– 1 root root 931 Dec 6 11:39 postrm.ex
-rw-r–r– 1 root root 691 Dec 6 11:39 preinst.ex
-rw-r–r– 1 root root 878 Dec 6 11:39 prerm.ex
-rw-r–r– 1 root root 186 Dec 6 11:39 README.Debian
-rw-r–r– 1 root root 271 Dec 6 11:39 README.source
-rwxr-xr-x 1 root root 114 Dec 6 11:39 rules
drwxr-xr-x 2 root root 4096 Dec 6 11:39 source
-rw-r–r– 1 root root 787 Dec 6 11:39 watch.ex

  • You can then modify the relevant files for eg: control