如何自动满足“.dsc”中的依赖关系从源代码构建 debian 包时的文件?

发布于 2024-12-28 09:03:54 字数 242 浏览 4 评论 0原文

当我下载一些软件包源(例如 foo-[ver].orig.tar.gz、foo-[ver].dsc)时,我在使用 dpkg-source -x foo-[ver] 时经常遇到依赖问题.dsc 和 dpkg-buildpackage -us -uc ...。在这种情况下,我必须一一安装构建依赖项。是否有一些工具可以自动处理这种情况,例如,dpkg-source-dependency -x foo-[ver].dsc

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

燃情 2025-01-04 09:03:54

当尝试构建包时,以下内容应该获取所有依赖项:

apt-get build-dep [package-name]

另外,如果需要,apt-get 可以编译源包:

apt-get --build [包名称]

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]

沫离伤花 2025-01-04 09:03:54

有几种方法可以解决这个问题(从其他回复中可以看出)。对于已经是存储库一部分的包,您可以简单地使用:

apt-get build-dep pkgname

对于本地包,以下之一:

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 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.

傲影 2025-01-04 09:03:54

pbuilder 正是完成这项工作的工具。 pbuilder 将在安装时在 tarball 中设置最小发行版。要构建 .dsc 文件,您需要提供该文件,然后 pbuilder 解压 tarball、chroot,安装所有必要的构建依赖项并编译包。由于此过程,您的构建结果独立于主机的当前配置。

pbuilder is just the tool for this job. pbuilder will set up a minimal distribution in a tarball upon install. For building a .dsc file, you supply the file and pbuilder unzips the tarball, chroots, installs all necessary build dependencies and compiles the package. As a result of this procedure, your build result is independent from the current configuration of the host machine.

孤星 2025-01-04 09:03:54

我从 debian/control 中提取 Build-Depends,然后使用 apt 安装它们。
一些标准包没有被提及为 Build-Depends(例如 build-essentials),并且在 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

I'm extracting the Build-Depends from debian/control and afterwards install them with apt.
A few standard packages are not mentioned as Build-Depends (e.g. build-essentials) and 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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文