# # spec file for package php7-geoip # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define pkg_name geoip %define php_name php7 # Name: php7-geoip Version: 1.1.1 Release: 2.7 Summary: PHP module for MaxMind GeoIP libraries License: PHP-3.01 Group: Productivity/Networking/Web/Servers Url: https://pecl.php.net/geoip Source: https://pecl.php.net/get/%{pkg_name}-%{version}.tgz Patch0: geoip-module-deps.patch BuildRequires: %{php_name}-devel BuildRequires: GeoIP-devel Provides: php-%{pkg_name} = %{version} Obsoletes: php-%{pkg_name} < %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{?php_zend_api}0 Requires: php(api) = %{php_core_api} Requires: php(zend-abi) = %{php_zend_api} %else %requires_eq %{php_name} %endif %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. %prep %setup -q -n %{pkg_name}-%{version} %patch0 %build export CFLAGS="%{optflags} -fvisibility=hidden" %{_bindir}/phpize %configure --with-geoip=%{_usr} make %{?_smp_mflags} %check # only check if the extension can be loaded %{_bindir}/php \ --no-php-ini \ --define extension=%{buildroot}/usr/lib/%{php_name}/extensions/geoip.so \ --modules | grep geoip %install make DESTDIR=%{buildroot} install INSTALL_ROOT=%{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/%{php_name}/conf.d echo "; comment out next line to disable geoip extension in php" > %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/geoip.ini echo 'extension = geoip.so' >> %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/geoip.ini echo 'geoip.database_standard = /var/lib/GeoIP/GeoIP.dat' >> %{buildroot}%{_sysconfdir}/%{php_name}/conf.d/geoip.ini %files %defattr(-,root,root,-) /usr/lib/%{php_name}/extensions/geoip.so %config(noreplace) %{_sysconfdir}/%{php_name}/conf.d/geoip.ini %doc README ChangeLog %license LICENSE %changelog * Fri Apr 20 2018 jweberhofer@weberhofer.at - Use default php packaging process - Enabled -fvisibility=hidden - added %%license * Sun Jan 29 2017 jweberhofer@weberhofer.at - Cleaned up spec * Tue Jan 10 2017 jweberhofer@weberhofer.at - Updated to version 1.1.1 * Add IPv6 support (geoip_country_code_by_*_v6) * PHP7 support (thanks to Adam and Dan Ackroyd) - Updated URLs in spec file * Fri Jan 29 2016 pgajdos@suse.com - provides php-geoip symbol * Tue Jan 12 2016 pgajdos@suse.com - call spec-cleaner * Thu May 28 2015 crrodriguez@opensuse.org - Update to version 1.0.1 * Sat Oct 29 2011 crrodriguez@opensuse.org - Update to version 1.0.8 * Sun Jun 5 2011 crrodriguez@opensuse.org - Add missing module deps * Sun Apr 4 2010 crrodriguez@opensuse.org - updat to version 1.0.7 * Sun Aug 16 2009 crrodriguez@suse.de - use API versioning macros * Tue Jan 20 2009 crrodriguez@suse.de - version 1.0.6 * Mon Dec 22 2008 crrodriguez@suse.de - update to version 1.0.5 * * Small bug in phpinfo() when printing version number could crash PHP. * Fri Jun 13 2008 crrodriguez@suse.de - update to version 1.0.3 * Change license from PHP 3.0 to PHP 3.01 for Debian? * Added geoip_continent_code_by_name() to get continent instead of country * Fixing a small casting issue (compiler warning) * Fixing missing entries in geoip_record_by_name(), bug #14131 * Fri Nov 23 2007 crrodriguez@suse.de - version 1.0.2 * Thu Aug 23 2007 crrodriguez@suse.de - update to version 1.0.1 * Tue Aug 14 2007 crrodriguez@suse.de - update to version 1.0.0