RFC: default python installlation directories

Jacek Konieczny jajcus at jajcus.net
Sun Nov 22 20:20:16 CET 2015


On 2015-11-22 16:57, Tomasz Pala wrote:
> On Sun, Nov 22, 2015 at 13:25:16 +0100, Jacek Konieczny wrote:
> 
>> I suggest patching python, python3 and, if neccessary, other packages,
>> so distutils/setuptools/pip would install Python modules to /usr/local
>> by default ??? like autoconf configure scripts do. Python would look for
>> modues in /usr/local first and then in /usr.
> 
> If any tool installs anything with /usr prefix, not /usr/local, this
> should be considered as a bug and reported upstream. FHS clearly states
> that /usr/local should be used, so go ahead with this approach.

Python's default prefix is /usr/local, but that is, obviously, changed
for our python package. Most python software use the paths provided by
python standard library and that is the prefix Python was configured
with.

Please note that Python software is built for Python, not for Linux, so
python specifications (official Python documentation and various PEPs)
are follwed first. If that could be solved upstream Debian would already
forced that, but they use patches similar to what I suggest.

>> 3. No existing python-*.spec would build any more.
>>
>> All python specs would need to be updated to force proper instalation
>> directories. I would prepare %setup_py2 and %setup_py3. Those would use
>> proper python interpreter and compiler flags too.
> 
> Can't this be accomplished by detecting some environment variables?

Probably, but I don't think this is the most elegant solution. We
usually don't use rpm-build-specific variables and rather use
'%configure', '%cmake' and similar macros or pass the parameters to the
build process directly. Another set of macros for Python software seems
consistent with that.

>> What do you think?
> 
> I'm really tired of not having the ability to run some code just because
> there is no PLD package (and no point in creating one, there are dozens
> of perl/python/ruby modules) and I already have some other installed
> from rpms.

So you understand the problem well :)

Jacek


More information about the pld-devel-en mailing list