File dba-apache2-mod_remoteip.spec of Package dba-apache2-mod_remoteip

%define real_vers	0.1203875
%define prefix	/DBA/apache/WWW/2.2.x
%define apavers 2.2.29
%define apapack 2229
%define apahome /DBA/apache/WWW/%{apavers}
%define apxs    %{apahome}/bin/apxs
%define modname mod_remoteip

Name:           dba-apache2-%{modname}
Summary:        Reverse proxy add forward module for Apache2
Version:        %{real_vers}
Release:        1
License:        GPL
Source0:        %{modname}-%{real_vers}.tar.gz
Patch0:		patch.bug49839
Patch1:		patch.backportapa22
Group:          Productivity/Networking/Web/Servers
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  dba-apache-%{apapack}
Requires:  	dba-apache-base

BuildRequires:  dos2unix

#!BuildIgnore:  dba-openssl-098o dba-openssl-098r
#!BuildIgnore:  dba-postgresql-839 dba-postgresql-842

%if 0%{?suse_version}
BuildRequires:  libapr-util1-devel >= 1.3 libapr1-devel >= 1.3
BuildRequires:  apr-util-devel apr-devel

%if 0%{?suse_version} >= 1110
BuildRequires:  -post-build-checks

This module is used to treat the remote host which initiated the request as the
originating remote host as identified by httpd for the purposes of authorization
and logging, even where that remote host is behind a load balancer, front end
server, or proxy server.

The module replaces the apparent remote (client) IP/hostname for the request
with the IP address reported in the request header configured with the
RemoteIPHeader directive.

Once replaced as instructed, this apparent IP address is then used for 
mod_authz_host features <Require host> and <Require ip>, is reported by
mod_status, and is recorded by mod_log_config a and h directives. It also 
determines the machine probed for an inetd identity by mod_ident based on the
IdentityCheck configuration.

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

find -type f -exec dos2unix -U {} \;


# Bug in ARP
%if 0%{?sles_version} == 10
perl -pi -e 's|apr-1 64/include|apr-1|g' *
perl -pi -e 's|apr-1 /include|apr-1|g' *

%{apxs} -c %{modname}.c

%{__mkdir_p} %{buildroot}%{prefix}/conf
%{__mkdir_p} %{buildroot}%{prefix}/modules

install -m0755 .libs/%{modname}*.so %{buildroot}%{prefix}/modules/%{modname}-%{version}.so
install -m0644 %{modname}.conf %{buildroot}%{prefix}/conf/%{modname}.conf

cd %{prefix}/modules
%{__ln_s} -f %{modname}-%{version}.so %{modname}.so

%{__rm} -rf %{buildroot};


* Fri Aug  7 2015 Holger Manthey <>
- fix build for rhel versions