Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Distributing Python-programs to Ubuntu users

2 views
Skip to first unread message

Olof Bjarnason

unread,
Sep 25, 2009, 2:15:18 AM9/25/09
to pytho...@python.org
Hi!

I write small games in Python/PyGame. I want to find a way to make a
downloadable package/installer/script to put on my webpage, especially
for Ubuntu users.

I've skimmed a couple of tutorials on how to generate .deb-files, but,
wow, it's a whole new skill set to do that!

Does anyone have any hint on a more economic way of creating
single-file distribution packages for Python+PyGame projects? Maybe
some GUI-tool that automates the .deb file creation process, but
targetting Python specifically and not C++.

/Olof

Ben Finney

unread,
Sep 25, 2009, 2:39:10 AM9/25/09
to
Olof Bjarnason <olof.bj...@gmail.com> writes:

> I write small games in Python/PyGame. I want to find a way to make a
> downloadable package/installer/script to put on my webpage, especially
> for Ubuntu users.

As a program developer, you should be less concerned with the specifics
of any particular distribution, and aim first to make your work easily
adopted by those with motivation for that particular distribution.

This goal is made easier for program developers by standards and
specifications aimed at that purpose. A major one is the Filesystem
Hierarchy Standard <URL:http://www.pathname.com/fhs/>, and desktop
application programs should comply with the relevant specifications at
<URL:http://www.freedesktop.org/wiki/Specifications>.

> I've skimmed a couple of tutorials on how to generate .deb-files, but,
> wow, it's a whole new skill set to do that!

Right. A major benefit of the Debian (and hence Ubuntu) operating system
is a detailed, comprehensive policy on how to package the works for
integration with the whole operating system, and strict enforcement of
that policy.

That benefit comes at a cost: Packaging the work in such a way that it
complies with the Debian policy requires a certain amount of study and
discipline, and so is not a task that you should take on lightly. It's
often much better to form a relationship with someone who knows the
topic well who is also motivated to package your software. That person
(or group) becomes the “maintainer” of your work in Debian, and as you
have noted has a big enough job as it is.

Likewise for Ubuntu, Fedora, etc. to the extent that the distribution
has such a packaging policy.

> Does anyone have any hint on a more economic way of creating
> single-file distribution packages for Python+PyGame projects? Maybe
> some GUI-tool that automates the .deb file creation process, but
> targetting Python specifically and not C++.

Such tools do exist, but in my opinion they do more harm than good.
Their results cannot be anywhere near as suitable as the result of
someone who knows both your specific work and the relevant policy.
Better to lay solid groundwork by conforming firstly to the
distribution-agnostic specifications.

A sufficiently useful program that is also conformant with relevant
standards will be highly attractive to skilled packagers, and they will
be grateful to not have to fight against your work to get it to
integrate properly.

--
\ “There is something wonderful in seeing a wrong-headed majority |
`\ assailed by truth.” —John Kenneth Galbraith, 1989-07-28 |
_o__) |
Ben Finney

Javier Collado

unread,
Sep 25, 2009, 3:25:15 AM9/25/09
to Olof Bjarnason, pytho...@python.org
Hello,

I recommend you to check this:
https://wiki.ubuntu.com/PackagingGuide/Complete

The best way to release the software to Ubuntu users is by means of a
PPA (https://help.launchpad.net/Packaging/PPA) so that people can
track your application updates automatically. Before the PPA is
created you need to have a launchpad account and a sign the Ubuntu
Code of Conduct. However isn't that hard and you just have to do all
this setup for the first time.

A tool that might be used to automate package creation for an
application is Quickly (https://wiki.ubuntu.com/Quickly). However, if
the project development has already started, probably it won't be
useful for you.

Best regards,
Javier

2009/9/25 Olof Bjarnason <olof.bj...@gmail.com>:
> Hi!


>
> I write small games in Python/PyGame. I want to find a way to make a
> downloadable package/installer/script to put on my webpage, especially
> for Ubuntu users.
>

> I've skimmed a couple of tutorials on how to generate .deb-files, but,
> wow, it's a whole new skill set to do that!
>

> Does anyone have any hint on a more economic way of creating
> single-file distribution packages for Python+PyGame projects? Maybe
> some GUI-tool that automates the .deb file creation process, but
> targetting Python specifically and not C++.
>

> /Olof
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Donn

unread,
Sep 25, 2009, 3:26:23 AM9/25/09
to pytho...@python.org
On Friday 25 September 2009 08:15:18 Olof Bjarnason wrote:
> Does anyone have any hint on a more economic way of creating
> single-file distribution packages
You could use distutils (setup.py) and include a readme that explains what
apt-get commands to use to install pygame, etc. Generally it's better to *not*
include the kitchen-sink with your apps; rather expect the user to have those
libraries already or be able to fetch them with ease.
I did my best at explaining that deeply confusing setup.py process here:
http://wiki.python.org/moin/Distutils/Tutorial

I have also seen two other approaches:
1. A new app called 'Quickly' which is some kind of magical auto-do-
everything-ubuntu connected to Launchpad. From what I hear it sounds very
cool. https://wiki.ubuntu.com/DesktopTeam/Specs/Karmic/Quickly
2. The Ubuntu PPA repositories -- google around. (Seems Quickly does this too)

hth,
\d
--
home: http://otherwise.relics.co.za/
2D vector animation : https://savannah.nongnu.org/projects/things/
Font manager : https://savannah.nongnu.org/projects/fontypython/

Jean Daniel

unread,
Sep 25, 2009, 4:19:15 AM9/25/09
to Olof Bjarnason, pytho...@python.org
Maybe the distutils list is more adapted for this question:

The Zope community uses zc.sourcerelease to build rpm
http://www.mail-archive.com/distut...@python.org/msg06599.html

Buildout is said to have undocumented features to build packages.

Tarek Ziade is working debian package with 'distribute'.

Cheers,


On Fri, Sep 25, 2009 at 8:15 AM, Olof Bjarnason
<olof.bj...@gmail.com> wrote:
> Hi!
>
> I write small games in Python/PyGame. I want to find a way to make a
> downloadable package/installer/script to put on my webpage, especially
> for Ubuntu users.
>
> I've skimmed a couple of tutorials on how to generate .deb-files, but,
> wow, it's a whole new skill set to do that!
>

> Does anyone have any hint on a more economic way of creating

> single-file distribution packages for Python+PyGame projects? Maybe
> some GUI-tool that automates the .deb file creation process, but
> targetting Python specifically and not C++.
>
> /Olof
> --
> http://mail.python.org/mailman/listinfo/python-list
>

--
Rasterization Zion babylon

Olof Bjarnason

unread,
Sep 25, 2009, 4:21:58 AM9/25/09
to pytho...@python.org
2009/9/25 Jean Daniel <jeandani...@gmail.com>:

> Maybe the distutils list is more adapted for this question:

Yes

>
> The Zope community uses zc.sourcerelease to build rpm
> http://www.mail-archive.com/distut...@python.org/msg06599.html
>
> Buildout is said to have undocumented features to build packages.
>
> Tarek Ziade is working debian package with 'distribute'.

Thanks Jean!

>
> Cheers,
>
>
> On Fri, Sep 25, 2009 at 8:15 AM, Olof Bjarnason
> <olof.bj...@gmail.com> wrote:
>> Hi!
>>
>> I write small games in Python/PyGame. I want to find a way to make a
>> downloadable package/installer/script to put on my webpage, especially
>> for Ubuntu users.
>>
>> I've skimmed a couple of tutorials on how to generate .deb-files, but,
>> wow, it's a whole new skill set to do that!
>>
>> Does anyone have any hint on a more economic way of creating
>> single-file distribution packages for Python+PyGame projects? Maybe
>> some GUI-tool that automates the .deb file creation process, but
>> targetting Python specifically and not C++.
>>
>> /Olof
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Rasterization Zion babylon
>

--
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english

Paul Boddie

unread,
Sep 25, 2009, 6:55:51 AM9/25/09
to
On 25 Sep, 08:15, Olof Bjarnason <olof.bjarna...@gmail.com> wrote:
> Hi!
>
> I write small games in Python/PyGame. I want to find a way to make a
> downloadable package/installer/script to put on my webpage, especially
> for Ubuntu users.
>
> I've skimmed a couple of tutorials on how to generate .deb-files, but,
> wow, it's a whole new skill set to do that!

If you start simple and don't have to produce extension modules, it's
not too bad, but finding all the right tools is an awkward task. I'm
not sure that I've really mastered the craft yet.

> Does anyone have any hint on a more economic way of creating
> single-file distribution packages for Python+PyGame projects? Maybe
> some GUI-tool that automates the .deb file creation process, but
> targetting Python specifically and not C++.

You could take a look at this PyGame project:

http://www.infukor.com/rally7.html

The sources contain packaging infrastructure for Debian/Ubuntu, and
you could certainly adapt that for your own purposes.

Paul

Paul Boddie

unread,
Sep 25, 2009, 7:05:28 AM9/25/09
to
On 25 Sep, 09:26, Donn <donn.in...@gmail.com> wrote:
>
> You could use distutils (setup.py) and include a readme that explains what
> apt-get commands to use to install pygame, etc. Generally it's better to *not*
> include the kitchen-sink with your apps; rather expect the user to have those
> libraries already or be able to fetch them with ease.

The various package installers and dpkg will probably complain about
missing packages, but one could go all the way and set up a repository
which works with apt-get. I did something elementary of this nature
with some Shed Skin packages:

http://packages.boddie.org.uk/

There will undoubtedly be things I haven't quite done right here, but
it would give a reasonable installation experience, although there
would need to be a number of packages available through the repository
for the configuration exercise to be worthwhile.

> I did my best at explaining that deeply confusing setup.py process here:http://wiki.python.org/moin/Distutils/Tutorial

This is a nice tutorial, and I'll have to see if I can contribute
anything to it later.

> I have also seen two other approaches:
> 1. A new app called 'Quickly' which is some kind of magical auto-do-
> everything-ubuntu connected to Launchpad. From what I hear it sounds very

> cool.https://wiki.ubuntu.com/DesktopTeam/Specs/Karmic/Quickly


> 2. The Ubuntu PPA repositories -- google around. (Seems Quickly does this too)

The problem with some Ubuntu stuff, sadly, is that the maintainers
like to have their own special toolset which isolates them from the
more general Debian ways of working. In addition, Launchpad, despite
its recent open-sourcing (in most respects), is perceived as something
of a walled garden. Still, if it contributes good ideas to the
mainstream, I suppose it's not all bad.

Paul

Olof Bjarnason

unread,
Sep 25, 2009, 7:08:45 AM9/25/09
to pytho...@python.org
2009/9/25 Paul Boddie <pa...@boddie.org.uk>:

> On 25 Sep, 08:15, Olof Bjarnason <olof.bjarna...@gmail.com> wrote:
>> Hi!
>>
>> I write small games in Python/PyGame. I want to find a way to make a
>> downloadable package/installer/script to put on my webpage, especially
>> for Ubuntu users.
>>
>> I've skimmed a couple of tutorials on how to generate .deb-files, but,
>> wow, it's a whole new skill set to do that!
>
> If you start simple and don't have to produce extension modules, it's
> not too bad, but finding all the right tools is an awkward task. I'm
> not sure that I've really mastered the craft yet.
>
>> Does anyone have any hint on a more economic way of creating
>> single-file distribution packages for Python+PyGame projects? Maybe
>> some GUI-tool that automates the .deb file creation process, but
>> targetting Python specifically and not C++.
>
> You could take a look at this PyGame project:
>
> http://www.infukor.com/rally7.html

Thanks this might come in handy.

>
> The sources contain packaging infrastructure for Debian/Ubuntu, and
> you could certainly adapt that for your own purposes.
>
> Paul

> --
> http://mail.python.org/mailman/listinfo/python-list
>

--
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english

Olof Bjarnason

unread,
Sep 25, 2009, 7:21:43 AM9/25/09
to pytho...@python.org
2009/9/25 Paul Boddie <pa...@boddie.org.uk>:
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Thanks for you answers.

I am thinking of two target audiences:

1. Early adopters/beta-testers. This would include:
- my non-computer-geek brother on a windows-machine. I'll go for py2exe.
- any non-geek visiting my blog using windows (py2exe)
- any geeks visiting my blog that use Ubuntu (tell them about the PPA-system)
- any geeks visiting my blog that are non-Ubuntu (i'll just provide
the source code and tell them to apt-get python-pygame)

2. Future players
- I'll try to find people that want me to help package the game for
different OSs. This list might come in handy ;)


--
twitter.com/olofb
olofb.wordpress.com
olofb.wordpress.com/tag/english

Ben Finney

unread,
Sep 25, 2009, 8:53:50 AM9/25/09
to
Olof Bjarnason <olof.bj...@gmail.com> writes:

> - any geeks visiting my blog that are non-Ubuntu (i'll just provide
> the source code and tell them to apt-get python-pygame)

Note that for several years now the recommended command-line tool for
package installation is not ‘apt-get’, but ‘aptitude’ [0]. Compatible
command-line interface, uses the same back-end library and package
system, but many improvements in behaviour; especially the distinction
between manually-requested packages versus automatically-installed
packages that can be later removed when they're no longer needed.

[0] <URL:http://www.debian.org/doc/manuals/reference/ch02.en.html#_basic_package_management_operations>

--
\ “The problem with television is that the people must sit and |
`\ keep their eyes glued on a screen: the average American family |
_o__) hasn't time for it.” —_The New York Times_, 1939 |
Ben Finney

Olof Bjarnason

unread,
Sep 25, 2009, 9:00:06 AM9/25/09
to pytho...@python.org
2009/9/25 Ben Finney <ben+p...@benfinney.id.au>:

> Olof Bjarnason <olof.bj...@gmail.com> writes:
>
>>   - any geeks visiting my blog that are non-Ubuntu (i'll just provide
>> the source code and tell them to apt-get python-pygame)
>
> Note that for several years now the recommended command-line tool for
> package installation is not ‘apt-get’, but ‘aptitude’ [0]. Compatible
> command-line interface, uses the same back-end library and package
> system, but many improvements in behaviour; especially the distinction
> between manually-requested packages versus automatically-installed
> packages that can be later removed when they're no longer needed.

Great thanks for this info. I just tried running it on a vanilla
Ubuntu system, and it is there.

Most tutorials on the web still (I've read mostly Ubuntu-related
forums) mention apt-get; seems like an error?

>
> [0] <URL:http://www.debian.org/doc/manuals/reference/ch02.en.html#_basic_package_management_operations>
>
> --
>  \        “The problem with television is that the people must sit and |
>  `\    keep their eyes glued on a screen: the average American family |
> _o__)                 hasn't time for it.” —_The New York Times_, 1939 |
> Ben Finney

Ben Finney

unread,
Sep 25, 2009, 9:39:59 AM9/25/09
to
Olof Bjarnason <olof.bj...@gmail.com> writes:

> Most tutorials on the web still (I've read mostly Ubuntu-related
> forums) mention apt-get; seems like an error?

Not quite an error (since ‘apt-get’ continues to work), just habit of
old-timers, and cargo-cult administration by newcomers.

--
\ “Science doesn't work by vote and it doesn't work by |
`\ authority.” —Richard Dawkins, _Big Mistake_ (The Guardian, |
_o__) 2006-12-27) |
Ben Finney

Paul Rudin

unread,
Sep 25, 2009, 9:47:05 AM9/25/09
to
Ben Finney <ben+p...@benfinney.id.au> writes:

> Olof Bjarnason <olof.bj...@gmail.com> writes:
>
>> Most tutorials on the web still (I've read mostly Ubuntu-related
>> forums) mention apt-get; seems like an error?
>
> Not quite an error (since ‘apt-get’ continues to work), just habit of
> old-timers, and cargo-cult administration by newcomers.

It also appears that the installed software advises it, e.g.:

paul@sleeper-service:~$ sbcl
The program 'sbcl' is currently not installed. You can install it by typing:
sudo apt-get install sbcl
bash: sbcl: command not found

Daniel S. Braz

unread,
Sep 25, 2009, 11:43:01 AM9/25/09
to pytho...@python.org
Hi,

To create a .deb file you may use checkinstall, it's very simple and
work very well.

Em 25/09/2009, às 03:15, Olof Bjarnason escreveu:

> Hi!
>
> I write small games in Python/PyGame. I want to find a way to make a
> downloadable package/installer/script to put on my webpage, especially
> for Ubuntu users.
>
> I've skimmed a couple of tutorials on how to generate .deb-files, but,
> wow, it's a whole new skill set to do that!
>

> Does anyone have any hint on a more economic way of creating
> single-file distribution packages for Python+PyGame projects? Maybe
> some GUI-tool that automates the .deb file creation process, but
> targetting Python specifically and not C++.
>

> /Olof
> --
> http://mail.python.org/mailman/listinfo/python-list

Olof Bjarnason

unread,
Sep 25, 2009, 11:54:20 AM9/25/09
to pytho...@python.org
2009/9/25 Daniel S. Braz <dsb...@gmail.com>:

> Hi,
>
> To create a .deb file you may use checkinstall, it's very simple and work
> very well.

Hi Daniel,

>From what I gather browsing the web abount checkinstall, it seems to
be built with "make install" in mind.

Does it work with "python setup.py install" too?

>
> Em 25/09/2009, às 03:15, Olof Bjarnason escreveu:
>
>> Hi!
>>
>> I write small games in Python/PyGame. I want to find a way to make a
>> downloadable package/installer/script to put on my webpage, especially
>> for Ubuntu users.
>>
>> I've skimmed a couple of tutorials on how to generate .deb-files, but,
>> wow, it's a whole new skill set to do that!
>>
>> Does anyone have any hint on a more economic way of creating
>> single-file distribution packages for Python+PyGame projects? Maybe
>> some GUI-tool that automates the .deb file creation process, but
>> targetting Python specifically and not C++.
>>
>> /Olof
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>

Daniel S. Braz

unread,
Sep 25, 2009, 12:15:32 PM9/25/09
to pytho...@python.org
Yes, it work with any command that you can run on a shell. You could
write a shell script to "tell" to checkinstall what to do with your
program. I used to use it with java programs.
I will send to your e-mail a simple sample script, so you will see how
it's work.

(sorry for my -- very -- bad english)

Daniel

> --
> http://mail.python.org/mailman/listinfo/python-list

Paul Boddie

unread,
Sep 25, 2009, 4:57:26 PM9/25/09
to
On 25 Sep, 13:21, Olof Bjarnason <olof.bjarna...@gmail.com> wrote:
>
> I am thinking of two target audiences:
>
> 1. Early adopters/beta-testers. This would include:
>   - my non-computer-geek brother on a windows-machine. I'll go for py2exe.
>   - any non-geek visiting my blog using windows (py2exe)

I'd really like to hear of any positive experiences making installers
involving PyGame for any system, but especially for Windows using
cross-compilation of Python and library dependencies from non-Windows
systems with tools such as gcc for mingw32.

>   - any geeks visiting my blog that use Ubuntu (tell them about the PPA-system)
>   - any geeks visiting my blog that are non-Ubuntu (i'll just provide
> the source code and tell them to apt-get python-pygame)

Typically, applications such as games written to use PyGame can just
run out of their distribution directory if that's good enough. You can
go to all kinds of lengths to make the game comply with packaging
standards and appear in the desktop menus - the latter is actually
quite easy within the Debian packaging infrastructure once you know
how - but it's not really necessary.

Paul

Olof Bjarnason

unread,
Sep 25, 2009, 5:14:29 PM9/25/09
to pytho...@python.org
2009/9/25 Paul Boddie <pa...@boddie.org.uk>:

> On 25 Sep, 13:21, Olof Bjarnason <olof.bjarna...@gmail.com> wrote:
>>
>> I am thinking of two target audiences:
>>
>> 1. Early adopters/beta-testers. This would include:
>>   - my non-computer-geek brother on a windows-machine. I'll go for py2exe.
>>   - any non-geek visiting my blog using windows (py2exe)
>
> I'd really like to hear of any positive experiences making installers
> involving PyGame for any system, but especially for Windows using
> cross-compilation of Python and library dependencies from non-Windows
> systems with tools such as gcc for mingw32.

I'm using VirtualBox+WinXP on my Ubuntu development computer. Good
enough for me..

>
>>   - any geeks visiting my blog that use Ubuntu (tell them about the PPA-system)
>>   - any geeks visiting my blog that are non-Ubuntu (i'll just provide
>> the source code and tell them to apt-get python-pygame)
>
> Typically, applications such as games written to use PyGame can just
> run out of their distribution directory if that's good enough. You can
> go to all kinds of lengths to make the game comply with packaging
> standards and appear in the desktop menus - the latter is actually
> quite easy within the Debian packaging infrastructure once you know
> how - but it's not really necessary.

So what approach do you suggest? I've gotten as far as understanding
how to add menu-items to the Ubuntu menus, simple .desktop file format
to do that.

One could "cheat" and write an install.sh script that adds the
appropriate menu item, sudo-apt-gets the PyGame dependency (python is
there by default in Ubuntu). The menu item could point to the download
directory simply..

>
> Paul

Paul Boddie

unread,
Sep 25, 2009, 8:28:24 PM9/25/09
to
On 25 Sep, 23:14, Olof Bjarnason <olof.bjarna...@gmail.com> wrote:
>
> So what approach do you suggest? I've gotten as far as understanding
> how to add menu-items to the Ubuntu menus, simple .desktop file format
> to do that.

Yes, xdg-desktop-menu will probably do the trick.

> One could "cheat" and write an install.sh script that adds the
> appropriate menu item, sudo-apt-gets the PyGame dependency (python is
> there by default in Ubuntu). The menu item could point to the download
> directory simply..

I suppose the distribution of simple archives isn't enough if you want
the dependency to be pulled in. I personally would therefore just make
some quite simple Debian/Ubuntu packaging and distribute a .deb file -
I believe most distributions of this flavour have a graphical tool
which will offer to install such packages if downloaded, and the whole
sudo business would be taken care of by such a tool. This isn't how I
obtain software, however, so you might want to experiment a little.

Paul

Florian Diesch

unread,
Sep 25, 2009, 8:46:34 PM9/25/09
to
Ben Finney <ben+p...@benfinney.id.au> writes:

> Olof Bjarnason <olof.bj...@gmail.com> writes:
>
>> - any geeks visiting my blog that are non-Ubuntu (i'll just provide
>> the source code and tell them to apt-get python-pygame)
>
> Note that for several years now the recommended command-line tool for
> package installation is not ‘apt-get’, but ‘aptitude’ [0].

That's only true for Debian but not for Ubuntu; the official
Ubuntu Server guide uses apt-get: <https://help.ubuntu.com/9.04/serverguide/C/httpd.html>


Florian
--
<http://www.florian-diesch.de/software/pdfrecycle/>

0 new messages