summaryrefslogtreecommitdiffstats
path: root/php-pecl-geoip.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-geoip.spec')
-rw-r--r--php-pecl-geoip.spec83
1 files changed, 40 insertions, 43 deletions
diff --git a/php-pecl-geoip.spec b/php-pecl-geoip.spec
index 0434afb..ee577ce 100644
--- a/php-pecl-geoip.spec
+++ b/php-pecl-geoip.spec
@@ -8,25 +8,31 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-geoip
-%endif
+%{?scl:%scl_package php-pecl-geoip}
+
+%bcond_without tests
-%global pecl_name geoip
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name geoip
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
+%global ini_name %{pecl_name}.ini
%else
-%global ini_name 40-%{pecl_name}.ini
+%global ini_name 40-%{pecl_name}.ini
%endif
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
+# For PHP < 5.6 and EPEL-9
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
-Name: %{?sub_prefix}php-pecl-geoip
+Name: %{?scl_prefix}php-pecl-geoip
Version: 1.1.1
-Release: 16%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 17%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: Extension to map IP addresses to geographic places
-License: PHP
+License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
@@ -48,12 +54,8 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
# Other third party repo stuff
Obsoletes: php53-pecl-%{pecl_name} <= %{version}
Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
@@ -81,15 +83,6 @@ Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "7.3"
Obsoletes: php73-pecl-%{pecl_name} <= %{version}
%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
%endif
@@ -110,11 +103,9 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{version} NTS
-
-cd NTS
-%patch0 -p1 -b .php8
-%patch1 -p1 -b .php81
+cd %{sources}
+%patch -P0 -p1 -b .php8
+%patch -P1 -p1 -b .php81
extver=$(sed -n '/#define PHP_GEOIP_VERSION/{s/.* "//;s/".*$//;p}' php_geoip.h)
if test "x${extver}" != "x%{version}"; then
@@ -128,23 +119,25 @@ cat > %{ini_name} << 'EOF'
extension=%{pecl_name}.so
EOF
+mkdir NTS
%if %{with_zts}
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -167,7 +160,7 @@ install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -175,16 +168,17 @@ done
: Minimal load test for NTS extension
%{__php} -n \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- -m | grep %{pecl_name}
+ -m | grep '^%{pecl_name}$'
%if %{with_zts}
: Minimal load test for ZTS extension
%{__ztsphp} -n \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- -m | grep %{pecl_name}
+ -m | grep '^%{pecl_name}$'
%endif
-cd NTS
+%if %{with tests}
+cd %{sources}
# Missing IPv6 data
rm tests/019.phpt
@@ -193,9 +187,9 @@ REPORT_EXIT_STATUS=1 \
NO_INTERACTION=1 \
%{__php} run-tests.php \
-n -q \
- -d extension_dir=modules \
- -d extension=%{pecl_name}.so \
+ -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--show-diff
+%endif
%if 0%{?fedora} < 24 && 0%{?rhel} < 8
@@ -219,7 +213,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -233,6 +227,9 @@ fi
%changelog
+* Thu Jul 20 2023 Remi Collet <remi@remirepo.net> - 1.1.1-17
+- build out of sources tree
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.1.1-16
- rebuild for 8.1.0RC1