File mod_geoip2.spec of Package GeoIPApache2

Name:         mod_geoip2
License:      GPL
Group:        Productivity/Networking/Web/Servers
Summary:      Geoip module for apache2
Version:      1.2.5
Release:      1
URL:          http://www.maxmind.com/app/mod_geoip
BuildRoot:    %{_tmppath}/%{name}_%{version}-build
Source0:      %{name}_%{version}.tar.bz2
Source1:      update-geoip
Source2:      mod-geoip.conf
Packager:     Ronan LE MEILLAT
BuildRequires:     apache2-devel apache2-utils libGeoIP-devel
Requires:	apache2 cron
%define apxs /usr/sbin/apxs2  
%define apache apache2  
%define apache_libexecdir %(%{apxs} -q LIBEXECDIR)  
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)  
%define apache_includedir %(%{apxs} -q INCLUDEDIR)  
%define apache_serverroot %(%{apxs} -q PREFIX)  
%define apache_localstatedir %(%{apxs} -q LOCALSTATEDIR)  
%define apache_mmn        %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN) 

%description
mod_geoip looks up the IP address of the client end user. If you need to input the IP address instead of simply using the client IP address, you will need to use another one of our APIs.
For the country database, mod_geoip sets two environment variables, GEOIP_COUNTRY_CODE and GEOIP_COUNTRY_NAME. For other databases, see the README file included with the mod_geoip API.
It also sets two entries in Apache's notes table with the same names as above.
For more documentation, see the README file included with the mod_geoip API download. 

%prep
# extract the source and go into the kvpnc-0.7.2 directory
%setup -q -n %{name}_%{version}

%build
%{apxs} -lGeoIP -c mod_geoip.c 
strip -s .libs/mod_geoip.so
 
%install
mkdir -p $RPM_BUILD_ROOT/%{apache_libexecdir}
mkdir -p $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d
mkdir -p $RPM_BUILD_ROOT/etc/cron.monthly
install -m 755 .libs/mod_geoip.so $RPM_BUILD_ROOT/%{apache_libexecdir}
install -m 755 $RPM_SOURCE_DIR/update-geoip $RPM_BUILD_ROOT/etc/cron.monthly
install -m 644 $RPM_SOURCE_DIR/mod-geoip.conf $RPM_BUILD_ROOT/%{apache_sysconfdir}/conf.d

%files
%defattr (-,root,root)
%{apache_libexecdir}/mod_geoip.so
%{apache_sysconfdir}/conf.d/mod-geoip.conf
/etc/cron.monthly/update-geoip
%doc README
%doc README.php

%changelog
*Sat Sep 20 2008 - Ronan LE MEILLAT
- Initial release


openSUSE Build Service is sponsored by