Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/app/static/doc/myosa/ch014_distribute-your-activity.xhtml
blob: 01ad3521a0cf168f4013999aff35e7a0f83fbfe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><body><h1>Distribute Your Activity
</h1>
<h2>Choose A License
</h2>
<p>Before you give your Activity to anyone you need to choose a license that it will be distributed under.&#160; Buying software is like buying a book.&#160; There are certain rights you have with a book and others you don't have.&#160; If you buy a copy of <em>The DaVinci Code</em> you have the right to read it, to loan it out, to sell it to a used bookstore, or to burn it.&#160; You do <em>not</em> have the right to make copies of it or to make a movie out of it.&#160; Software is the same way, but often worse.&#160; Those long license agreements we routinely accept by clicking a button might not allow you to sell the software when you're done with it, or even give it away.&#160; If you sell your computer you may find that the software you bought is only good for that computer, and only while you are the owner of the computer.&#160; (You can get good deals on reconditioned computers with no operating system installed for that very reason).
</p>
<p>If you are in the business of selling software you might have to hire a lawyer to draw up a license agreement, but if you're giving away software there are several standard licenses you can choose from for free.&#160; The most popular by far is called the <em>General Public License</em>, or GPL.&#160; Like the licenses Microsoft uses it allows the people who get your program to do some things with it but not others.&#160; What makes it interesting is not what it allows them to do (which is pretty much anything they like) but what it forbids them to do.
</p>
<p>If someone distributes a program licensed under the GPL they are also required to make the source code of the program available to anyone who wants it.&#160; That person may do as he likes with the code, with one important restriction: if he distributes a program based on that code he must <em>also</em> license that code using the GPL.&#160; This makes it impossible for someone to take a GPL licensed work, improve it, and sell it to someone without giving him the source code to the new version.
</p>
<p>While the GPL is not the only license available for Activities to be distributed on <a href="http://activities.sugarlabs.org">http://activities.sugarlabs.org</a>&#160; all the licenses require that anyone getting the Activity also gets the complete source code for it.&#160; You've already taken care of that requirement by putting your source code in Gitorious.&#160; If you used any code from an existing Activity licensed with the GPL you <em>must</em> license your own code the same way.&#160; If you used a significant amount of code from this book (which is also GPL licensed) you may be required to use the GPL too.
</p>
<p>Is licensing something you should worry about?&#160; Not really.&#160; The only reason you'd want to use a license other than the GPL is if you wanted to sell your Activity instead of give it away.&#160; Consider what you'd have to do to make that possible:
</p>
<ul><li>You'd have to use some language other than Python so you could give someone the program without giving them the source code.</li>
  <li>You would have to have your own source code repository not available to the general public and make arrangements to have the data backed up regularly.</li>
  <li>You would have to have your own website to distribute the Activity.&#160; The website would have to be set up to accept payments somehow.
  <br/></li>
  <li>You would have to advertise this website somehow or nobody would know your Activity existed.</li>
  <li>You would have to have a lawyer draw up a license for your Activity.</li>
  <li>You would have to come up with some mechanism to keep your customers from giving away copies of your Activity.</li>
  <li>You would have to create an Activity so astoundingly clever that nobody else could make something similar and give it away.</li>
  <li>You would have to deal with the fact that your "customers" would be children with no money or credit cards.</li>
</ul><p>In summary, <a href="http://activities.sugarlabs.org">activities.sugarlabs.org</a>&#160; is not the <em>iPhone App Store</em>.&#160; It is a place where programmers share and build upon each other's work and give the results to children for free.&#160; The GPL encourages that to happen, and I recommend that you choose that for your license.
  <br/></p>
<h2>Add License Comments To Your Python Code
</h2>
<p>At the top of each Python source file in your project (except <strong>setup.py</strong>, which is already commented) put comments like this:
</p>
<p>&#160;
</p>
<pre># <em>filename</em>    <em>Program description</em>
#
# Copyright (C) 2010 <em>Your Name Here</em>
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License as published by the Free Software
# Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General
# Public License along with this program; if not, write
# to the Free Software Foundation, Inc., 51 Franklin
# St, Fifth Floor, Boston, MA 02110-1301  USA
</pre>
<p> If the code is based on someone else's code you should mention that as a courtesy.
</p>
<h2>Create An .xo File
</h2>
<p>Make certain that activity.info has the version number you want to give your Activity (currently it must be a positive integer) and run this command:
</p>
<pre>./setup.py dist_xo</pre>
<p> This will create a <strong>dist</strong> directory if one does not exist and put a file named something like <strong>ReadETextsII-1.xo</strong> in it.&#160; The "1" indicates version 1 of the Activity.
  <br/></p>
<p>If you did everything right this <strong>.xo</strong> file should be ready to distribute.&#160; You can copy it to a thumb drive and install it on an XO laptop or onto another thumb drive running <em>Sugar on a Stick</em>.&#160; You probably should do that before distributing it any further.&#160; I like to live with new versions of my Activities for a week or so before putting them on <a href="http://activities.sugarlabs.org">activities.sugarlabs.org.</a>
  <br/></p>
<p>Now would be a good time to add <strong>dist</strong> to your <strong>.gitignore</strong> file, then commit it and push it to Gitorious.&#160; You don't want to have copies of your .xo files in Git.&#160; Another good thing to do at this point would be to tag your Git repository with the version number so you can identify which code goes with which version.
</p>
<p>
</p>
<pre>git tag -m "Release 1" v1 HEAD
git push --tags
</pre>
<h2>Add Your Activity To ASLO
  <br/></h2>
<p>When you're ready to post the .xo file on ASLO you'll create an account as you did with the other websites.&#160; When you've logged in there you'll see a <strong>Tools</strong> link in the upper right corner of the page. Click on that and you'll see a popup menu with an option for <strong>Developer Hub</strong>, which you should click on.&#160; That will take you to the pages where you can add new Activities.&#160; The first thing it asks for when setting up a new Activity is what license you will use.&#160; After that you should have no problem getting your Activity set up.
</p>
<p>You will need to create an Activity icon as a .gif file and create screen shots of your Activity in action.&#160; You can do both of these things with <em>The GIMP</em> (GNU Image Manipulation Program).&#160; For the icon all you need to do is open the .svg file with The GIMP and <strong>Save As</strong> a .gif file.
</p>
<p>For the screen shots use sugar-emulator to display your Activity in action, then use the <strong>Screenshot</strong> option from the <strong>Create</strong> submenu of the <strong>File</strong> menu with these options:
</p>
<p><img alt="gimp1.jpg" src="static/ActivitiesGuideSugar-gimp1-en.jpg" height="346" width="358"/></p>
<p>This tells GIMP to wait 10 seconds, then take a screenshot of the window you click on with the mouse.&#160; You'll know that the 10 seconds are up because the mouse pointer will change shape to a plus (+) sign.&#160; You also tell it <em>not</em> to include the window decoration (which means the window title bar and border).&#160; Since windows in Sugar do not have decorations eliminating the decorations used by sugar-emulator will give you a screenshot that looks exactly like a Sugar Activity in action.
</p>
<p>Every Activity needs one screenshot, but you can have more if you like.&#160; Screenshots help sell the Activity and instruct those who will use it on what the Activity can do.&#160; Unfortunately, ASLO cannot display pictures in a predictable sequence, so it is not suited to displaying steps to perform.
</p>
<p> Another thing you'll need to provide is a home page for your Activity.&#160; The one for <strong>Read Etexts</strong> is here:
</p>
<p><a href="http://wiki.sugarlabs.org/go/Activities/Read_Etexts">http://wiki.sugarlabs.org/go/Activities/Read_Etexts</a>
  <br/></p>
<p>Yes, one more website to get an account for.&#160; Once you do you can specify a link with <em>/go/Activities/some_name</em> and when you click on that link the Wiki will create a page for you.&#160; The software used for the Wiki is <em>MediaWiki</em>, the same as used for <em>Wikipedia</em>.&#160; Your page does not need to be as elaborate as mine is, but you definitely should provide a link to your source code in Gitorious.
  <br/></p></body></html>