summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-http.spec63
1 files changed, 34 insertions, 29 deletions
diff --git a/php-pecl-http.spec b/php-pecl-http.spec
index 862df9a..a7dbdee 100644
--- a/php-pecl-http.spec
+++ b/php-pecl-http.spec
@@ -38,6 +38,12 @@
%global upstream_version 4.2.3
#global upstream_prever beta1
#global upstream_lower beta1
+%if 0%{?gh_date:1}
+%global sources %{gh_project}-%{gh_commit}
+%else
+%global sources %{proj_name}-%{upstream_version}%{?upstream_prever}
+%endif
+%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-pecl-http
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
@@ -45,7 +51,7 @@ Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
%else
-Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upstream_prever}.tgz
%endif
Summary: Extended HTTP support
@@ -83,7 +89,6 @@ Requires: %{?scl_prefix}php-raphf%{?_isa} >= 2
Obsoletes: %{?scl_prefix}php-pecl-http1 < 2
# to allow migration from PHP 7 (last is 2.1.0)
Obsoletes: %{?scl_prefix}php-pecl-propro < 2.2
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
@@ -123,15 +128,13 @@ These are the files needed to compile programs using HTTP extension.
%prep
%setup -c -q
%if 0%{?gh_date}
-mv %{gh_project}-%{gh_commit} NTS
mv NTS/package.xml .
%else
-mv %{proj_name}-%{upstream_version}%{?upstream_prever} NTS
%endif
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
-cd NTS
+cd %{sources}
extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:dev}"; then
: Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}%{?gh_date:dev}.
@@ -142,9 +145,10 @@ cd ..
cp %{SOURCE1} %{ini_name}
+mkdir NTS
%if %{with_zts}
# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
@@ -172,15 +176,17 @@ peclconf() {
--with-php-config=$1
grep IDNA config.h
}
-cd NTS
-%{_bindir}/phpize
-peclconf %{_bindir}/php-config
+
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+peclconf %{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-peclconf %{_bindir}/zts-php-config
+peclconf %{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -202,7 +208,7 @@ install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Test & Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do [ -f $i ] && install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{proj_name}/$i
[ -f tests/$i ] && install -Dpm 644 tests/$i %{buildroot}%{pecl_testdir}/%{proj_name}/tests/$i
@@ -214,18 +220,19 @@ done
%check
+cd %{sources}
: ignore tests with erratic results
-rm ?TS/tests/client021.phpt
-rm ?TS/tests/client022.phpt
-rm ?TS/tests/client025.phpt
-rm ?TS/tests/client027.phpt
+rm tests/client021.phpt
+rm tests/client022.phpt
+rm tests/client025.phpt
+rm tests/client027.phpt
export REPORT_EXIT_STATUS=1
user=$(id -un)
: all tests when rpmbuild is used
if [ "$user" = "remi" ]; then
-rm ?TS/tests/gh-issue50.phpt
+rm tests/gh-issue50.phpt
export SKIP_ONLINE_TESTS=0
else
: only local tests when mock is used
@@ -244,15 +251,13 @@ done
%{__php} --no-php-ini \
$modules \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite NTS extension
-cd NTS
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
-%{__php} -n run-tests.php --show-diff
+TEST_PHP_ARGS="-n $modules -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
+%{__php} -n run-tests.php -q --show-diff
%endif
%if %{with_zts}
@@ -260,15 +265,13 @@ NO_INTERACTION=1 \
%{__ztsphp} --no-php-ini \
$modules \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite ZTS extension
-cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
-%{__ztsphp} -n run-tests.php --show-diff
+TEST_PHP_ARGS="-n $modules -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
%endif
@@ -294,7 +297,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{proj_name}
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -306,7 +309,6 @@ fi
%endif
%files devel
-%defattr(-,root,root,-)
%doc %{pecl_testdir}/%{proj_name}
%{php_incldir}/ext/%{pecl_name}
@@ -316,6 +318,9 @@ fi
%changelog
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 4.2.3-4
+- build out of sources tree
+
* Thu May 11 2023 Remi Collet <remi@remirepo.net> - 4.2.3-3
- rebuild using ICU 72
- use SPDX license ID