summaryrefslogtreecommitdiffstats
path: root/php-pecl-ip2location.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-ip2location.spec')
-rw-r--r--php-pecl-ip2location.spec51
1 files changed, 30 insertions, 21 deletions
diff --git a/php-pecl-ip2location.spec b/php-pecl-ip2location.spec
index 2cfdd35..5bbc2eb 100644
--- a/php-pecl-ip2location.spec
+++ b/php-pecl-ip2location.spec
@@ -6,9 +6,13 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-ip2location
-%endif
+%{?scl:%scl_package php-pecl-ip2location}
+
+# Defined in Fedora >= 37 and RHEL >= 10, in PHP >= 7.4 for remirepo
+%{!?__phpize: %global __phpize %{_bindir}/phpize}
+%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize}
+%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config}
+%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config}
%global pecl_name ip2location
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -20,13 +24,16 @@
%global upstream_version 8.2.0
#global upstream_prever RC1
-%global libversion 8.4
+%global libversion 8.6
+
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Get geo location information of an IP address
Name: %{?scl_prefix}php-pecl-%{pecl_name}
License: PHP-3.01
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
@@ -61,7 +68,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install tests
sed -e 's/role="test"/role="src"/' \
@@ -70,7 +76,7 @@ sed -e 's/role="test"/role="src"/' \
-e '/AGREEMENT.PDF/s/role="doc"/role="test"/' \
-i package.xml
-cd NTS
+cd %{sources}
sed -e "s/\r//" -i LICENSE CREDITS *.md *.c *.h
# Check version
@@ -81,8 +87,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-cp -r NTS ZTS
+mkdir ZTS
%endif
cat <<EOF | tee %{ini_name}
@@ -94,15 +101,16 @@ EOF
%build
%{?dtsenable}
-cd NTS
+cd %{sources}
%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+
+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
@@ -124,23 +132,22 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{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
%check
+cd %{sources}
: simple NTS module load test
%{_bindir}/php --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: upstream test suite
-cd NTS
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{_bindir}/php -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%if %{with_zts}
: simple ZTS module load test
@@ -149,12 +156,10 @@ REPORT_EXIT_STATUS=1 \
--modules | grep %{pecl_name}
: upstream test suite
-cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
@@ -179,7 +184,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -193,6 +198,10 @@ fi
%changelog
+* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 8.2.0-2
+- raise dependency on IP2location library version 8.6
+- build out of sources tree
+
* Mon Jun 12 2023 Remi Collet <remi@remirepo.net> - 8.2.0-1
- update to 8.2.0