如何捆绑 Linux 应用程序
我正在编写一个(闭源)应用程序,并将为所有三个主要平台(MacOS X、Linux 和 Windows)提供二进制文件。它在 LGPL 许可下使用 Qt,因此我需要动态链接 Qt 库。我了解如何通过简单地向应用程序提供 Qt 动态库来捆绑 MacOS 和 Windows 的应用程序,但我不确定如何在 Linux 上正确执行此操作。
传统上将应用程序作为包(.deb 和 .rpm)提供,并允许包系统解决依赖关系。应该用这个方法吗?如果是这样,我应该瞄准哪个发行版(我假设是 Ubuntu 和 Fedora)?如果有人有这方面的经验,我很想听听。
I am writing a (closed-source) application and will provide binaries for all three major platforms (MacOS X, Linux and Windows). It uses Qt under the LGPL license so I am required to dynamically link with the Qt libraries. I understand how to bundle the application for MacOS and Windows by simply providing the Qt dynamic library with the application, but I am unsure how to do this properly for Linux.
It's traditional to provide the application as a package (.deb and .rpm) and allow the package system to resolve the dependencies. Should use this method? If so which distros should I be aiming for (I am assuming Ubuntu and Fedora)? If anyone has any experience with this, I'd be interested in hearing it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
deb、rpm 和 tarball 是正确的方法。据我所知,有一些非标准方法您可能也想考虑,它们与发行版无关。
deb
,rpm
andtarballs
are the right ways to go. There are a few non-standard ways that I know of which you might want to consider as well which are more distro agnostic.您需要为Linux提供至少3个软件包; .deb 用于基于 Debian 的系统,.rpm 用于基于 RPM 的系统,而 tarball 用于其他所有内容。有些人发现有必要对其进行改进,为 Fedora、SuSE、Mandriva 和 RHEL 提供三到四个不同的 .rpm 软件包,具体取决于软件的具体库要求。
You need to provide at least 3 packages for Linux; a .deb for Debian-based systems, a .rpm for RPM-based systems, and a tarball for everything else. Some find it necessary to refine it to provide three or four different .rpm packages, for Fedora, SuSE, Mandriva, and RHEL, depending on the exact library requirements the software has.
有很多方法可以做到这一点...但如果您想要一种分发通用方法来捆绑 Linux 应用程序,您可以检查 这个 (http://codevarium.gameka.com.br/deploying-cc-linux-applications-supporting-both- 32 位和 64 位/ )教程。它展示了如何将所有依赖项复制到库文件夹并创建 shell 脚本来正确执行该包。
There are many ways to do so... but if you want a distribution generic way to bundle an application for Linux, you may check this ( http://codevarium.gameka.com.br/deploying-cc-linux-applications-supporting-both-32-bit-and-64-bit/ ) tutorial. It shows how to copy all the dependencies to a library folder and make a shell script to properly execute the bundle.