b3f6f0d
%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}}
b3f6f0d
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
b3f6f0d
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
b3f6f0d
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
b3f6f0d
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
b3f6f0d
%{!?_httpd_moddir:    %{expand: %%global _httpd_moddir    %%{_libdir}/httpd/modules}}
b3f6f0d
Michael Fleming ccf734c
Summary: GeoIP module for the Apache HTTP Server
Michael Fleming ccf734c
Name: mod_geoip
Michael Fleming 23eb055
Version: 1.2.5
5c9a6e9
Release: 8%{?dist}
d813cd7
License: ASL 1.1
Michael Fleming ccf734c
Group: System Environment/Daemons
Michael Fleming ccf734c
URL: http://www.maxmind.com/app/mod_geoip
Michael Fleming ccf734c
Source: http://www.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_%{version}.tar.gz
Michael Fleming ccf734c
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Michael Fleming ccf734c
Requires: GeoIP httpd httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && cat %{_includedir}/httpd/.mmn || echo missing)
Michael Fleming ccf734c
BuildRequires: httpd-devel GeoIP-devel
b3f6f0d
# Not upstream
b3f6f0d
Patch0: mod_geoip-httpd24.patch
Michael Fleming ccf734c
Michael Fleming ccf734c
%description
Michael Fleming ccf734c
mod_geoip is an Apache module for finding the country that a web request
Michael Fleming ccf734c
originated from.  It uses the GeoIP library and database to perform
Michael Fleming ccf734c
the lookup.  It is free software, licensed under the Apache license.
Michael Fleming ccf734c
Michael Fleming ccf734c
%prep
Michael Fleming ccf734c
Michael Fleming e28ea3f
%setup -q -n mod_geoip2_%{version}
b3f6f0d
%patch0 -p0 -b .geoip
Michael Fleming ccf734c
Michael Fleming ccf734c
%build
b3f6f0d
%{_httpd_apxs} -Wc,"%{optflags}" -Wl,"-lGeoIP" -c mod_geoip.c
Michael Fleming ccf734c
Michael Fleming ccf734c
%install
b3f6f0d
mkdir -p %{buildroot}%{_httpd_confdir} %{buildroot}%{_httpd_modconfdir} \
b3f6f0d
      %{buildroot}%{_httpd_moddir}
b3f6f0d
install -Dp .libs/mod_geoip.so %{buildroot}%{_httpd_moddir}
Michael Fleming ccf734c
b3f6f0d
cat << EOF > 10-mod_geoip.conf
Michael Fleming ccf734c
LoadModule geoip_module modules/mod_geoip.so
Michael Fleming ccf734c
b3f6f0d
EOF
b3f6f0d
cat << EOF > mod_geoip.conf
Michael Fleming ccf734c
<IfModule mod_geoip.c>
Michael Fleming ccf734c
  GeoIPEnable On
Michael Fleming ccf734c
  GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
Michael Fleming ccf734c
</IfModule>
Michael Fleming ccf734c
Michael Fleming ccf734c
EOF
Michael Fleming ccf734c
b3f6f0d
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
b3f6f0d
# 2.4-style
5c9a6e9
install -m 0644 10-mod_geoip.conf %{buildroot}%{_httpd_modconfdir}
5c9a6e9
install -m 0644 mod_geoip.conf %{buildroot}%{_httpd_confdir}
b3f6f0d
%else
b3f6f0d
# old-style
5c9a6e9
cat 10-mod_geoip.conf mod_geoip.conf > unified.conf
5c9a6e9
install -m 0644 unified.conf %{buildroot}%{_httpd_confdir}/mod_geoip.conf
b3f6f0d
%endif
b3f6f0d
Michael Fleming ccf734c
%clean
Michael Fleming ccf734c
rm -rf %{buildroot}
Michael Fleming ccf734c
Michael Fleming ccf734c
%files
Michael Fleming ccf734c
%defattr (-,root,root)
Michael Fleming ccf734c
%doc INSTALL README* Changes
Michael Fleming ccf734c
%{_libdir}/httpd/modules/mod_geoip.so
Michael Fleming ccf734c
%config(noreplace) %{_sysconfdir}/httpd/conf.d/mod_geoip.conf
b3f6f0d
%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
b3f6f0d
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/10-mod_geoip.conf
b3f6f0d
%endif
Michael Fleming ccf734c
Michael Fleming ccf734c
%changelog
5c9a6e9
* Mon Apr 16 2012 Joe Orton <jorton@redhat.com> - 1.2.5-8
5c9a6e9
- fix config perms
5c9a6e9
b3f6f0d
* Wed Apr 04 2012 Jan Kaluza <jkaluza@redhat.com> - 1.2.5-7
b3f6f0d
- Fix compilation error with httpd-2.4 (#809698)
b3f6f0d
7b1f976
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-6
7b1f976
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
7b1f976
360122d
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-5
360122d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
360122d
7b2578f
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-4
7b2578f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
7b2578f
fa184a2
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.5-3
fa184a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
fa184a2
Michael Fleming e28ea3f
* Fri Aug 29 2008 Michael Fleming <mfleming+rpm@enlartenment.com> - 1.2.5-2
Michael Fleming e28ea3f
- Update setup macro
Michael Fleming e28ea3f
Michael Fleming 23eb055
* Fri Aug 29 2008 Michael Fleming <mfleming+rpm@enlartenment.com> - 1.2.5-1
Michael Fleming 23eb055
- Update to 1.2.5
Michael Fleming 23eb055
d813cd7
* Mon Aug 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.2.4-3
d813cd7
- fix license tag
d813cd7
Michael Fleming a504da9
* Fri Jun 20 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.4-2
Michael Fleming c4d047f
- New upstream update
Michael Fleming a504da9
- Minor spec tweaks
Michael Fleming c4d047f
Michael Fleming 619e169
* Sun Apr 13 2008 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.2-1
Michael Fleming 619e169
- New upstream update
Michael Fleming 619e169
4bf9349
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.0-2
4bf9349
- Autorebuild for GCC 4.3
4bf9349
Michael Fleming 0b0b07b
* Wed Sep 5 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.0-1
Michael Fleming 0b0b07b
- New upstream release
Michael Fleming 0b0b07b
- Employ some macro sanity..
Michael Fleming 0b0b07b
Michael Fleming 92cfaad
* Sun Sep 3 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.1.8-2
Michael Fleming 92cfaad
- Bump and rebuild
Michael Fleming 92cfaad
Michael Fleming da137ff
* Mon May 1 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.1.8-1
Michael Fleming da137ff
- New upstream release
Michael Fleming da137ff
Michael Fleming ccf734c
* Sat Feb 18 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.1.7-2
Michael Fleming ccf734c
- Small cleanups, including a saner Requires: for httpd
Michael Fleming ccf734c
- Don't strip the binary
Michael Fleming ccf734c
Michael Fleming ccf734c
* Sun Feb 5 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.1.7-1
Michael Fleming ccf734c
- Initial review package for Extras
Michael Fleming ccf734c