代码拉取完成,页面将自动刷新
%undefine _strict_symbol_defs_build
%global with_zts 0%{?__ztsphp:1}
%global pecl_name raphf
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
%global ini_name 40-%{pecl_name}.ini
Summary: Resource and persistent handles factory
Name: php-pecl-%{pecl_name}
Version: 2.0.1
Release: 2%{?dist}
License: BSD-2-Clause
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Patch0: https://patch-diff.githubusercontent.com/raw/m6w6/ext-raphf/pull/9.patch
BuildRequires: php-devel > 7
BuildRequires: php-pear
%if %{with_tests}
BuildRequires: php-pecl-http >= 2.0.0
%endif
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
Provides: php-%{pecl_name} = %{version}
Provides: php-%{pecl_name} = %{version}
Provides: php-pecl(%{pecl_name}) = %{version}
Provides: php-pecl(%{pecl_name}) = %{version}
%description
A reusable split-off of pecl_http's persistent handle and resource
factory API.
%package devel
Summary: %{name} developer files (header)
Requires: %{name} = %{version}-%{release}
Requires: php-devel
%description devel
These are the files needed to compile programs using %{name}.
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
cd NTS
%patch0 -p1 -b .pr9
extver=$(sed -n '/#define PHP_RAPHF_VERSION/{s/.* "//;s/".*$//;p}' php_raphf.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}.
exit 1
fi
cd ..
%if %{with_zts}
cp -pr NTS ZTS
%endif
cat << 'EOF' | tee %{ini_name}
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
; Configuration
;raphf.persistent_handle.limit = -1
EOF
%build
cd NTS
%{_bindir}/phpize
%configure \
--with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
%configure \
--with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif
%install
make -C NTS \
install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
make -C ZTS \
install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
done
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
done
%check
cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=modules/%{pecl_name}.so \
--modules | grep %{pecl_name}
%if %{with_tests}
for mod in json hash iconv propro; do
if [ -f %{php_extdir}/${mod}.so ]; then
modules="$modules -d extension=${mod}.so"
fi
done
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so -d extension=http.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php
%endif
%if %{with_zts}
cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=modules/%{pecl_name}.so \
--modules | grep %{pecl_name}
%if %{with_tests}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so -d extension=http.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php
%endif
%endif
%files
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ini_name}
%{php_ztsextdir}/%{pecl_name}.so
%endif
%files devel
%doc %{pecl_testdir}/%{pecl_name}
%{php_incldir}/ext/%{pecl_name}
%if %{with_zts}
%{php_ztsincldir}/ext/%{pecl_name}
%endif
%changelog
* Thu Jan 09 2025 bbrucezhang <bbrucezhang@tencent.com> - 2.0.1-2
- Rebuild for php
* Fri Apr 12 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 2.0.1-1
- initial build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。