Bug 638362 - Review Request: python26-mod_python - An embedded Python interpreter for the Apache HTTP Server
Summary: Review Request: python26-mod_python - An embedded Python interpreter for the ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Steve Traylen
QA Contact: Carl Thompson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-28 20:56 UTC by BJ Dierkes
Modified: 2010-11-12 16:50 UTC (History)
4 users (show)

Fixed In Version: python26-mod_python-3.3.1-13.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-12 16:50:33 UTC
Type: ---
Embargoed:
fedora: fedora-review+
tcallawa: fedora-cvs+


Attachments (Terms of Use)

Description BJ Dierkes 2010-09-28 20:56:03 UTC
Spec URL: http://5dollarwhitebox.org/tmp/mod_python26.spec
SRPM URL: http://5dollarwhitebox.org/tmp/mod_python26-3.3.1-11.fc13.src.rpm

Description: 

Mod_python is a module that embeds the Python language interpreter within
the server, allowing Apache handlers to be written in Python.

Mod_python brings together the versatility of Python and the power of
the Apache Web server for a considerable boost in flexibility and
performance over the traditional CGI approach.

This package is built against 'python26'.

Comment 1 Steve Traylen 2010-09-28 21:39:23 UTC
Hi,
 Just some questions before proceeding more.

 Why the Conflict with mod_python? At least it needs to documented 
 why it conflicts in the .spec file if it actually does.

 But can it be made to not conflict?
 
 /var/www/manual/mod/mod_python can presumably be moved with some
 corresponding edits in the mod_python26.conf.

 It looks like this file already does not enable mod_python26 , or if
 installing along side mod_python causes problems then is it possible
 to put all the mod_python26 httpd configuration inside a conditional
 that checks if mod_python(24) has already been loaded.

 And also:

 Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)

  Seems a bit odd, can you explain?

Comment 2 BJ Dierkes 2010-09-28 21:58:13 UTC
(In reply to comment #1)
>  Why the Conflict with mod_python? At least it needs to documented 
>  why it conflicts in the .spec file if it actually does.

This may have been an assumed conflict, and is how most packages are handled in IUS (where this is porting from).  I've removed it, and will test mod_python/mod_python26 together.

 
>  /var/www/manual/mod/mod_python can presumably be moved with some
>  corresponding edits in the mod_python26.conf.

This is actually already being done in the spec/config.


> 
>  And also:
> 
>  Requires: httpd-mmn = %(cat %{_includedir}/httpd/.mmn || echo missing)
> 
>   Seems a bit odd, can you explain?

This was inherited from the Fedora packages which do the same thing.  It makes the package require the version of http-mmn that it is built against (httpd provides httpd-mmn).  I.e.:

$ rpm -q --provides httpd | grep -i mmn
httpd-mmn = 20051115


Updated spec/srpm (I'll need to test mod_python/mod_python26 together though):

Spec URL: http://5dollarwhitebox.org/tmp/mod_python26.spec
SRPM URL: http://5dollarwhitebox.org/tmp/mod_python26-3.3.1-12.fc13.src.rpm

Comment 3 BJ Dierkes 2010-09-28 22:11:59 UTC
Ah, right... the reason the 'Conflicts: mod_python' was added previously was because the actual symbol itself is named the same ('python_module').  With mod_python/mod_python26 installed:

# httpd -t
[Tue Sep 28 17:04:14 2010] [warn] module python_module is already loaded, skipping
Syntax OK


Changing the name would require patching the source.  Changing the name in mod_python26.conf produces:

# httpd -t
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 9 of /etc/httpd/conf.d/mod_python26.conf: Can't locate API module structure `python26_module' in file /etc/httpd/modules/mod_python26.so: /etc/httpd/modules/mod_python26.so: undefined symbol: python26_module


I'm not sure how involved it would be to patch mod_python26 sources to define the symbol 'python26_module', but I will look into it.

Comment 4 BJ Dierkes 2010-09-28 22:17:00 UTC
It looks like it might not be that difficult to change the symbol name:

$ grep -ri 'python_module' ./* | wc -l
45


That said, I would imagine the Apache directives would still conflict.  For example, calling 'PythonOption' or other Apache directives provided by 'mod_python' and 'mod_python26' both.

Comment 5 Steve Traylen 2010-09-29 14:49:00 UTC
Was looking at 
http://httpd.apache.org/docs/2.2/mod/core.html#ifmodule


If the python26.conf contians

<IfModule !python_module>
    LoadModule python_module modules/mod_python26.so

    ... 

</IfModule>


So long at /etc/httpd/conf.d/python.conf is processed before python26.conf
which is presumably is then the second will always be ignored
if the first one exists?

The point about if it's ever correct to load both versions is good
one. It's certainly confusing.

I think there was a thread about this approach somewhere on some list.
Will try and find it.

Steve.

Comment 6 BJ Dierkes 2010-10-08 17:20:55 UTC
I've brought up the issue regarding how to handle the conflicting mod_python's and will likely be decided in the next EPEL meeting.  For now I have added the IfModule check.  Additionally, per recommendation of Toshio (abadger1999) I've renamed the package to be more consistent with other python26 packages.

SPEC: http://5dollarwhitebox.org/tmp/python26-mod_python.spec
SRPM: http://5dollarwhitebox.org/tmp/python26-mod_python-3.3.1-13.fc13.src.rpm


$ rpmlint -i SPECS/python26-mod_python.spec 
0 packages and 1 specfiles checked; 0 errors, 0 warnings.

$ rpmlint -i /var/lib/mock/epel-5-x86_64/result/python26-mod_python-3.3.1-13.el5.x86_64.rpm 
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

Comment 7 Steve Traylen 2010-10-08 18:23:15 UTC
Yes I read the message on the list.
Regarding the conflict or not:

Ignoring how mod_python is configured by default is it impossible to configure
both mod_python and mod_python26 on the same web server?

Could I for instance have http://loclhost/python as mod_python managed
and http://localhost/python26 has python26 managed?

I think if it is possible on the same web server then it's worth avoiding
the hard conflict. ... I'm thinking of large installation where perhaps
1000 users serve files out of ~public_html and some want python and some
want python26 or two different applications want the different versions.

If it is genuinly impossible to to do reguardless of configuration then
the conflict is valid.

Steve.

Comment 8 BJ Dierkes 2010-10-08 18:41:09 UTC
Per the new spec, I am no longer doing a hard 'Conflicts: mod_python'.  In the apache config it has:

<IfModule !python_module>
    ....
</IfModule>


Regarding how it would be possible to allow mod_python and python26-mod_python to run simultaneously... I can't see how it could work.  When you load the python_module it enabled all the symbols and Apache directives provided by that module.  For example, 'PythonOption'.  If both mod_python and python26-mod_python were loaded...  what would happen when I reference the apache directive 'PythonOption'...  being that both modules provide it?

I just don't think its possible... or it it is... not easily possible.

Comment 9 Carl Thompson 2010-10-10 18:41:21 UTC
OK - Package meets naming and packaging guidelines
OK - Spec file matches base package name.
OK - Spec has consistant macro usage.
See below - Meets Packaging Guidelines.
See below - License
OK - License field in spec matches
See below - License file included in package
OK - Spec in American English
OK - Spec is legible.
OK - Sources match upstream md5sum:
a3b0150176b726bd2833dac3a7837dc5  mod_python-3.3.1.tgz
a3b0150176b726bd2833dac3a7837dc5  mod_python-3.3.1.tgz

OK - BuildRequires correct
OK - Package has %defattr and permissions on files is good.
See below - Package has a correct %clean section.
OK - Package has correct buildroot
OK - Package is code or permissible content.
OK - Packages %doc files don't affect runtime.
OK - Package has rm -rf RPM_BUILD_ROOT at top of %install

OK - Package compiles and builds on at least one arch.
OK - Package has no duplicate files in %files.
OK - Package doesn't own any directories other packages own.
OK - Package owns all the directories it creates.
OK - Package obey's FHS standard (except for 2 exceptions)
OK - No rpmlint output. 
 - final provides and requires are sane.

SHOULD Items:

OK - Should build in mock.
OK - Should build on all supported archs
OK - Should have dist tag
OK - Should package latest version
OK - Should not use file requires outside of /etc, /bin, /sbin, /usr/bin, or
/usr/sbin

rpmlint python26-mod_python-3.3.1-13.fc13.src.rpm 
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

rpmlint -i python26-mod_python-3.3.1-13.fc13.src.rpm 
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

There are no install conflicts with mod_python due to naming convention so
removed of Conflicts is good.

Due to internal object conflicts of the two modules the include test is
the sanest method to prevent run time module loading conflicts

Comment 10 BJ Dierkes 2010-10-11 21:58:54 UTC
New Package SCM Request
=======================
Package Name: python26-mod_python
Short Description: An embedded Python interpreter for the Apache HTTP Server
Owners: derks
Branches: el5
InitialCC:

Comment 11 Tom "spot" Callaway 2010-10-13 15:14:51 UTC
Git done (by process-git-requests).

Comment 12 Fedora Update System 2010-10-27 16:18:28 UTC
python26-mod_python-3.3.1-13.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/python26-mod_python-3.3.1-13.el5

Comment 13 Fedora Update System 2010-10-27 19:09:31 UTC
python26-mod_python-3.3.1-13.el5 has been pushed to the Fedora EPEL 5 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python26-mod_python'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/python26-mod_python-3.3.1-13.el5

Comment 14 Fedora Update System 2010-11-12 16:50:28 UTC
python26-mod_python-3.3.1-13.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.