如何自动满足“.dsc”中的依赖关系从源代码构建 debian 包时的文件?
当我下载一些软件包源(例如 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当尝试构建包时,以下内容应该获取所有依赖项:
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]
有几种方法可以解决这个问题(从其他回复中可以看出)。对于已经是存储库一部分的包,您可以简单地使用:
对于本地包,以下之一:
可能还有其他解决方案,但上述解决方案是最广泛使用的。
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:
For local packages, one of:
There are probably other solutions, but the above are the most widely used.
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 andpbuilder
unzips the tarball,chroot
s, 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.我从 debian/control 中提取 Build-Depends,然后使用 apt 安装它们。
一些标准包没有被提及为 Build-Depends(例如 build-essentials),并且在 debuild 中默默地需要。
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.