Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-252

mod_python install forces Python libraries into system-wide install directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.3.1
    • 3.3.1
    • core
    • None
    • Tested on Linux, with mod_python 3.3.1

    Description

      I need to have mod_python installed as an unprivileged user. I have Apache installed as an unprivileged user, to directory

      /home/user/apache/2.0.63/...

      And I need mod_python.so installed to

      /home/user/apache/2.0.63/modules

      The arguments I pass to ./configure are:

      ./configure --with-apache=/home/user/apache/2.0.63/ --prefix=/home/user/apache/2.0.63/modules/ --with-python=/directory/to/system-wide/install/of/python --with-apxs=/home/user/apache/2.0.63/bin

      This all works fine for installing mod_python.so into Apache's modules directory. However, the Python libraries are being forced into /directory/to/system-wide/install/of/python/lib/python2.5/site-packages. I really want these Python libraries installed into /home/user/libraries/

      I've tracked the problem, and my somewhat kludgy workaround, down to ./dist/Makefile.in. The following lines in ./dist/Makefile.in note that root privileges may be required:

      1. this may require root priviledges
        install_py_lib: mod_python src
        @cd src; $(MAKE) psp_parser.c
        if test -z "$(DESTDIR)" ; then \
        export LDFLAGS="-L$(PYTHON_LIBDIR)" ; $(PYTHON_BIN) setup.py install --optimize 2 --force ; \
        else \
        export LDFLAGS="-L$(PYTHON_LIBDIR)" ; $(PYTHON_BIN) setup.py install --optimize 2 --force --root $(DESTDIR) ; \

      To get around the requirement for installing the Python libraries system-wide, I simply added --prefix=/home/user/libraries/ after "setup.py install" in the above lines as a workaround.

      Note that the $DESTDIR variable in the above lines does not do what I want: I tried manually setting DESTDIR, but it forced the entire mod_python install (of mod_python.so, as well as the Python libraries) into subdirectories of /home/user/libraries. It also screwed up any other installs (e.g. httpd) done at the same time which also depend on the DESTDIR environment variable, if exported globally.

      I recommend a ./configure flag be added to allow the user to specify which directory the mod_python Python libraries should be installed into, and perhaps a note about setting PYTHONPATH appropriately.

      Attachments

        Activity

          People

            Unassigned Unassigned
            schmiddy Josh Kupershmidt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: