3
<TITLE>Quickly Tutorial Part 3</TITLE>
19
<H1>Introduction to Part 3</H1>
20
<P>In parts 1 and 2, we showed how to create a simple Ubuntu application using Quickly. This section will cover how to package an application so that it is easy for you to share, and easy for other people to install.</P>
21
<H1>License your Project</H1>
22
<P>It's important to license your code so users and other programmers know their rights in terms of redistributing or modifying it. To quickly grant a GPL license to your code, simply:</P>
24
<LI>Specify your name and email address in the Copyright file.</LI>
25
<LI>Run the "license" command.</LI>
27
<H2>Specify your name and email</H2>
28
<P>When Quickly created your Ubuntu project, it added a file named Copyright in the top level of the directory. Open this file in your text editor, and modify the top line so it has your name and email included. Be sure not to modify other lines as it will interfere with the next step. For example, I would change the entire file to look like this:</P>
29
<DIV class="code"><TEXTAREA rows="3" cols="80">
30
# Copyright (C) 2009 Rick Spencer rick.spencer@canonical.com
31
### BEGIN AUTOMATIC LICENSE GENERATION
32
### END AUTOMATIC LICENSE GENERATION
34
<H2>Run the "License" Command</H2>
35
<P>By default, Quickly will use a GPL 3 license for your project. To use this license, use this command:</P>
36
<DIV class="terminal"><TEXTAREA rows="1" cols="80">
39
This will add the GPL 3 license to all of your code files that you've added to your project using Quickly.
41
<P>Keep in mind a couple of things:<P>
43
<LI>This is a one way trip. Once you license the project, changes to the license must be done manually.</LI>
44
<LI>If you prefer a GPL 2 license, you can specify that when you issue the license command:
45
<DIV class="terminal"><TEXTAREA rows="1" cols="80">
46
$quickly license GPL-2
49
<LI>Quickly doesn't care what license you use, but only knows natively what files and headers to include for BSD, GPL-2, GPL-3, LGPL-2 and LGPL-3. If you prefer another license, you can simply add whatever you license you like by adding your own license in the Copyright file:
50
<DIV class="code"><TEXTAREA rows="3" cols="80">
51
### BEGIN AUTOMATIC LICENSE GENERATION
52
# My personal license here
53
### END AUTOMATIC LICENSE GENERATION
56
<DIV class="code"><TEXTAREA rows="1" cols="80">
59
to license every files.
61
<LI>If you've added code files or other files to your project manually, you will need to add the license to those files manually or add those tags at the beginning of the file:
62
<DIV class="code"><TEXTAREA rows="2" cols="80">
68
<H1>Specify Application Settings</H1>
70
You should personalize your application a little before creating the archive. This is very easy to do, as all of the files that you need have already been created, and only need a few lines changed to make them your own. To do this you should:
73
<LI>Personalize the Application Icon</LI>
74
<LI>Edit the Desktop File</LI>
75
<LI>Edit the setup.py File</LI>
77
<H2>Personalize your Application Icon</H2>
79
When users install your application, Ubuntu will display an icon next to it in the menus. You can create your own icon or edit the file called "icon.png" in the media directory (jotty/data/media). Ubuntu comes with a great image editing program called "Gimp." So you can go:</P>
80
<DIV class="terminal"><TEXTAREA rows="1" cols="80">
81
$gimp data/media/icon.png
83
<IMG SRC="./images/package0.png" ALT="customized jotty icon" />
86
If you don't personalize the icon, it's ok, your app will just have the default icon, such as in the image below.
88
<H2>Edit the Desktop File</H2>
90
By default, Quickly Ubuntu-Project applications are classified as "utilities", so they show up under the Accessories menu in Ubuntu. If we wanted to make Jotty show up in another category, we can do this by editing the desktop file. A desktop file is a file that describes your application to a Linux desktop. The file "jottydesktop.in" was automatically created in the jotty project directory. To change Jotty from a Utility to an Office application, edit jotty.desktop.in and change this:
92
<DIV class="code"><TEXTAREA rows="8" cols="80">
95
Comment=Jotty application
96
Categories=GNOME;Utility;
106
<DIV class="code"><TEXTAREA rows="8" cols="80">
109
Comment=Jotty application
110
Categories=GNOME;Office;
117
There are lots more categories that you can use, all defined by the FreeDesktop spec. You can see the complete list in the <A HREF="http://standards.freedesktop.org/menu-spec/latest/apa.html">menu spec</A>.
119
<H2>Edit Setup.py</H2>
121
Finally, you should include some informatoin in the setup.py file to tell your users a little about yourself. The setup.py file was created for you, just like the desktop file. Most of of the setup.py file shouldn't be modified, as it is just boiler plate that makes your application work properly after it has been installed. However, there is a section at the bottom of the setup.py file that you should edit to describe yourself and the application.
124
So I would change this section:
126
<DIV class="code"><TEXTAREA rows="8" cols="80">
127
DistUtilsExtra.auto.setup(
132
#author_email='email@ubuntu.com',
133
#description='UI for managing …',
134
#long_description='Here a longer description',
135
#url='https://launchpad.net/jotty',
136
cmdclass={'install': InstallAndUpdateDataDirectory}
142
<DIV class="code"><TEXTAREA rows="8" cols="80">
143
DistUtilsExtra.auto.setup(
147
author='Rick Spencer',
148
author_email='rick.spencer@canonical.com',
149
description='Note taking application',
150
long_description='Note taking application that uses CouchDB as the backend to support easy replication across users and computers.',
151
#url='https://launchpad.net/jotty',
152
cmdclass={'install': InstallAndUpdateDataDirectory}
155
<P>Note that the license has already been set up for you. author and author_email are updated each time you connect to Launchpad (with quickly release or quickly share) with your Launchpad real name and preferred email adress.</P>
157
Notice that Jotty doesn't have a web page yet, so I just left that line commented out. Also, you don't have to increment version number as quickly share and quickly release commands will make it for you..
161
<H1>Create and Test the Debian Archive</H1>
163
After personalizing the project, we are now ready to create the package. This is easily done by issuing the package command:
165
<DIV class="terminal"><TEXTAREA rows="1" cols="80">
168
<P>This command will take a little while to discover dependencies and create all the required archives, etc... It will also report some errors as we haven't created a PGP key, for instance. None the less, when it is done, the package will be created. Using the file browser, you can see the created package next to the project directory:</P>
169
<IMG SRC="./images/package1.png" ALT="package command creates .deb archive" />
170
<P>Right now, the specific file we are interested in is "jotty_0.1_all.deb". To test it out, double click on it, to open it in Ubuntu's graphical installer program:</P>
171
<IMG SRC="./images/package2.png" ALT="deb opened in gdebi" />
172
<P>Click "Install Package" to see how it installs onto your desktop. After chugging for a bit, you'll see that it is installed in the Applications->Office menu. If you customized your icon, you'll see that the menu uses your custom icon as well.</p>
173
<IMG SRC="./images/package3.png" ALT="jotty installed" />
174
<H1>Now that you have a package</H1>
175
<P>Now that you've packaged your application, you can share the .deb file. However, if your users install their application this way, and you update the application, your users will have to find this out and resinstall. This hassle can be avoided in Ubuntu by using Personal Package Archives (or PPAs). Distrubuting your applications in this manner is covered in section 4 (not yet available).</P>