I am looking for tips on how to package my Qt-based application for Ubuntu/Debian distributions. Let’s say the application (executable) is myapp. Running objdump -p myapp | grep NEEDED, I see that it has the following dependencies:
libicuuc.so.44
libicui18n.so.44
libicudata.so.44
libQtGui.so.4
libQtCore.so.4
libpthread.so.0
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6
I have gone through several online documents (listed at the end of this question), but am still fuzzy on where to install the actual files.
The Debian Filesystem Hierarchy Standard would suggest (I think) installing myapp in /usr/local/bin but I’m not sure about the ICU and Qt libs. It’s important that the exact version of some of these libraries are used. (They have draft APIs which are being utilized that might break in future versions.)
- I want to avoid “shared library hell” so that would incline me to place them in the application directory (
/usr/local/bin), but the Debian Filesystem Heirarchy Standard would seem to discourage that. - I could place them in
/usr/local/lib/myappbut then how do I ensure the correct version is linked dynamically? And if I do this, what do I have to do to add this directory toLD_LIBRARY_PATHon the target system?
As you can tell, I’m quite new to packaging for Ubuntu systems, so the direction I’m going may be completely wrong. I’m interesting in hearing from others who are doing this as to what they have found works best, particularly from a stability and ease-of-maintenance perspective.
Here are some of the docs I have gone through thus far:
- Ubuntu Packaging Guide
- Create Ubuntu deb-package from a Qt-application
- Debian Filesystem Hierarchy Standard
- Debian Policy Manual (on system)
- Debian Developer’s Reference (on system)
- Debian New Maintainers’ Guide (on system)
You need to look at the
controlsection. You should not be distributing those shared libraries unless you are building them from source in your code. Those libraries belong to other packages that you need to list as Depends or Build-Depends for your package.You say you are new to packaging on Ubuntu systems, what platforms have you packaged for? If it was only Windows, you are used to dll hell. It is much easier to avoid on Linux since you can say it requires certain libraries to be installed and the package installer knows how to find those libraries.