How to automatically satisfy dependencies in ".dsc" files when building a debian package from source code?

When I load some package sources (for example, foo- [ver] .orig.tar.gz, foo- [ver] .dsc), I often encounter a dependency problem when using dpkg-source -x foo-[ver].dsc and dpkg-buildpackage -us -uc ... In this case, I have to set the build dependencies one by one. Is there any tool to automatically handle this case, for example, dpkg-source-dependencies -x foo-[ver].dsc ?

+4
source share
4 answers

pbuilder is just a tool for this job. pbuilder will set the minimum distribution in tarball during installation. To create a .dsc file .dsc you send the file and pbuilder tarball, chroot s, installs all the necessary build dependencies, and compiles the package. As a result of this procedure, the build result is independent of the current host configuration.

+2
source

When trying to create a package, the following should capture all the dependencies:

apt-get build-dep [package-name]

In addition, apt-get can compile the source packages if necessary:

apt-get --build [package-name]

+7
source

There are several ways to do this (as can be seen from the other answers). For a package that is already part of the repository, you can simply use:

 apt-get build-dep pkgname 

For local packages, one of:

 apt-get build-dep source-dir/ apt-get build-dep source-name.dsc /usr/lib/pbuilder/pbuilder-satisfydepends* --control source-name.dsc mk-build-deps --install source-name.dsc pbuilder build source-name.dsc sbuild source-name.dsc 

There are probably other solutions, but most commonly used.

+2
source

I extract Build-Depends from debian / control and then install them with apt. Several standard packages are not referred to as Build-Depends (for example, necessary for assembly) and are required silently from debuild.

 pkgs=$(grep Build-Depends debian/control|sed 's/^Build-Depends: //g) pkgs=$(echo $pkgs|sed "s/[() ]//g"|tr "," " ") apt-get install $pkgs build-essential 
-one
source

Source: https://habr.com/ru/post/1392230/


All Articles