How to create debian package for binary files?

Install the required package to the host.

$sudo apt-get install dpkg-dev

Then follow the steps for creating helloworld.deb file:

1.Create the directory helloworld and DEBIAN inside helloworld

$mkdir helloworld && mkdir helloworld/DEBIAN

2.Copy files into the package
Copy the files into the package with the full paths on the destination file system. E.g. if you want to put a
file in /usr/local/bin/ you put it in helloworld/usr/local/bin/

$mkdir -p helloworld/usr/local/bin
$cp name_of_file_tobecopied helloworld/usr/local/bin

3.Create a control file

$gedit control

and copy the below line into it and save it

Package: helloworld
Version: 0.2
Section: base
Priority:optin
Maintainer: trunexa
Architecture: all
Description: hello world

4.Create a deb pacakge using below command

$dpkg-deb --build helloworld

which creates helloworld.deb file

5.Install deb package using below command

$dpkg -i helloworld.deb

6.To check deb file installed or not, go to usr/local/bin of device and search for name of file for which debian package is made.