Cardapio`s setup.py doesnt suite Gentoo Portage Policy

Bug #596000 reported by Maks
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cardapio
Incomplete
Wishlist
Unassigned

Bug Description

Cardapio`s setup.py says that main cardapio executable must be installed into /usr/local/bin. Its good choose for people who install it by hand. But /usr/local is for packages installed by user itself by running './configure && make && make install', not for package managers. Executables from debs, rpms or ebuilds must go to /usr/bin instead. However, cardapio deb package in your ppa has executable in /usr/local/bin. When i tried to write Gentoo ebuild for it, i saw that Portage doesnt like installing anything in /usr/local and stops with error. So if you want users of distros to use your Cardapio please fix this and find some way to specify installation to default binary directory instead of /usr/local/bin.
P.S. Sorry for (probably) bad English

Revision history for this message
Thiago Teixeira (tvst) wrote :

Thanks for the bug report. I have been meaning to change the setup process for a long time (see bug 593132).

I will try to fix this in the next couple of days.

Revision history for this message
Thiago Teixeira (tvst) wrote :

I will be working on this next

Changed in cardapio:
status: New → In Progress
Revision history for this message
Thiago Teixeira (tvst) wrote :

This is fixed in version 0.9.110.

To install in the prefix of your choosing, use:
$ sudo make install PREFIX=/usr/local

Otherwise, Cardapio will install in /usr by default (at /usr/lib/cardapio, that is).

Changed in cardapio:
status: In Progress → Fix Released
Revision history for this message
Maks (kolmax94) wrote :

Sorry, but you are going wrong way. I ask you to fund way to do right installation in *setup.py*, not in Makefile. Otherwise gentoo-users will never use Cardapio, because distutils.eclass calls 'setup.py install -root=/var/tmp/portage/..../image' and expects that it will install files into /var/tmp/portage/..../image/usr/bin and /var/tmp/portage/.../image/usr/lib. If I use 'make PREFIX="/var/tmp/portage/..../image" install' in ebuild, it`s bad too: it installs into /var/tmp/portage/.../image/bin and /var/tmp/portage/.../image/lib.
P.S. Please read something about how portage works
P.P.S Also you can look at http://gitorious.org/batti/batti/blobs/master/setup.py, especially this line:
'scripts = [Constants.NAME]' which installs main executable to apropriate location.

Revision history for this message
Maks (kolmax94) wrote :

Hey! I wrote a setup.py for you. Please review it and commit to trunk, if, of course, you want gentoo-people to use your Cardapio =)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Thanks! I will take a look at it.

(Oh, and sorry I missed your previous comment...)

Revision history for this message
Thiago Teixeira (tvst) wrote :

Just one thing, though. For a number of reasons, I would rather use a makefile than a setup.py file.

Is there any way to make the Cardapio makefile play well with Gentoo?

For now, I will include your modified setup.py into Cardapio, but I consider this a temporary solution. The long-term solution is to use the make build system and not than the python build system.

Changed in cardapio:
status: Fix Released → In Progress
Revision history for this message
Thiago Teixeira (tvst) wrote :

Marking as "fix released" (see above), although I'm still waiting for someone with Gentoo packaging knowledge (Maks?) to clarify this situation to me...

Changed in cardapio:
status: In Progress → Fix Committed
Revision history for this message
Thiago Teixeira (tvst) wrote :

Alright, since nobody stepped up, I'm downgrading this to "incomplete" in the hopes that someone will jump in here and answer my question from post #7 :)

(https://bugs.launchpad.net/cardapio/+bug/596000/comments/7)

Changed in cardapio:
status: Fix Committed → Incomplete
Changed in cardapio:
importance: Undecided → Wishlist
tags: removed: gentoo setup.py
Revision history for this message
Jan (jancborchardt-deactivatedaccount) wrote :

Maks,

can you answer the question from comment #7? https://bugs.launchpad.net/cardapio/+bug/596000/comments/7
»Is there any way to make the Cardapio makefile play well with Gentoo?«

(Or is there anyone else who knows about it?)

Revision history for this message
Maks (kolmax94) wrote :

Hi. First, answer me a question please: why do you want to use makefile? Native deployment system for python programs is disturils (setup.py), so right way is to use it. destutils install modules in specific directories for different python versions, so with them your program will install on python 2.5 or python 3.1 without change to makefile.

Revision history for this message
Thiago Teixeira (tvst) wrote :

Hi, Maks. The decision to use a makefile rather than distutils was made based on a few reasons:

1) The distutils system stores Cardapio in a "site-packages" folder, the location of which can vary from distribution to distribution, and from Python version to Python version. The advantage of using the makefile here, is that we can instead install Cardapio in a well-known location, which makes it easier for us to handle some types of bug reports.

2) The makefile solution also gives you the option to *uninstall* Cardapio, which distutils does not. This is an area where distutils is severely lacking, IMO. I'm sure this could be hacked together somehow in the setup.py, but it would still be a hack, and prone to bugs.

3) The distutils system automatically makes software available as a module inside of Python, and AFAIK there is no way around it. This is the desirable behavior when you're installing new Python libraries such as matplotlib, opencv, pygame and so on, but makes no sense for actual applications. So the advantage of the makefile system here is that it keeps people's module lists uncluttered, and avoids giving developers the impression that Cardapio should be accessed as a library (which it should not).

4) Finally, the makefile system integrates better with Debian packages and Ubuntu PPAs. Sad but true.

Also, although you mention that distutils works with no changes no matter which version of Python you're using, so does our current makefile AFAIK.

Hopefully this answers you questions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.