Bug 1479253

Summary: [RFE] Package mod_wsgi-express
Product: [Fedora] Fedora Reporter: Hunor Csomortáni <hcsomort>
Component: mod_wsgiAssignee: Matthias Runge <mrunge>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dcallagh, hcsomort, jakub.dornak, jkaluza, jorton, lewk, mrunge
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mod_wsgi-4.5.20-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-13 08:06:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
proposed patch none

Description Hunor Csomortáni 2017-08-08 08:14:55 UTC
mod_wsgi-express is currently only available when mod_wsgi is installed from PyPi.

Would be nice to have it also as an rpm, especially as it's the recommended way of running mod_wsgi in containers [0].

[0] <https://modwsgi.readthedocs.io/en/develop/>

Comment 1 Dan Callaghan 2017-08-09 01:40:13 UTC
So I had a bit of a look at this.

It turns out the mod_wsgi source tree has basically two (totally separate?) pieces, the Apache module written in C and a Python package providing some management functionality (stuff like installing the module into an Apache installation, which is irrelevant for a packaged copy of mod_wsgi) as well as the mod_wsgi-express convenience script.

As a first attempt, I tried just building+installing the Python modules. It seems to work pretty much as expected. It wants to ship a copy of the built HTML docs as package data (to be served up by mod_wsgi-express) so I added a step to build the Sphinx docs too.

Patch to be attached.

The only downside I can see is that it ends up building the Apache module two extra times (once in the Python 2 package and once in the Python 3 package) and then including the Apache module .so as part of the Python package so that it can load it into the server started by mod_wsgi-express. It seems like it should just be using the existing version of the module which is already built and installed, instead of including a separate copy. But that might be an upstream RFE rather than something that should be fixed in the package.

Comment 2 Dan Callaghan 2017-08-09 01:43:27 UTC
Created attachment 1310972 [details]
proposed patch

Comment 3 Dan Callaghan 2017-08-09 01:44:22 UTC
Btw it would be very helpful for us if you could also backport this to Fedora stable releases. The mod_wsgi-express script has existed since mod_wsgi 4.1.0.

Comment 5 Joe Orton 2017-10-20 16:50:26 UTC
Dan, I applied your patch, though I haven't tested it.

Is it necessary to package all of /usr/lib64/python2.7/site-packages/mod_wsgi/docs/_static/fonts - this looks huge and is just a bunch of ttf fonts.

Comment 6 Joe Orton 2017-10-20 16:59:18 UTC
Package: mod_wsgi-4.5.20-1.fc28
Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=987036

Comment 7 Joe Orton 2017-10-20 17:08:00 UTC
Package: mod_wsgi-4.5.20-1.fc27
Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=987041

Comment 8 Joe Orton 2017-10-20 17:14:52 UTC
Package: mod_wsgi-4.5.20-1.fc26
Build: https://koji.fedoraproject.org/koji/buildinfo?buildID=987045

Comment 9 Dan Callaghan 2017-10-23 05:09:56 UTC
(In reply to Joe Orton from comment #5)
> Is it necessary to package all of
> /usr/lib64/python2.7/site-packages/mod_wsgi/docs/_static/fonts - this looks
> huge and is just a bunch of ttf fonts.

Well, that's just normal Sphinx doc output. They bundle jQuery usually too...

There are plenty of other Python packages in Fedora which contain Sphinx output like that, for example `ls -d /usr/share/doc/*/html/_static/` finds 14 directories on my system here.

Although none of those seem to include a fonts subdirectory, so I guess that is something mod_wsgi upstream has added specifically. Probably in their Sphinx theme.

I don't think it's *necessary* to build and ship the Sphinx output -- it's just what upstream intends as the default configuration for mod_wsgi-express. If you don't want to ship all that stuff, then it would just mean that mod_wsgi-express wouldn't necessarily work straight out of the box (without telling it what application to run). But that doesn't seem like a big deal.