Creating symlinks when packaging a Library (Debian)?

こ雲淡風輕ζ 提交于 2019-12-04 10:35:48

See man dh_link

I have an example gist on github that creates /bin/hello and a symbolic link to it at /bin/helloworld

You can demo it on your system like so:

# Create the deb package
curl -O https://gist.github.com/RichardBronosky/5358867/raw/deb-packaging-example.sh
bash deb-packaging-example.sh

# Install the deb package
dpkg --install hello-world*.deb

# Check the scripts
ls -la /bin/hello*
/bin/hello
/bin/helloworld

The secret is the hello-world-0.1/debian/hello-world.links file that is created by line 18 (at the time of this writing) of the script. Check it out...

https://gist.github.com/RichardBronosky/5358867

$(LN) /usr/lib/$(LIB).$(MAJOR).$(MINOR) /usr/lib/$(LIB).1
$(LN) /usr/lib/$(LIB).$(MAJOR) /usr/lib/$(LIB)

In the code above, you are directly linking to a target into /usr/lib (ie. on the build machine), but this way it will not be part of the package. Instead, you should be linking in a subdir of DESTDIR, so that the symlink is eventually put in the packaged subtree.

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