LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File apache2-mod_wsgi.spec of Package apache2-mod_wsgi (Project Apache:Modules)

# spec file for package apache2-mod_wsgi
# Copyright (c) 2015 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 modname        mod_wsgi
Name:           apache2-mod_wsgi
Version:        4.4.13
Release:        0
Summary:        Python WSGI adapter module for Apache
License:        Apache-2.0
Group:          Productivity/Networking/Web/Servers
Url:            https://github.com/GrahamDumpleton/mod_wsgi
#Source:        https://github.com/GrahamDumpleton/mod_wsgi/archive/%%{version}.tar.gz
Source:         %{modname}-%{version}.tar.gz
## Work around for inconsistent Apache source tree in SLE 12, see bnc#915479
Patch0:         wsgi_fixVersionCheck.patch
BuildRequires:  python-devel
Provides:       %{modname} = %{version}-%{release}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires:  apache-rpm-macros
BuildRequires:  apache2-devel
%define apache_apxs %{bindir}/apxs
%define apache_sysconfdir %(%{apache_apxs} -q PREFIX)
BuildRequires:  httpd
BuildRequires:  httpd-devel
%if 0%{?suse_version}
Requires:       %{apache_mmn}
Requires:       %{apache_suse_maintenance_mmn}
Requires:       apache2
Requires:       httpd
Conflicts:      apache2-mod_wsgi-python3

The aim of mod_wsgi is to implement a simple to use Apache module which can
host any Python application which supports the Python WSGI interface.

%setup -q -n %{modname}-%{version}
%patch0 -p1

export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure \
%if 0%{?suse_version}
    --with-apxs="%{apache_apxs}-prefork" \
    --with-apxs="%{apache_apxs}" \
make %{?_smp_mflags}

make install DESTDIR=%{buildroot} LIBEXECDIR=%{apache_libexecdir}

%if 0%{?suse_version}
if ! %{_sbindir}/a2enmod -q wsgi; then
  %{_sbindir}/a2enmod wsgi

%if 0%{?suse_version}
if [ "$1" = "0" ]; then
  if a2enmod -q wsgi; then
    %{_sbindir}/a2enmod -d wsgi

set +x
%apache_test_module_load -m wsgi
set -x

%doc LICENSE README.rst docs/release-notes
%dir %{apache_libexecdir}