Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 807d5c98fdf86727737530939505f966 > files > 2

apache2-mod_rpaf-2.0.53_0.4-4mdk.src.rpm

#Module-Specific definitions
%define mod_version 0.4
%define mod_name mod_rpaf
%define mod_conf 19_%{mod_name}.conf
%define mod_so %{mod_name}.so
%define sourcename %{mod_name}

%define apache_version 2.0.53

# Standard Module Definitions
%define name apache2-%{mod_name}
%define version %{apache_version}_%{mod_version}

Summary:	Mod_rpaf is a DSO module for the apache2 Web server
Name:		%{name}
Version:	%{version}
Release:	%mkrel 4
Group:		System/Servers
License:	Apache License
URL:		http://stderr.net/apache/rpaf/
Source0:	%{mod_name}-%{mod_version}.tar.bz2
Source1:	%{mod_conf}.bz2
Patch0:		%{mod_name}-%{mod_version}-register.patch.bz2
Prereq:		apache2 >= %{apache_version}
Prereq:		apache2-conf
BuildRequires:	apache2-devel >= %{apache_version}-1mdk
BuildRequires:	file
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description
rpaf is for backend Apache servers what mod_proxy_add_forward is
for frontend Apache servers. It does excactly the opposite of
mod_proxy_add_forward written by Ask Bjrn Hansen. It will also
work with mod_proxy in Apache starting with release 1.3.25 and
mod_proxy that is distributed with Apache2 from version 2.0.36.

It changes the remote address of the client visible to other
Apache modules when two conditions are satisfied. First condition
is that the remote client is actually a proxy that is defined in
httpd.conf. Secondly if there is an incoming X-Forwarded-For
header and the proxy is in it's list of known proxies it takes
the last IP from the incoming X-Forwarded-For header and changes
the remote address of the client in the request structure. It also
takes the incoming X-Host header and updates the virtualhost
settings accordingly. For Apache2 mod_proxy it takes the
X-Forwared-Host header and updates the virtualhosts.

%prep

%setup -q -n %{mod_name}-%{mod_version}
%patch0 -p1

# strip away annoying ^M
find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//'
find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//'

%build

%{_sbindir}/apxs2 -c %{mod_name}-2.0.c 

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

mv .libs/*.so .libs/%{mod_so}

install -d %{buildroot}%{_libdir}/apache2-extramodules
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d

install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache2-extramodules/
bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/conf.d/%{mod_conf}

install -d %{buildroot}%{_var}/www/html/addon-modules
ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version}

%post
if [ -f %{_var}/lock/subsys/httpd ]; then
    %{_initrddir}/httpd restart 1>&2;
fi

%postun
if [ "$1" = "0" ]; then
    if [ -f %{_var}/lock/subsys/httpd ]; then
	%{_initrddir}/httpd restart 1>&2
    fi
fi

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{mod_conf}
%attr(0755,root,root) %{_libdir}/apache2-extramodules/%{mod_so}
%{_var}/www/html/addon-modules/*

%changelog
* Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.4-4mdk
- use the %%mkrel macro

* Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.4-3mdk
- fix %%post and %%postun to prevent double restarts
- fix bug #6574

* Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.4-2mdk
- spec file cleanups, remove the ADVX-build stuff

* Tue Feb  8 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.4-1mdk
- rebuilt for apache 2.0.53

* Tue Sep 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_0.4-1mdk
- built for apache 2.0.52

* Thu Sep 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_0.4-1mdk
- built for apache 2.0.51

* Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_0.4-1mdk
- built for apache 2.0.50
- remove redundant provides

* Mon Jun 14 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.49_0.4-1mdk
- built for apache 2.0.49

* Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.4-1mdk
- built for apache 2.0.48

* Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_0.4-1mdk
- rebuilt against latest apache2, requires and buildrequires

* Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.4-1mdk
- rebuilt for apache v2.0.46
- buildprereq ADVX-build >= 9.2

* Tue Apr 08 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.45_0.4-1mdk
- cosmetic rebuild for apache v2.0.45 

* Tue Jan 21 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.44_0.4-1mdk
- rebuilt for apache v2.0.44

* Mon Jan 20 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-6mdk
- fix buildrequires apache2-devel >= 2.0.53-1mdk, as 
  pointed out by Olivier Thauvin

* Sat Jan 18 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-5mdk
- rebuilt against rebuilt buildrequires

* Mon Jan 13 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-4mdk
- Rebuilt with the new apache-devel that uses /usr/sbin/apxs2 and
  /usr/include/apache2

* Sat Nov 02 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-3mdk
- rebuilt for/against apache2 where dependencies has changed in apr

* Tue Oct 22 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-2mdk
- extra modules needs to be loaded _before_ mod_ssl, mod_php and mod_perl
  in order to show up in the server string...

* Fri Oct 04 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.43_0.4-1mdk
- rebuilt for/against new apache2 version 2.0.43 (even though 2.0.42 and 
  2.0.43 are binary compatible, we have to consider rpm dependencies)
- sanitize rpm package versioning

* Thu Sep 26 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.42_0.4-2mdk
- rebuilt against new apache v2.0.42

* Fri Sep 20 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.4-1mdk
- initial cooker contrib