How to build and deploy package with different versions of one dependency?

无人久伴 提交于 2019-12-10 13:45:15

问题


For example I maintain an application that uses libmemcached. I can compile it using libmemcached5 or libmemcached6, also build .deb package pointing to libmemcached5, libmemcached6 or even libmemcached5|libmemcached6 as dependency, but actually my binary is compiled with only one of them. What's the best way I can solve this trouble to deploy my package without upgrading/downgrading any dependencies on the user-side?


回答1:


If you are using a repository, or if multiple compiled versions of your app are acceptable, then your best bet is to compile your app twice, once with libmemcached5 and once with libmemcached6, and package them separately, with different package names, and use a virtual package to install the right one automatically:

 Package:   myapplication-memchched5
 Version:   1.3.17-1
 Depends:   libmemcached5
 Provides:  myapplication
 Conflicts: myapplication
 Replaces:  myapplication

and

 Package:   myapplication-memchched6
 Version:   1.3.17-1
 Depends:   libmemcached6
 Provides:  myapplication
 Conflicts: myapplication
 Replaces:  myapplication

Now aptitude install myapplication will automatically select either myapplication-memchched5 or myapplication-memchched6 based on what else needs to be installed.



来源:https://stackoverflow.com/questions/13397372/how-to-build-and-deploy-package-with-different-versions-of-one-dependency

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