Debian Packaging Notes

checkinstall

Use checkinstall as a quick way to create a basic Debian package that can be used to install binaries for the same architecture as the host machine. However, debmake may be more effective for about the same effort. (See below.)

The process basically works as follows:

$ ./configure
$ make
$ sudo checkinstall

However, it may not provide a perfect match for what your own install script actually does.

Creating a Debian Package Using debmake

$ sudo apt-get install build-essential debmake
$ mv foo-1.0.0.tar.gz foo_1.0.0.orig.tar.gz
$ tar xf foo_1.0.0.orig.tar.gz
$ cd foo_1.0.0
$ export DEBEMAIL=foo@bar.example.com
$ export DEBFULLNAME='Foo Bar'
$ export EDITOR=/usr/bin/vim
$ debmake
$ debuild

You can speed up the build, if you have multiple CPUs with:

$ debuild -uc -us -j4

The build will finish with a run of lintian.

lintian is likely to report errors and warnings, but debmake is likely to have provided a working Debian package of the application which can be used to install to local machines etc. However, the package will need more work before it can be published.

Check the contents:

$ dpkg --contents ../foo_1.0.0-1_all.deb

Check dependencies:

$ dpkg --info ../foo_1.0.0-1_all.deb

After testing the Debian package, it can be installed together with any required dependencies with from within the extracted source folder:

$ sudo debi

Otherwise:

$ sudo apt-get install ../foo_1.0.0-1_all.deb

Note: the .deb file needs to be a path like reference to the file otherwise apt-get tries to deal with it as a download. e.g. if the .deb file is in the current directory, precede the file name with ./ and apt-get will handle it as a local file, not a package to be downloaded.

See:

Subsequent Releases

Use dch to update the Debian changelog.

For a new upstream release:

$ dch --release-heuristic log -v 1.0.1-1

For a new release of the same upstream release:

$ dch --release-heuristic log -i

To edit the changelog:

$ dch --edit

References


-- Frank Dean - 14 May 2024

Related Topics: DebianTips