Thursday, February 28, 2013

Ubuntu - How to package Qt application (part 1)

Package preparations

 

In this tutorial I will show you how to package Qt application in Ubuntu. After packaging you'll be able to upload your app to Launchpad and share your application with milions of Linux users. Also if you want to submit your app to Ubuntu Software Center, submit process will be a lot faster if you upload already packaged app. 

 So let's start...


Before packaging our app we need to install components which we'll need in order to properly package the application. To install those components run this command in Terminal:

sudo apt-get install devscripts build-essential fakeroot debhelper gnupg pbuilder dh-make

 After we prepared our components now we need to make GPG key. GPG key (GnuPrivacyGuard) is key which allows you to sign documents, mails, applications etc. With this key everyone will know that you made that product.
Easiest way for making GPG key is using Passwords and Encryption Keys tool. Open Dash and type Passwords and Encryption Keys
-      Select File -> New, select PGP Key and then follow the on-screen instructions. 
 After creating your key, you'll see it in list of keys.

Now you need to publish your key. Follow these instructions which are copied from Launchpad.net:


Your key is useful only if other people can verify items that you sign. By publishing your key to a keyserver, which acts as a directory of people's public keys, you can make your public key available to anyone else.
Before you add your key to Launchpad, you need to push it to the Ubuntu keyserver.


Using Passwords and Encryption Keys

Step 1 Open Passwords and Encryption Keys.
Step 2 Select the My Personal Keys tab, select your key.
Step 3 Select Remote > Sync and Publish Keys from the menu. Choose the Sync button. (You may need to add hkp://keyserver.ubuntu.com to your key servers if you are not using Ubuntu.)
It can take up to thirty minutes before your key is available to Launchpad. After that time, you're ready to import your new key into Launchpad.


Importing an OpenPGP key

To import your OpenPGP key into Launchpad, you first need the key's fingerprint.
Note: You must ensure your key is in the Ubuntu keyserver before you try to add it to Launchpad.

Retrieving the key in Ubuntu

The easiest way to generate a new OpenPGP key in Ubuntu is to use the Passwords and Encryption Keys tool. If you are using Ubuntu 10.04 or an earlier version, it is located at Applications > Accessories > Passwords and Encryption Keys. In Ubuntu 10.10 and later versions, it is located at System > Preferences > Passwords and Encryption Keys.
Step 1 Open Passwords and Encryption Keys.
Step 2 Select the My Personal Keys tab, select your key and open the property window by pressing Space Bar or double clicking with your pointer. Select the Details tab of the property window.
Step 3 Select the Fingerprint text (the ten blocks of numbers and letter). Copy the text by pressing the Ctrl+c keys together.

Retrieving the key using the GPG command

Open a terminal and enter:
gpg --fingerprint
GPG will display a message similar to:
pub 1024D/12345678 2007-01-26
Key fingerprint = 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72
Geoffrey Hayes (My OpenPGP key) <geoffrey@bungle.com>
sub 2048g/ABCDEF12 2007-01-26

Highlight and copy only the numeric fingerprint: 0464 39CD 2486 190A 2C5A 0739 0E68 04DC 16E7 CB72 in the example above. 

Now your gpg key is created and ready to use, we have to do just one more thing before packaging. Open Terminal and run sudo pbuilder create. Be patient and wait until it's finished.


After making our first preparations we can proceed to next step.











No comments:

Post a Comment