How to make a Simple .deb file

References

  • http://packaging.ubuntu.com/html/packaging-new-software.html
  • http://packaging.ubuntu.com/html/debian-dir-overview.html
  • http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/#AEN66
  • https://raphaelhertzog.com/2010/12/17/do-not-build-a-debian-package-with-dpkg-b/
  • https://raphaelhertzog.com/debian-packaging/

Standard debian notation is all lowercase in the following format

<project>_<major_version>.<minor_version>-<package revision>

Example:

helloworld_1.0-1

Step by Step

  1. create a directory to make my package in. the name should be same as the package name mkdir helloword_1.0-1

  2. Pretend that the packaging directory is actually that root of the file system. Put the files of your program where they would be installed to on a system.

mkdir helloworld_1.0-1/user
mkdir helloworld_1.0-1/user/local
mkdir helloworld_1.0-1/user/local/bin
cp "~/Projects/Hello World/helloworld" helloworld_1.0-1/usr/local/bin
  1. Create a special metadata file with which the package manager will install your program
mkdir helloword_1.0-1/DEBIAN
touch helloword_1.0-1/DEBIAN/control
Put something like this in that file
Package: helloworld
Version: 1.0-1
Section: base
Priority: optional
Architecture: i386
Depends: libsomethingorrather (>= 1.2.13), anotherDependency (>= 1.2.6)
Maintainer: Your Name <you@email.com>
Description: Hello World
 When you need some sunshine, just run this
 small program!

 (the space before each line in the description is important)
  1. You just need to make the package
dpkg-deb --build helloworld_1.0-1

Comments !

links

social