PPA does not install

Asked by Ralf Hersel on 2011-04-16

The package ( popper - 0.28.1-0ubuntu1 ) in my PPA ( https://launchpad.net/~ralf.hersel/+archive/rhersel-ppa/+packages ) does not install although it was accepted and build correctly by Launchpad. My suspicion is that it only contains changes instead of a complete initial package.

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
2011-04-20
Last reply:
2011-04-20
Curtis Hovey (sinzui) said : #1

I looked at the tar.gz and deb, and I agree that the package only contains the packaging information. The tar ball does not contain a file to make and install the files (Makefile, or setup.py, or something).

I see two ways to provide installation instructions for the package:
A. Add a rules file to your debian directory and write makefile-like install rules. Or..
B. Create a patch that provides a minimal setup.py, and use a the standard python rules.

{{{
#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pysupport

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
}}}

You can learn about the setup.py file at http://docs.python.org/distutils/setupscript.html.
You can disregard the extension section. You do care about scripts, package data, and additional files.

Ralf Hersel (ralf.hersel) said : #2

Well, my package already contains a rules file which is obviously ignored by the 'debuild -S' command. The rules file is very minimal, it just contains this:

%:
 dh $@

Is there really no easy way to prepare a simple package that can be uploaded to my PPA and installed via Software-Center? Until now I created a DEB file simply with 'dpkg -b' and a /DEBIAN/control file which works perfect in Software-Center. Can I take my existing DEB file and put it into a PPA?

Curtis Hovey (sinzui) said : #3

As I said, the release tar.gz does not contain a setup.py or Makefile that packagers require to make a package. The source release simply does not have any instructions about what needs compiling, process, or installing. This is a major stumbling point for all packaging system. I expect the setup.py file to be something like this:

{{{
import glob
import os
from distutils.core import setup

description = (
    "Popper is an application to notify about new emails from one or more "
    "POP3 or IMAP email servers")

desktop_files = ['usr/share/applications/popper_config.desktop']
popper_files = glob.glob(os.path.join('usr', 'share', 'poper', '*.*'))

setup(
    name="popper",
    description=description,
    version="0.28",
    maintainer="Ralf Hersel",
    maintainer_email="<YOUR-EMAIL-ADDRESS>",
    data_files=[
        ('/usr/share/applications', desktop_files),
        ('/usr/share/popper', popper_files)])
}}}

This does not take into consideration the locale files. You could extend the setup to traverse and the locale dirs and files and add them to the data_file list of tuples.
You will also need to list each file you want installed in the MANIFEST file in the root direct <http://docs.python.org/distutils/sourcedist.html#manifest>. The tree structure is non-standard so I think the setup file may need to do some extra work. The python will not be installed in the proper way to ensure it runs with multiple python versions, or after a major python upgrade, which is what will happen with the release of natty. Setting up your development tree in to a python module and data will help, but it is not required

BTW, the debian/ directory should also have a copyright file that lists the copyright information for all the installed files.

Ralf Hersel (ralf.hersel) said : #4

Thank you for all that information. Seems that I have to start my packaging exercise from scratch. Is there any easy manual or guideline or packaging-support-forum that is recommended for python packaging?

William Grant (wgrant) said : #5

Your packaging is probably OK for normal Python projects, but the project that you are packaging is not a normal Python project: there is no automated way to install it. https://wiki.ubuntu.com/PackagingGuide/Python is a good guide to packaging standard Python projects.

Ralf Hersel (ralf.hersel) said : #6

I have some additional questions:

1. must the debian folder be included in the package.orig.tar.gz file?

2. must the setup.py and the MANIFEST.in files be in the debian folder?

3. is
%:
 dh $@
a sufficient content for the rules file if I have a setup.py file like you supposed earlier?

4. is
global-include *.*
a sufficient content for the MANIFEST.in file?

Curtis Hovey (sinzui) said : #7

1. You should not include the debian/ folder in your project because that will require other packagers to remove it if they wish to create alternate rules.

2. setup.py does not use debian/, nor does it support it (unlike rpm). You need MANIFEST.in must be in the root of your project. Since you are distributing data instead of a module or package, you will always need a MANIFEST.in. Note that Python 2.7+ does not require MANIFEST.in for python modules and packages.

3. The example I provided for debian/rules above is correct for a project that uses python's standard setup.py:
{{{
#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pysupport

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
}}}

4. per http://docs.python.org/distutils/sourcedist.html#manifest-template, I think you want
recursive-include usr *.*
because global will include files that you do not intend to distribute, such as the MANIFEST.in

Can you help with this problem?

Provide an answer of your own, or ask Ralf Hersel for more information if necessary.

To post a message you must log in.