%define mod_name mod_geoip Summary: GeoIP module for the Apache HTTP Server Name: apache-%{mod_name} Version: 1.2.7 Release: %mkrel 6 Group: System/Servers License: ASL 1.1 URL: http://www.maxmind.com/app/mod_geoip Source: http://www.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_%{version}.tar.gz Patch0: mod_geoip-1.2.5-httpd24.patch BuildRequires: apache-devel BuildRequires: pkgconfig(geoip) >= 1.4.3 Requires: geoip%{?_isa} Requires: apache %description mod_geoip is an Apache module to look up geolocation information for a client as part of the HTTP request process. It uses the GeoIP library and database to perform the lookup. It is free software, licensed under the Apache license. %prep %setup -q -n mod_geoip2_%{version} %patch0 -p0 -b .geoip %build %{_httpd_apxs} -Wc,-Wall -Wl,"-lGeoIP" -c %{mod_name}.c %install install -D -p -m 755 .libs/%{mod_name}.so %{buildroot}%{_httpd_moddir}/%{mod_name}.so cat << EOF > 10-geoip.conf LoadModule geoip_module modules/mod_geoip.so EOF cat << EOF > geoip.conf <IfModule mod_geoip.c> GeoIPEnable On GeoIPDBFile /usr/share/GeoIP/GeoIP.dat </IfModule> EOF %if "%{_httpd_modconfdir}" == "%{_httpd_confdir}" # apache <= 2.2.x cat 10-geoip.conf > unified.conf echo >> unified.conf cat geoip.conf >> unified.conf install -D -p -m 644 unified.conf %{buildroot}%{_httpd_confdir}/geoip.conf %else # apache >= 2.4.x install -D -p -m 644 10-geoip.conf %{buildroot}%{_httpd_modconfdir}/10-geoip.conf install -D -p -m 644 geoip.conf %{buildroot}%{_httpd_confdir}/geoip.conf %endif %files %doc INSTALL README* Changes %{_httpd_moddir}/%{mod_name}.so %config(noreplace) %{_httpd_confdir}/geoip.conf %if "%{_httpd_modconfdir}" != "%{_httpd_confdir}" %config(noreplace) %{_httpd_modconfdir}/10-geoip.conf %endif %changelog * Wed Oct 15 2014 umeabot <umeabot> 1.2.7-6.mga5 + Revision: 749565 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 1.2.7-5.mga5 + Revision: 677841 - Mageia 5 Mass Rebuild * Sat Aug 02 2014 ovitters <ovitters> 1.2.7-4.mga5 + Revision: 659214 - clean spec - don't require exact apache version * Sun Jun 29 2014 pterjan <pterjan> 1.2.7-3.mga5 + Revision: 641150 - Rebuild for apache 2.4.9 * Sun Dec 29 2013 pterjan <pterjan> 1.2.7-2.mga4 + Revision: 563130 - Fix broken dependency * Tue Oct 22 2013 ovitters <ovitters> 1.2.7-1.mga4 + Revision: 546339 - imported package apache-mod_geoip