1. First, let’s install the necessary tools:

    # sudo apt-get install autotools-dev fakeroot dh-make build-essential

  2. Copy your source tree into a directory in /tmp or something else

    # cp -r sources-0.1 /tmp

    # cd /tmp/sources-0.1

  3. Now let’s make the debian control files:

    # dh_make --createorig

    Don’t forget to iclude “–createorig” if you don’t have the orig source before.

  4. Edit the debian/control file and at least change the Maintainer and Description fields. There are a few other files you will probably want to edit.
  5. Then run the following: (don’t use sudo!!)

    # dpkg-buildpackage -rfakeroot

  6. At last, if we look in /tmp (one directory up) we see sources-0.1.deb which ready . .😀