Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

debian

dpkg

When I download some package sources, (e.g. foo-[ver].orig.tar.gz, foo-[ver].dsc), I often encounter dependencies problem while using dpkg-source -x foo-[ver].dsc and dpkg-buildpackage -us -uc .... In this case, I have to install the building dependencies one by one. Is there some tool to automatically handle this case, e.g., dpkg-source-dependencies -x foo-[ver].dsc?

like image 863
Vivodo Avatar asked Jan 21 '12 17:01

Vivodo


People also ask

How does DPKG Buildpackage work?

It prepares the build environment by setting various environment variables (see ENVIRONMENT), runs the init hook, and calls dpkg-source --before-build (unless -T or --target has been used). 2. It checks that the build-dependencies and build-conflicts are satisfied (unless -d or --no-check-builddeps is specified).

How does the Debian package manage know where to find software packages?

A Debian or APT repository is a server or a local directory containing packages files and their metadata readable by the APT tools. Hence, on all the Debian-based distributions, the APT Package management system maintains repositories inside the main configuration file /etc/apt/sources. list.

What is a Debian source package?

A Debian source package contains the source material used to construct one or more binary packages. A source package consists of a . dsc file (see Debian source control files – . dsc), one or more compressed tar files, and possibly other files depending on the type and format of source package.

How many types of Debian packages are there?

There are two types of Debian packages: Binary packages, which contain executables, configuration files, man/info pages, copyright information, and other documentation.


2 Answers

When trying to build a package the following should grab all dependencies:

apt-get build-dep [package-name]

Also, apt-get can compile source packages if needs be:

apt-get --build [package-name]

like image 157
John Kloian Avatar answered Sep 28 '22 02:09

John Kloian


There are several ways to go about this (as seen from the other replies). For a package that is already part of a 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 the above are the most widely used.

like image 32
Guillem Jover Avatar answered Sep 28 '22 03:09

Guillem Jover