* Sat Sep 13 2025 Jean-Philippe Pialasse <jpp@koozali.org> 3.5.0-5.sme

- SME11 version python27
This commit is contained in:
2025-09-17 23:30:42 -04:00
parent d593425f20
commit 071bffb91e
6 changed files with 244 additions and 38 deletions

1
.gitattributes vendored
View File

@@ -1,3 +1,4 @@
*.tar.gz filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.tar.xz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text

1
10-python.conf Normal file
View File

@@ -0,0 +1 @@
LoadModule python_module modules/mod_python.so

BIN
mod_python-3.5.0.tgz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -1,54 +1,186 @@
%define name mod_python
%define version 1.0
%define release 1
Summary: This is what mod_python does.
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
Source: %{name}-%{version}.tar.gz
License: GNU GPL version 2
Group: SMEserver/addon
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
BuildArchitectures: noarch
BuildRequires: smeserver-devtools
Requires: smeserver-release >= 11.0
AutoReqProv: no
#%#setup_python_subpackage mod_python
%define modname mod_python
%define module_name python
%define apache2_htdocsaddondir /var/www/html/addon-modules
%define apache2_htdocsdir /var/www/html
%define httpd_modules_confdir /etc/httpd/conf.modules.d/
%define python_bindir %apache2_htdocsdir/%module_name
Name: mod_python
Version: 3.5.0
Release: 4
Summary: Python module for Apache2
License: Free
Group: System/Servers
Url: http://www.modpython.org
Packager: Alexey Morsov <swi@altlinux.ru>
Source: %modname-%version.tgz
Source2: python.conf
Source4: 10-python.conf
Patch0: nogit.patch
BuildRequires: rpm-build rpm-build-libs python-rpm-macros
BuildRequires: flex python2-devel
BuildRequires: httpd httpd-devel
BuildRequires: rpmdevtools
BuildRequires: python2
Requires: python2
Requires: httpd
Provides: mod_python
%description
%changelog
* Day MMMM DD YYYY <brianr@koozali.org> 1.0-1.sme
- Initial code - create RPM [SME:99999]
mod_python is an Apache2 module that embeds the Python interpreter within the server.
With mod_python you can write web-based applications in Python that will run many
times faster than traditional CGI and will have access to advanced features such as
ability to retain database connections and other data between hits and access to
Apache internals.
%prep
%setup -q -n %modname-%version
%patch0 -p2
%setup -q
sed -i "s/!(b == APR_BRIGADE_SENTINEL(b) ||/!(b == APR_BRIGADE_SENTINEL(bb) ||/g" src/connobject.c
%build
%configure --with-python=/usr/bin/python2 --with-apxs=%{_bindir}/apxs
make OPT="-fPIC $RPM_OPT_FLAGS -DEAPI" dso APXS_CFLAGS="-Wc,-fno-strict-aliasing"
ls -lR
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-filelist
#echo "%doc COPYING" >> %{name}-%{version}-filelist
#--dir <dir> 'attr(755,user,grp)' \
#--file <file> 'attr(755,root,root)' \
install -d -m 755 -- $RPM_BUILD_ROOT%{_httpd_modconfdir}
install -d -m 755 -- $RPM_BUILD_ROOT%{_httpd_confdir}
install -d -m 755 -- $RPM_BUILD_ROOT%apache2_htdocsaddondir/%modname
mkdir -p $RPM_BUILD_ROOT%{_bindir}
%clean
cd ..
rm -rf %{name}-%{version}
install -p -m 755 -- scripts/mod_python $RPM_BUILD_ROOT%{_bindir}/mod_python
install -p -m 644 -- %SOURCE4 $RPM_BUILD_ROOT%{_httpd_modconfdir}/10-%module_name.conf
install -p -m 644 -- %SOURCE2 $RPM_BUILD_ROOT%{_httpd_confdir}/%module_name.conf
%pre
mkdir -p %buildroot{%python2_sitelib/%modname,%_docdir/%modname-%version/icons,%python_bindir,%apache2_cgibindir}
mkdir -p %buildroot%{_libdir}/httpd/modules/
%preun
install -c src/%modname.so %buildroot%{_libdir}/httpd/modules/
install -c dist/build/lib.%{_os}-*-%{python2_version}/%modname/*.so %buildroot%python2_sitelib/%modname
for i in `ls lib/python/%modname/*.py`; do
install -m 0644 $i %buildroot%python2_sitelib/%modname;
done
# docs
for i in `ls doc-html/*.html doc-html/*.css`; do
install -m 0644 $i %buildroot%_docdir/%modname-%version;
done
for i in `ls doc-html/icons/*.gif`; do
install -m 0644 $i %buildroot%_docdir/%modname-%version/icons;
done
ln -s %_docdir/%modname-%version %buildroot%apache2_htdocsaddondir/%modname
### Creating mptest.py
cat <<EOF >mptest.py
from mod_python import apache
def handler(req):
req.send_http_header()
req.write("Hello World!")
return apache.OK
EOF
install -m 0644 mptest.py %buildroot%python_bindir/
%post
%preun
%postun
#uninstall
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%files
%{_bindir}/mod_python
%python2_sitelib/%modname/*
%{_libdir}/httpd/modules//%modname.so
%dir %attr(0775,root,%apache2_webmaster) %python_bindir
%attr(0664,root,%apache2_webmaster) %python_bindir/mptest.py*
%config(noreplace) /etc/httpd/conf.modules.d/10-%module_name.conf
%config /etc/httpd/conf.d/%module_name.conf
%apache2_htdocsaddondir/*
%_docdir/%modname-%version
%changelog
* Sat Sep 13 2025 Jean-Philippe Pialasse <jpp@koozali.org> 3.5.0-5.sme
- SME11 version python27
* Fri Jun 12 2020 Sergey Bolshakov <sbolshakov@altlinux.ru> 3.5.0-alt3
- fixed packaging on armh
* Thu Jun 11 2020 Igor Vlasenko <viy@altlinux.ru> 3.5.0-alt2.qa1
- NMU: fixed BR: on python-base
* Wed Oct 02 2019 Michael Shigorin <mike@altlinux.org> 3.5.0-alt2
- e2kv4+: fix installation
* Sun Oct 14 2018 Igor Vlasenko <viy@altlinux.ru> 3.5.0-alt1.qa1
- NMU: applied repocop patch
* Wed Apr 06 2016 Sergey Alembekov <rt@altlinux.ru> 3.5.0-alt1
- new version
- rebuild with apache 2.4
* Sat Oct 22 2011 Vitaly Kuznetsov <vitty@altlinux.ru> 3.3.1-alt2.5.2.1.1
- Rebuild with Python-2.7
* Mon Nov 16 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 3.3.1-alt2.5.2.1
- Rebuilt with python 2.6
* Tue Feb 10 2009 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.5.2
- put _psp.so into package
- clean spec
* Thu Oct 30 2008 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.5.1
- fix comments in .load file
* Wed Oct 29 2008 Alexey Morsov <swi@altlinux.org> 3.3.1-alt2.5
- fix build
+ fix macros
+ apply tip from gentoo (http://bugs.gentoo.org/show_bug.cgi?id=230211)
* Fri Jan 25 2008 Grigory Batalov <bga@altlinux.ru> 3.3.1-alt2.4.1
- Rebuilt with python-2.5.
* Mon Jan 21 2008 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.4
- fix package: now own _docdir/modname-version
* Mon Apr 09 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.3
- fix version requires for apache2
* Wed Apr 04 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.2
- fix build requires for new python policy
* Mon Apr 02 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2.1
- fix uninstall, config
* Mon Apr 02 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt2
- Switch to the new Apache2 configuration scheme
- Spec file cleanup
* Tue Mar 06 2007 Alexey Morsov <swi@altlinux.ru> 3.3.1-alt1
- new version (bugfixed, improvements, new features)
* Wed Jan 10 2007 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt2
- make this mod_python conflicts with mod_python for apache1.3
otherwise not possible to start any apps without patching them
for s/mod_python/apache2_mod_python/
* Wed Dec 20 2006 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt1.1
- fix spec
* Thu Dec 07 2006 Alexey Morsov <swi@altlinux.ru> 3.2.10-alt1
- Initial build for Sisyphus
- patch for separate apache2-mod_python from mod_python for apache1

12
nogit.patch Normal file
View File

@@ -0,0 +1,12 @@
diff --git a/mod_python/dist/version.sh b/mod_python/dist/version.sh
index 1060b4f..1577205 100755
--- a/mod_python/dist/version.sh
+++ b/mod_python/dist/version.sh
@@ -5,6 +5,6 @@ MPV_PATH="`dirname $0`/../src/include/mp_version.h"
MAJ=`awk '/MP_VERSION_MAJOR/ {print $3}' $MPV_PATH`
MIN=`awk '/MP_VERSION_MINOR/ {print $3}' $MPV_PATH`
PCH=`awk '/MP_VERSION_PATCH/ {print $3}' $MPV_PATH`
-GIT=`git describe --always`
+GIT="0"
echo $MAJ.$MIN.$PCH-$GIT

57
python.conf Normal file
View File

@@ -0,0 +1,57 @@
#
# Mod_python is a module that embeds the Python language interpreter
# within the server, allowing Apache handlers to be written in Python.
#
LoadModule python_module modules/mod_python.so
# Override type-map handler for /var/www/manual
<Directory "/var/www/manual/mod/mod_python">
<Files *.html>
SetHandler default-handler
</Files>
</Directory>
# This will cause files beneath /var/www/html with the extension .spam
# to be handled by the Python script /var/www/html/eggs.py
#
#<Directory /var/www/html>
# AddHandler python-program .spam
# PythonHandler eggs
#</Directory>
# This will cause all requests to the /python heirachy of your
# webserver to be handled by the python script /path/to/myhandler.py
#
#<Location /python>
# SetHandler python-program
# PythonPath "sys.path + ['/path/to']"
# PythonHandler myhandler
#</Location>
# This will cause all requests to the /python hierachy of your
# webserver to be handled by mod_python's Publisher handler
# (see http://localhost/manual/mod/mod_python/hand-pub.html)
#
#<Location /python>
# SetHandler python-program
# PythonHandler mod_python.publisher
#</Location>
# This will cause the output of all requests to files beneath
# /var/www/html with the extension .flt to be filtered through
# the Python script /var/www/html/filter.py
#
#<Directory /var/www/html>
# PythonOutputFilter filter MYFILTER
# AddOutputFilter MYFILTER .flt
#</Directory>
# This will enable use of "Python Server Pages", HTML pages with
# inline Python code which is interpreted by the server:
#
#<Directory /var/www/html>
# AddHandler mod_python .psp
# PythonHandler mod_python.psp
#</Directory>