Deploying to the Bazaar

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
Image:qt-logo_new.png Image:qq-title-article.png
Qt Quarterly | Выпуск 18 | Документация


by Harald Fernengel
Deploying an application on Linux can sometimes be rather tedious. There are a lot of distributions and a lot of libraries to support. One easy way out is to do the same as a famous Swedish furniture store: You ship somepieces and let the user figure out how to assemble it themselves.Unfortunately, the assembly instructions for software are often not ascomprehensive as those for Billy the bookshelf.

Since 2004, Trolltech has been actively supporting the Linux Standard Base(LSB). The LSB defines an application binary interface (ABI) for Linux,guaranteeing that an LSB-compliant application will run on all LSB-compliant distributions. Currently, most mainstream Linux distributions areLSB-certified or about to be certified.

Qt 3.3 became a part of the standard with the LSB 3.1 release. To createLSB-compliant Qt applications, the LSB Software Development Kit 3.1 from [www.linuxbase.org www.linuxbase.org] is required. After installing the SDK,/opt/lsb/bin needs to be added to the PATH environmentvariable, then Qt projects can be rebuilt by running qmake followed bymake.

Instead of g++, each project should now be built with lsbc++.lsbc++ is a wrapper around g++ that makes sure that only LSB-compliantfunction calls are used. The resulting executable will then run on all LSB 3.1-compliantsystems out of the box, without requiring the user to install extra packagesor tweak their system in other ways.

Qt 4.1 is currently an optional LSB module that will become part of the standard in a later version. This means that Qt 4.1 applications might not run out of the box, but require installation of the extra Qt 4.1 package that most distributors ship. Most package installation tools will do that transparently when resolving the package dependencies. To build an LSB compliant Qt 4 application, the LSB_MODULES environment variable has to beset to Qt4 before building the project, as mentioned above.

If you are not using qmake, make sure to tell your build system to uselsbcc and lsbc++ instead of gcc and g++. For GNU Autotools,this can be achieved by setting the environment variables CC and CXX.

The LSB documentation, available from the LSB website, has a whole chapterabout packaging your application.Currently, rpm is used to create and install packages, which is not very friendly for Debian-based distributions. However, the alien tool(available as a package for Debian and other distributions)understands LSB-compliant RPM packages and will install them. This issue is currently being fixed for the LSB 3.2 release.

The Linux Standard Base is progressively creating a platform forindependent software vendors (ISVs) on Linux. Trolltech is continuingto support this effort, strengthening the "write once, deployanywhere" promise.


Copyright © 2006 Trolltech Trademarks