如何构建一个 debian 软件包,其源代码包含源代码树之外的符号链接? [英] How do I build a debian package whose sources include symbolic links outside of the source tree?

查看:39
本文介绍了如何构建一个 debian 软件包,其源代码包含源代码树之外的符号链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,其源代码包含指向其他源代码树的符号链接(特别是 CppUTest 框架).我需要从我的项目中构建一个 debian 包,但是 dpkg-source 不会跟随符号链接.

I have a project whose source includes symbolic links to other source trees (notably, the CppUTest framework). I need to build a debian package out of my project, but dpkg-source will not follow the symbolic links.

进一步挖掘,我相信这是因为 tar 的默认行为不是取消引用符号链接,除非明确告知(使用 -h).

Digging further, I believe this is because the default behavior for tar is not to dereference symbolic links unless explicitly told to (with -h).

在构建 debian 源代码压缩包时,我无法找到将这个额外选项传递给 tar 的方法.

I was unable to find a way to pass this extra option to tar when building the debian source tarball.

那么我在这里做错了什么?是否可以构建一个包含符号链接的 debian 源代码压缩包?如果有,怎么做?

So what am I doing wrong here? Is it possible to build a debian source tarball whose origin includes symbolic links? If so, how?

推荐答案

在这个线程中读到.. http://ubuntuforums.org/showpost.php?p=9752860&postcount=3

As read in this thread.. http://ubuntuforums.org/showpost.php?p=9752860&postcount=3

它们可以像普通文件一样包含在包中.

They can be included in the package just like normal files.

详细信息取决于您进行打包的方式,但在 debian/rules 的安装"目标中使用类似以下内容应该可以:

The details depend on the way you're doing the packaging, but using something like the following in debian/rules's `install' target should work:

ln -s /usr/share/whatever/file/you/want $(CURDIR)/debian/<pkgname>/usr/whatever/place/you/want/the/link

debian/中的所有内容都将在 .deb 中结束,包括您放在那里的符号链接.

Everything inside debian/ will end up inside the .deb, including the symlinks you put there.

这篇关于如何构建一个 debian 软件包,其源代码包含源代码树之外的符号链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆