LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File dba-apache2-mod_remoteip.spec of Package dba-apache2-mod_remoteip (Project home:csbuild:DBA)

%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
URL:            http://people.apache.org/~wrowe/httpd-2.2-ports/mod_remoteip.c
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
%else
BuildRequires:  apr-util-devel apr-devel
%endif

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

%description
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.


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

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


%build

# 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' *
%endif

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


%install
%{__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


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


%clean
%{__rm} -rf %{buildroot};


%files
%defattr(-,root,root,-)
%{prefix}/conf/%{modname}*
%{prefix}/modules/%{modname}-%{version}.so


%changelog
* Fri Aug  7 2015 Holger Manthey <holger.manthey@bertelsmann.de>
- fix build for rhel versions