< Previous | Contents | Next >
9.1.4. Starting the Build
When all the needed changes have been applied to the sources, you can start generating the actual binary package or .deb file. The whole process is managed by the dpkg-buildpackage command and it looks like this:
$ dpkg-buildpackage -us -uc -b
dpkg-buildpackage: source package libfreefare dpkg-buildpackage: source version 0.4.0-2buxy1 dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Raphael Hertzog <buxy@kali.org> dpkg-buildpackage: host architecture amd64
[...]
dh_builddeb
dpkg-deb: building package ’libfreefare0-dbgsym’ in ’../libfreefare0-dbgsym_0.4.0-2buxy1_amd64.deb’. dpkg-deb: building package ’libfreefare0’ in ’../libfreefare0_0.4.0-2buxy1_amd64.deb’.
dpkg-deb: building package ’libfreefare-dev’ in ’../libfreefare-dev_0.4.0-2buxy1_amd64.deb’.
dpkg-deb: building package ’libfreefare-bin-dbgsym’ in ’../libfreefare-bin-dbgsym_0.4.0-2buxy1_amd64.deb’.
$ dpkg-buildpackage -us -uc -b
dpkg-buildpackage: source package libfreefare dpkg-buildpackage: source version 0.4.0-2buxy1 dpkg-buildpackage: source distribution UNRELEASED
dpkg-buildpackage: source changed by Raphael Hertzog <buxy@kali.org> dpkg-buildpackage: host architecture amd64
[...]
dh_builddeb
dpkg-deb: building package ’libfreefare0-dbgsym’ in ’../libfreefare0-dbgsym_0.4.0-2buxy1_amd64.deb’. dpkg-deb: building package ’libfreefare0’ in ’../libfreefare0_0.4.0-2buxy1_amd64.deb’.
dpkg-deb: building package ’libfreefare-dev’ in ’../libfreefare-dev_0.4.0-2buxy1_amd64.deb’.
dpkg-deb: building package ’libfreefare-bin-dbgsym’ in ’../libfreefare-bin-dbgsym_0.4.0-2buxy1_amd64.deb’.
dpkg-deb: building package ’libfreefare-bin’ in ’../libfreefare-bin_0.4.0-2buxy1_amd64.deb’. dpkg-deb: building package ’libfreefare-doc’ in ’../libfreefare-doc_0.4.0-2buxy1_all.deb’.
dpkg-genchanges -b >../libfreefare_0.4.0-2buxy1_amd64.changes dpkg-genchanges: binary-only upload (no source code included)
dpkg-source --after-build libfreefare-0.4.0
dpkg-buildpackage: binary-only upload (no source included)
dpkg-deb: building package ’libfreefare-bin’ in ’../libfreefare-bin_0.4.0-2buxy1_amd64.deb’. dpkg-deb: building package ’libfreefare-doc’ in ’../libfreefare-doc_0.4.0-2buxy1_all.deb’.
dpkg-genchanges -b >../libfreefare_0.4.0-2buxy1_amd64.changes dpkg-genchanges: binary-only upload (no source code included)
dpkg-source --after-build libfreefare-0.4.0
dpkg-buildpackage: binary-only upload (no source included)
The -us -uc options disable signatures on some of the generated files (.dsc, .changes) because this operation will fail if you do not have a GnuPG key associated with the identity you have put in the changelog file. The -b option asks for a “binary-only build.” In this case, the source package (.dsc) will not be created, only the binary (.deb) packages will. Use this option to avoid failures during the source package build: if you haven’t properly recorded your changes in the patch management system, it might complain and interrupt the build process.
As suggested by dpkg-deb’s messages, the generated binary packages are now available in the parent directory (the one that hosts the directory of the source package). You can install them with dpkg -i or apt install.
$ sudo apt install ../libfreefare0_0.4.0-2buxy1_amd64.deb
../libfreefare-bin_0.4.0-2buxy1_amd64.deb
Reading package lists... Done Building dependency tree
Reading state information... Done
Note, selecting ’libfreefare0’ instead of ’../libfreefare0_0.4.0-2buxy1_amd64.deb’
Note, selecting ’libfreefare-bin’ instead of ’../libfreefare-bin_0.4.0-2buxy1_amd64.deb’ The following packages will be upgraded:
libfreefare-bin libfreefare0
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/69,4 kB of archives.
After this operation, 2 048 B of additional disk space will be used. [...]
$ sudo apt install ../libfreefare0_0.4.0-2buxy1_amd64.deb
../libfreefare-bin_0.4.0-2buxy1_amd64.deb
Reading package lists... Done Building dependency tree
Reading state information... Done
Note, selecting ’libfreefare0’ instead of ’../libfreefare0_0.4.0-2buxy1_amd64.deb’
Note, selecting ’libfreefare-bin’ instead of ’../libfreefare-bin_0.4.0-2buxy1_amd64.deb’ The following packages will be upgraded:
libfreefare-bin libfreefare0
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/69,4 kB of archives.
After this operation, 2 048 B of additional disk space will be used. [...]
We prefer apt install over dpkg -i as it will deal with missing dependencies gracefully. But not so long ago, you had to use dpkg as apt was not able to deal with .deb files outside of any repository.
dpkg-buildpackage More often than not, Debian developers use a higher-level program such as debuild; wrappers this runs dpkg-buildpackage as usual, but it also adds an invocation of a program (lintian) that runs many checks to validate the generated package against the De-
bian policy3. This script also cleans up the environment so that local environment
variables do not pollute the package build. The debuild command is one of the tools in the devscripts suite, which share some consistency and configuration to make the maintainers’ task easier.
dpkg-buildpackage More often than not, Debian developers use a higher-level program such as debuild; wrappers this runs dpkg-buildpackage as usual, but it also adds an invocation of a program (lintian) that runs many checks to validate the generated package against the De-
bian policy3. This script also cleans up the environment so that local environment
variables do not pollute the package build. The debuild command is one of the tools in the devscripts suite, which share some consistency and configuration to make the maintainers’ task easier.
3https://www.debian.org/doc/debian-policy/