Editing PyMaemo/Scratchboxless packaging guide
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
- | The usual way of developing Maemo applications is using | + | The usual way of developing Maemo applications is using or Scratchbox or [[MADDE]], which are quite heavy for Python development. An alternative is using [http://github.com/astraw/stdeb stdeb], a set of extensions to distutils that allows generating debian packages, both binary and source, that can be installed on the device or sent to the [[extras-devel]] repository. |
- | This tutorial will show how to integrate it into your project, | + | This tutorial will show how to integrate it into your project, building the packages and uploading it to extras-devel. |
== Prerequisites == | == Prerequisites == | ||
- | This tutorial is aimed at Debian-based systems, as some stdeb commands requires the dpkg tools installed. | + | This tutorial is aimed at Debian-based systems, as some stdeb commands requires the dpkg tools installed. In |
- | Also, you should get the [http://github.com/astraw/stdeb git] version of stdeb to use the debianize command, as it is a new addition and not yet available in the repositories. | + | Also, you should get the [http://github.com/astraw/stdeb git] version of stdeb to use the debianize command, as it is a new addition and not yet available in the repositories. |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
As only python2.5 is supported in pymaemo, it should be installed if you want to create binary packages. On Ubuntu Lucid (10.04), you can install it from [https://launchpad.net/~fkrull/+archive/deadsnakes this ppa], following the instructions [http://www.codigomanso.com/en/2010/05/google-app-engine-en--10-4-lucid-lynx/ here]. | As only python2.5 is supported in pymaemo, it should be installed if you want to create binary packages. On Ubuntu Lucid (10.04), you can install it from [https://launchpad.net/~fkrull/+archive/deadsnakes this ppa], following the instructions [http://www.codigomanso.com/en/2010/05/google-app-engine-en--10-4-lucid-lynx/ here]. | ||
Line 27: | Line 15: | ||
== Preparing the package == | == Preparing the package == | ||
- | As stdeb extends distutils, it is necessary that you have a working setup.py script. For our example application, which consists of a [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/myscript single script] named "myscript" and support files like [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/myscript.desktop .desktop] | + | As stdeb extends distutils, it is necessary that you have a working setup.py script. For our example application, which consists of a [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/myscript single script] named "myscript" and support files like [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/myscript.desktop .desktop] and an [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/myscript.png icon], the [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/setup.py setup.py] will look like this: |
<source lang="python"> | <source lang="python"> | ||
from distutils.core import setup | from distutils.core import setup | ||
Line 33: | Line 21: | ||
setup( | setup( | ||
name='myscript', | name='myscript', | ||
- | |||
author='Lauro Moura', | author='Lauro Moura', | ||
author_email='lauro.neto@donotspamme.com', | author_email='lauro.neto@donotspamme.com', | ||
Line 41: | Line 28: | ||
) | ) | ||
</source> | </source> | ||
- | A file named [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/stdeb.cfg stdeb.cfg] in the same directory as setup.py is required, with stdeb | + | A file named [http://pymaemo.garage.maemo.org/stdeb_example/myscript-app/stdeb.cfg stdeb.cfg] in the same directory as setup.py is required, with stdeb maemo-specific options. A detailed list of options can be found in the [http://github.com/astraw/stdeb stdeb website]. |
[DEFAULT] | [DEFAULT] | ||
- | XS-Python-Version: 2.5 # Only version currently supported by | + | XS-Python-Version: 2.5 # Only version currently supported by pymaemo. |
- | Package: | + | Package:myscript # Binary package name. stdeb adds the prefix "python-" by default |
- | Section: user/ | + | Section: user/other # Section should start with user/ to appear in the menu. |
- | Depends: python-gtk2 # extra dependencies | + | Depends: python-gtk2 # add extra dependencies here |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
== Building the packages == | == Building the packages == | ||
Line 65: | Line 46: | ||
After generating, you can copy the package to your device and install it (requires an [[SSH]] server): | After generating, you can copy the package to your device and install it (requires an [[SSH]] server): | ||
- | $ scp myscript_0. | + | $ scp myscript_0.0.0_all.deb root@<n900 ip>:/root |
$ ssh root@<n900 ip> | $ ssh root@<n900 ip> | ||
- | # dpkg -i myscript_0. | + | # dpkg -i myscript_0.0.0_all.deb |
== Building a basic debian directory == | == Building a basic debian directory == | ||
- | Another useful command is ''debianize''. It will read the configuration file and write a directory named debian in the same directory. This can be used for manually creating the packages using dpkg tools directly | + | Another useful command is ''debianize''. It will read the configuration file and write a directory named debian in the same directory. This can be used for manually creating the packages using dpkg tools directly. |
Note: sdist_dsc and bdist_deb do '''not''' use this directory, generating a new one in the source dir under deb_dist/. | Note: sdist_dsc and bdist_deb do '''not''' use this directory, generating a new one in the source dir under deb_dist/. | ||
Line 81: | Line 62: | ||
$ dpkg-buildpackage -rfakeroot -uc -us -S | $ dpkg-buildpackage -rfakeroot -uc -us -S | ||
- | This command will create the .dsc, .tar.gz and .changes files that can be used to [[uploading to Extras-devel|upload the application to extras-devel]] | + | This command will create the .dsc, .tar.gz and .changes files that can be used to [[uploading to Extras-devel|upload the application to extras-devel]] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | == | + | == Future work == |
- | + | Support for non-debian systems. | |
[[Category:Python]] | [[Category:Python]] | ||
[[Category:Packaging]] | [[Category:Packaging]] |
Learn more about Contributing to the wiki.