How do I build a debian package whose sources include symbolic links outside of the source tree?

时间秒杀一切 提交于 2019-12-10 20:23:17

问题


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.

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

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

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


回答1:


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.

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

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



来源:https://stackoverflow.com/questions/10917214/how-do-i-build-a-debian-package-whose-sources-include-symbolic-links-outside-of

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!