From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.10 (X11; Linux i686; U;) Gecko/20030314 Description of problem: Less inscrutably: rebuild of rpm package of rpm (more precisely of rpm-python, but the source package is simply `rpm') fails because it tries to install the Python module according to PYTHONPATH (or PYTHONHOME, or maybe others). This is because python/Makefile.am uses pylibdir = $(shell python -c 'import sys; print sys.path[1]') to find where the python module should be installed. When the package is built by someone who has PYTHONPATH set to his/her personal Python module tree, the first path in PYTHONPATH becomes sys.path[1], and the module is not installed to $RPM_BUILDROOT/lib/python..., but somewhere into the deep space, and the package build fails. Version-Release number of selected component (if applicable): rpm-4.2-0.69 How reproducible: Always Steps to Reproduce: 1. export PYTHONPATH=$HOME 2. rpmbuild --rebuild rpm-4.2-0.69.src.rpm Additional info: There are several possible fixes: 1. unset all the PYTHON* environment variables in the spec file. This works but is ugly. 2a. use pylibdir = $(shell python -E -c 'import sys; print sys.path[1]') in python/Makefile.am. This however may break builds when one really wants to install rpm somewhere to home. 2b. patch python/Makefile.in in the spec file to use the -E option. Normal builds then use PYTHONPATH, PYTHONHOME, etc., but rpm package builds are not affected by it.
python/rpmlib/Makefile.am has the same problem. (Sorry, I forgot to mention it in the report.)
In current rawhide: pylibdir = ${prefix}/lib@MARK64@/python@WITH_PYTHON_VERSION@