diff --git a/mod_wsgi-4.5.20-exports.patch b/mod_wsgi-4.5.20-exports.patch new file mode 100644 index 0000000000000000000000000000000000000000..97e56714ee6bd05ac6e8fe011ca25f3c2f5d9078 --- /dev/null +++ b/mod_wsgi-4.5.20-exports.patch @@ -0,0 +1,11 @@ +--- mod_wsgi-4.5.20/Makefile.in.exports ++++ mod_wsgi-4.5.20/Makefile.in +@@ -28,7 +28,7 @@ + all : src/server/mod_wsgi.la + + src/server/mod_wsgi.la : $(SRCFILES) +- $(APXS) -c $(CPPFLAGS) $(CFLAGS) $(SRCFILES) $(LDFLAGS) $(LDLIBS) ++ $(APXS) -Wl,-export-symbols-regex -Wl,wsgi_module -c $(CPPFLAGS) $(CFLAGS) $(SRCFILES) $(LDFLAGS) $(LDLIBS) + + $(DESTDIR)$(LIBEXECDIR) : + mkdir -p $@ diff --git a/mod_wsgi-4.9.4.tar.gz b/mod_wsgi-4.9.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c401c7a844e92aebb053638721a25f4a75861f96 Binary files /dev/null and b/mod_wsgi-4.9.4.tar.gz differ diff --git a/mod_wsgi.spec b/mod_wsgi.spec new file mode 100644 index 0000000000000000000000000000000000000000..3a55f26da43b541ebe4355ae1d1ded168b0105af --- /dev/null +++ b/mod_wsgi.spec @@ -0,0 +1,84 @@ +%define anolis_release 1 + +%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$} +%{?filter_setup} + +Name: mod_wsgi +Version: 4.9.4 +Release: %{anolis_release}%{?dist} +Summary: A WSGI interface for Python web applications in Apache +License: ASL 2.0 +URL: https://modwsgi.readthedocs.io/ +Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/mod_wsgi-%{version}.tar.gz +Source1: wsgi.conf +Source2: wsgi-python3.conf +Patch1: mod_wsgi-4.5.20-exports.patch + +BuildRequires: httpd-devel gcc make +BuildRequires: python3-sphinx python3-sphinx_rtd_theme +BuildRequires: python3-setuptools python3-devel + +%description +The mod_wsgi adapter is an Apache module that provides a WSGI compliant +interface for hosting Python based web applications within Apache. The +adapter is written completely in C code against the Apache C runtime and +for hosting WSGI applications within Apache has a lower overhead than using +existing WSGI adapters for mod_python or CGI. + +%package -n python3-%{name} +Summary: %summary +Requires: httpd-mmn = %{_httpd_mmn} +Provides: mod_wsgi = %{version}-%{release} +Obsoletes: mod_wsgi < %{version}-%{release} + +%description -n python3-%{name} +The mod_wsgi adapter is an Apache module that provides a WSGI compliant +interface for hosting Python based web applications within Apache. The +adapter is written completely in C code against the Apache C runtime and +for hosting WSGI applications within Apache has a lower overhead than using +existing WSGI adapters for mod_python or CGI. + +%package -n python3-%{name}-doc +Summary: Documentation files for python3-%{name} +Requires: python3-%{name} = %{version}-%{release} +BuildArch: noarch + +%description -n python3-%{name}-doc +The python3-%{name}-doc package contains documentation files for python3-%{name}. + +%prep +%autosetup -p1 -n %{name}-%{version} + +%build +%make_build -C docs html + +export LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}" +export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" +%configure --enable-shared --with-apxs=%{_bindir}/apxs --with-python=%{python3} +%make_build +%py3_build + +%install +%make_install LIBEXECDIR=%{_httpd_moddir} +mv $RPM_BUILD_ROOT%{_httpd_moddir}/mod_wsgi{,_python3}.so + +install -d -m 755 $RPM_BUILD_ROOT%{_httpd_modconfdir} +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-wsgi-python3.conf + +%py3_install +mv $RPM_BUILD_ROOT%{_bindir}/mod_wsgi-express{,-3} + +%files -n python3-%{name} +%license LICENSE +%config(noreplace) %{_httpd_modconfdir}/*wsgi-python3.conf +%{_httpd_moddir}/mod_wsgi_python3.so +%{python3_sitearch}/mod_wsgi-*.egg-info +%{python3_sitearch}/mod_wsgi +%{_bindir}/mod_wsgi-express-3 + +%files -n python3-%{name}-doc +%doc CREDITS.rst README.rst + +%changelog +* Thu May 11 2023 happy_orange - 4.9.4-1 +- init package diff --git a/wsgi-python3.conf b/wsgi-python3.conf new file mode 100644 index 0000000000000000000000000000000000000000..eb2c5e518f5b9b3d83437838d9b1e6ed20536a10 --- /dev/null +++ b/wsgi-python3.conf @@ -0,0 +1,6 @@ +# NOTE: mod_wsgi_python3 can not coexist in the same apache process as +# mod_wsgi (python2). Only load if mod_wsgi is not already loaded. + + + LoadModule wsgi_module modules/mod_wsgi_python3.so + diff --git a/wsgi.conf b/wsgi.conf new file mode 100644 index 0000000000000000000000000000000000000000..0797bcef59f4a5d53cae3b5fdb769ad5c662738e --- /dev/null +++ b/wsgi.conf @@ -0,0 +1,7 @@ +# NOTE: mod_wsgi can not coexist in the same apache process as +# mod_wsgi_python3. Only load if mod_wsgi_python3 is not +# already loaded. + + +LoadModule wsgi_module modules/mod_wsgi.so +