Python site-packages tricks (was: Re: rpms/scons/devel scons.spec,1.3,1.4)

Dag Wieers dag at wieers.com
Wed Jan 26 18:44:00 UTC 2005


On Wed, 26 Jan 2005, Ville Skyttä wrote:

> On Tue, 2005-01-25 at 20:36 +0100, Thorsten Leemhuis wrote:
> > Am Dienstag, den 25.01.2005, 20:21 +0100 schrieb Matthias Saou:
> 
> > > Shouldn't this use the sysconfig.get_python_lib(foo) trick (that Ville
> > > showed me) to get the arch independant python lib path instead?
> > 
> > Good question; Ville what is that for a trick?
> 
> I don't know if it's much of a trick, but see spectemplate-python.spec
> in fedora-rpmdevtools.  It applies to most Python extension packages out
> there that use Python's distutils, and install stuff into site-packages
> dirs.  In the scons case, things are not installed to the site-packages
> dirs, it seems, so the "trick" doesn't apply AFAICT.
> 
> Anyway the idea is to find out the dirs where Python's distutils will
> install stuff into by asking Python and using those in %files instead of
> inventing/hardcoding the dirs oneself.

We're using the following macros for that:

%define python_sitearch %(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()')
%define python_sitelib %(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1)')

Is this what you are using too ?

--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


More information about the fedora-extras-commits mailing list