File python-scgi.spec of Package python-scgi

#
# spec file for package python-scgi
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define	apxs	%{_sbindir}/apxs2
%define	apache_libexecdir	%(%{apxs} -q LIBEXECDIR)
%define apache_mmn        %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
Name:           python-scgi
Version:        1.14
Release:        0
Summary:        Python implementation of the SCGI protocol
License:        SUSE-Python-1.6
Group:          Development/Languages/Python
Url:            http://www.mems-exchange.org/software/scgi/
# repacked from http://quixote.python.ca/releases/scgi-%{version}.tar.gz
Source:         http://python.ca/scgi/releases/scgi-%{version}.tar.gz
Patch0:         python-scgi-newstyle-classes.patch
Patch1:         python-scgi-1.13_documentation_path.patch
Patch2:         python-scgi-apache24.patch
BuildRequires:  apache2-devel
BuildRequires:  pcre-devel
BuildRequires:  python-devel
Provides:       python2-scgi = %{version}

%description
The SCGI protocol is a replacement for the Common Gateway Interface (CGI)
protocol. It is a standard for applications to interface with HTTP servers.
It is similar to FastCGI but is designed to be easier to implement.

This package contains the python bindings.

%package -n apache2-mod_scgi
Summary:        Apache module named mod_scgi that implements the client side of the protocol
Group:          Development/Languages/Python
Requires:       %{apache_mmn}
Requires:       apache2

%description -n apache2-mod_scgi
The SCGI protocol is a replacement for the Common Gateway Interface
(CGI) protocol. It is a standard for applications to interface with
HTTP servers. It is similar to FastCGI but is designed to be easier to
implement.

This package contains the apache2 module.

To load mod_python into Apache, run the command "a2enmod scgi" as root.

%prep
%setup -q -n scgi-%{version}
%patch0 -p1
%patch1
%patch2 -p1

%build
CFLAGS="%{optflags}" \
python setup.py build
pushd apache2
    %{apxs} -c mod_scgi.c
popd

%install
python setup.py install --prefix=%{_prefix} --root %{buildroot} --record-rpm %{name}.files
install -Dpm 0755 apache2/.libs/mod_scgi.so  %{buildroot}%{apache_libexecdir}/mod_scgi.so
cp apache2/README.txt README.apache2.txt

%files -f %{name}.files
%doc README.txt cgi2scgi.c CHANGES.txt LICENSE.txt doc/guide.html cgi2scgi.c

%files -n apache2-mod_scgi
%{apache_libexecdir}/mod_scgi.so
%doc README.txt CHANGES.txt LICENSE.txt README.apache2.txt doc/guide.html

%changelog
openSUSE Build Service is sponsored by