[Distutils] Building rpms for different interpreters?

M.-A. Lemburg mal at egenix.com
Sat Jul 16 21:08:16 CEST 2005


Phil Schwartz wrote:
> I scanned the distutils mailing list archive to no avail, so hopefully 
> this question hasn't been asked and answered before.
> 
> Basically, my ReleaseForge application uses distutils to generate zip, tar 
> and rpm packages.  Everything has worked perfectly up until now because I 
> now want to generate a python2.4 specific rpm in addition to a 
> python2.3 rpm.
> 
> My development system is FC3 and has rpms of Python2.3 (default system 
> wide) and Python2.4 installed:
> 
> $ rpm -q python python2.4
> python-2.3.4-13.1
> python2.4-2.4-1pydotorg
> 
> When I issue the following command:
> 
> $ python setup.py bdist_rpm
> 
> the generated rpm files have references to 
> /usr/lib/python2.3/site-packages.  This is ofcourse expected since 
> python2.3 is the default.
> 
> However, what is unexepected is that when I invoke python2.4 directly to 
> generate the rpm:
> 
> $ python2.4 setup.py bdist_rpm
> 
> the generated rpm still has references to /usr/lib/python2.3/site-packages 
> rather than /usr/lib/python2.4/site-packages.
> 
> $ python2.4
> 
> Python 2.4 (#1, Nov 30 2004, 11:25:14)
> [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
> 
>>>import sys
>>>
>>>>sys.path
> 
> ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', 
> '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', 
> '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages']
> 
> What I'd like to see is that when I invoke "python2.4 setup.py bdist_rpm"
> are for the files in the generated rpm to reference 
> /usr/lib/python2.4/site-packages rather than the respective 2.3 directory.
> 
> FWIW, the 2.3 and 2.4 generated rpms will be essentially the same (w/ the 
> only difference being the location of site-packages)
> 
> What painfully obvious point am I missing?

In addition to building with Python 2.4, you also have
to point bdist_rpm to the Python interpreter to use when
running the rpm build command:

	$(PYTHON) setup.py \
			bdist_rpm \
			--python $(PYTHON) \
			--release $(PACKAGERELEASE)

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 16 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Distutils-SIG mailing list