Packaging a Qt application
Line 2: | Line 2: | ||
== Looking for a debian package of your Application == | == Looking for a debian package of your Application == | ||
If you want to port a popular Qt application probably it is already packaged for debian. | If you want to port a popular Qt application probably it is already packaged for debian. | ||
- | You can try to get the package source in a couple of different | + | You can try to get the package source in a couple of different ways: |
* Adding a debian src repository in your /etc/apt/source.list file | * Adding a debian src repository in your /etc/apt/source.list file | ||
<pre> | <pre> | ||
Line 20: | Line 20: | ||
in order to creating a new package, you need to: | in order to creating a new package, you need to: | ||
* Rename the upstream source directory in Package-Version (eg: myapp-0.1) | * Rename the upstream source directory in Package-Version (eg: myapp-0.1) | ||
- | * Run dh_make to debianize the source archive, it creates: | + | * Create “src” directory in Package-Version/ |
+ | * Copy all the files in the src/ | ||
+ | * Rename src/appname.pro in src/src.pro | ||
+ | <pre> | ||
+ | $mv myapp myapp-0.1 | ||
+ | $cd myapp-0.1 | ||
+ | $mkdir src | ||
+ | $cp * src | ||
+ | $mv src/appname.pro src/src.pro | ||
+ | </pre> | ||
+ | *Create a myapp-0.1/myapp.pro file like this: | ||
+ | <pre> | ||
+ | QMAKEVERSION = $$[QMAKE_VERSION] | ||
+ | ISQT4 = $$find(QMAKEVERSION, ^[2-9]) | ||
+ | isEmpty( ISQT4 ) { | ||
+ | error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4"); | ||
+ | } | ||
+ | |||
+ | TEMPLATE = subdirs | ||
+ | SUBDIRS = src | ||
+ | </pre> | ||
+ | *Run dh_make to debianize the source archive, it creates: | ||
**An archive with the unchanged upstream source (orig.tar.gz) | **An archive with the unchanged upstream source (orig.tar.gz) | ||
**Some basic files in the debian directory | **Some basic files in the debian directory | ||
**Some example files (*.EX *.ex) | **Some example files (*.EX *.ex) | ||
- | + | <pre> | |
- | + | dh_make --createorig --single -e maintainer@email.org -c gpl | |
+ | </pre> | ||
= Useful Links = | = Useful Links = | ||
[http://qt4.garage.maemo.org Qt4Maemo at garage] | [http://qt4.garage.maemo.org Qt4Maemo at garage] |
Revision as of 14:11, 17 September 2008
Contents |
Packaging a Qt Application
Looking for a debian package of your Application
If you want to port a popular Qt application probably it is already packaged for debian. You can try to get the package source in a couple of different ways:
- Adding a debian src repository in your /etc/apt/source.list file
$echo “deb http://ftp.it.debian.org/debian/ unstable main contrib non-free” >> /etc/apt/source.list $apt-get update $apt-cache search app_name $apt-get source app_name
- Checking http://packages.debian.org, downloading the following files and running dpkg-source -x app_name.dsc to decompress the upstream source and to apply the changes available in the diff.gz file.
- upstream source file (.tar.gz)
- package changes (.diff.gz)
- meta-data information file (.dsc)
Creating a Debian package for a new Qt Application
If your application has been already packaged, you can jump this section. If your application is quite younger and you need to package it by yourself, in order to creating a new package, you need to:
- Rename the upstream source directory in Package-Version (eg: myapp-0.1)
- Create “src” directory in Package-Version/
- Copy all the files in the src/
- Rename src/appname.pro in src/src.pro
$mv myapp myapp-0.1 $cd myapp-0.1 $mkdir src $cp * src $mv src/appname.pro src/src.pro
- Create a myapp-0.1/myapp.pro file like this:
QMAKEVERSION = $$[QMAKE_VERSION] ISQT4 = $$find(QMAKEVERSION, ^[2-9]) isEmpty( ISQT4 ) { error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4"); } TEMPLATE = subdirs SUBDIRS = src
- Run dh_make to debianize the source archive, it creates:
- An archive with the unchanged upstream source (orig.tar.gz)
- Some basic files in the debian directory
- Some example files (*.EX *.ex)
dh_make --createorig --single -e maintainer@email.org -c gpl