[Distutils] creating rpms of setuptools, sqlobject and formencode

Pau Aliagas pau at newtral.org
Mon Oct 24 08:41:14 CEST 2005


On Sat, 22 Oct 2005, Phillip J. Eby wrote:

>> I'm the one creating the rpm :) I enclose the spec file.
>> What it does is this:
>> 
>> python setup.py build
>> python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT \
>>     --record=INSTALLED_FILES.tmp
>> 
>> In INSTALLED_FILES.tmp I cannot see any pth file, so it is not included in 
>> the rpm, as thes are the files it will include.
>
> Hm.  Looks like easy_install isn't writing them to the --record file, even if 
> it's updating them on disk.  But it also may not be writing them on disk, due 
> to the use of the --root option.

I've seen what happens, after reading carefully the documentation... and 
the output of the program: when callling:
$ python setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT \
   --record=INSTALLED_FILES.tmp

I add --root, so it considers it's a multi installation and does not 
create a pth file.

To overcome this, I create a pth file manually and add it to 
INSTALLED_FILES.tmp. This works.

But for the rpms that depend on setuptools, the best way I've found is to 
use the --old-and-unmanageable option that does not use the eggs dir 
structure.

One comment here: the name "--old-and-unmanageable" is not very polite adn 
I think it should be something like --no-eggs. There's a lot of people 
putting effort in building rpms for several distributions and I think we 
should not be offensive.

Having a package in rpm form in a distribution like Fedora, make it much 
more successful and wider used.

I like the idea of being able to install multiple versions of a program, 
the idea of installing in a private directory, but the most common use is 
to install only one version in the system, at least when things are 
stable. This should be made easy and, in my opinion, it is not.

The trick I've used is to install setuptools with the egg dirs and the pth 
file, and the rest without. I don't like the install system downloading 
eggs and installing them in the global dirs if you do it like root! 
Package tools like rpm should be used instead if we want mantainable 
systems.

> There's actually a bigger issue, too, which is that the contents of those 
> .pth files are going to be based on the --root, rather than where they'll be 
> really installed on the target system.  Ugh.

I created it by hand inside the spec file, as explained above.

> I think the best thing to do is going to be to follow the experimental Gentoo 
> egg installation strategy:
>
>    http://eggs.gentooexperimental.org/wiki/Overview
>
> which adds install/uninstall scripts that add or remove eggs from a 
> 'gentoo-eggs.pth' file.

It sounds interesting, but in an rpm system you only can have one version 
of each package :(

> I'd happily accept patches for the bdist_rpm command provided by setuptools, 
> so that setuptools-using packages (including setuptools itself) can build 
> rpms that update an 'rpm-eggs.pth' file.

I'll see if I can do something, the spec files can be automatically 
created from the egg info.

Thanks
Pau
-- 

Pau


More information about the Distutils-SIG mailing list