File php5-geoip.spec of Package php5-geoip
# norootforbuild
%define pkg_name geoip
#
Name: php5-geoip
Version: 1.0.8
Release: 0
License: PHP
Group: Productivity/Networking/Web/Servers
BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-build
BuildRequires: GeoIP-devel php-devel
URL: http://pecl.php.net/geoip
Source: http://pecl.php.net/package/geoip/%{pkg_name}-%{version}.tgz
Summary: PHP module for MaxMind GeoIP libraries
%if %{?php_zend_api}0
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
Provides: php-geoip
%else
%requires_eq php5
%endif
Patch: geoip-module-deps.patch
%description
This PHP extension allows you to find the location of an IP address - City, State,
Country, Longitude, Latitude, and other information as all, such as ISP and connection type.
For more info, please visit Maxmind's website.
Authors:
---------
Olivier Hill <ohill@php.net>
%prep
%setup -q -n %{pkg_name}-%{version}
%patch
%build
%{__mkdir} %{name}
/usr/bin/phpize
pushd %{name}
export CFLAGS="%{optflags}"
../configure --with-geoip=%{_usr} --with-libdir=%{_lib}
%{__make} %{?jobs:-j%jobs}
popd
%install
%makeinstall -C %{name} INSTALL_ROOT=%{buildroot}
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php5/conf.d
echo "; comment out next line to disable geoip extension in php" > %{buildroot}%{_sysconfdir}/php5/conf.d/geoip.ini
echo 'extension = geoip.so' >> %{buildroot}%{_sysconfdir}/php5/conf.d/geoip.ini
echo 'geoip.database_standard = /usr/share/GeoIP/GeoIP.dat' >> %{buildroot}%{_sysconfdir}/php5/conf.d/geoip.ini
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/php5/extensions/geoip.so
%config(noreplace) %{_sysconfdir}/php5/conf.d/geoip.ini
%doc README ChangeLog
%changelog -n php5-geoip
* Thu Nov 16 2006 - soporte@onfocus.cl
- very first build