2 %define apxs %{_sbindir}/apxs
3 Summary: GeoIP module for the Apache HTTP Server
4 Name: apache-mod_%{mod_name}
9 URL: https://www.maxmind.com/app/mod_geoip
10 Source0: http://www.maxmind.com/download/geoip/api/mod_geoip2/mod_%{mod_name}2_%{version}.tar.gz
11 # Source0-md5: 76514ad0e8adb8cd8231c5e3646d03fd
13 BuildRequires: %{apxs}
14 BuildRequires: GeoIP-devel
15 BuildRequires: apache-devel >= 2.2
16 BuildRequires: rpmbuild(macros) >= 1.268
17 Requires: apache(modules-api) = %apache_modules_api
18 Suggests: GeoIP-db-City
19 Suggests: GeoIP-db-Country
20 Suggests: GeoIP-db-IPASNum
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
24 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
27 mod_geoip is an Apache module for finding the country that a web
28 request originated from. It uses the GeoIP library and database to
29 perform the lookup. It is free software, licensed under the Apache
33 %setup -q -n mod_geoip2_%{version}
36 %{apxs} -Wc,"%{rpmcflags}" -Wl,-lGeoIP -c mod_geoip.c
39 rm -rf $RPM_BUILD_ROOT
40 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
41 install -Dp .libs/mod_geoip.so $RPM_BUILD_ROOT%{_pkglibdir}
43 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
46 rm -rf $RPM_BUILD_ROOT
49 %service -q httpd restart
52 if [ "$1" = "0" ]; then
53 %service -q httpd restart
58 %defattr(644,root,root,755)
59 %doc INSTALL README* Changes
60 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
61 %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so