summaryrefslogtreecommitdiffstats
path: root/php-pecl-yaf.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-yaf.spec')
-rw-r--r--php-pecl-yaf.spec67
1 files changed, 36 insertions, 31 deletions
diff --git a/php-pecl-yaf.spec b/php-pecl-yaf.spec
index 54b86e1..2ba46d6 100644
--- a/php-pecl-yaf.spec
+++ b/php-pecl-yaf.spec
@@ -7,12 +7,7 @@
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
-
-%if 0%{?scl:1}
-%scl_package php-pecl-yaf
-%endif
+%{?scl:%scl_package php-pecl-yaf}
%bcond_without tests
@@ -24,22 +19,29 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name yaf
%global ini_name 40-%{pecl_name}.ini
+%if 0%{?gh_date:1}
+%global sources %{gh_project}-%{gh_commit}
+%else
+%global sources %{pecl_name}-%{version}
+%endif
+%global _configure ../%{sources}/configure
Summary: Yet Another Framework
Name: %{?scl_prefix}php-pecl-yaf
Version: 3.3.5
%if 0%{?gh_date:1}
Release: 0.13.%{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
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{sources}-%{gh_short}.tar.gz
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Source: https://pecl.php.net/get/%{sources}%{?prever}.tgz
%endif
License: PHP
URL: https://pecl.php.net/package/yaf
Source1: %{pecl_name}.ini
Patch0: %{pecl_name}-php82.patch
+Patch1: %{pecl_name}-php83.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -51,7 +53,6 @@ BuildRequires: %{?scl_prefix}php-json
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -69,10 +70,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
%if 0%{?gh_date:1}
-mv %{gh_project}-%{gh_commit} NTS
-mv NTS/package.xml .
-%else
-mv %{pecl_name}-%{version} NTS
+mv %{sources}/package.xml .
%endif
# Don't install/register tests
@@ -80,8 +78,9 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
-%patch0 -p1 -b .pr579
+cd %{sources}
+%patch -P0 -p1 -b .php82
+%patch -P1 -p1 -b .php83
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_YAF_VERSION/{s/.*\t"//;s/".*$//;p}' php_yaf.h )
@@ -91,24 +90,25 @@ if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-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
@@ -130,16 +130,18 @@ install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# 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
+cd %{sources}
+for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%check
+cd %{sources}
+
OPTS="-n"
[ -f %{php_extdir}/json.so ] && OPTS="$OPTS -d extension=json.so"
-cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
@@ -148,14 +150,12 @@ cd NTS
%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="$OPTS -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="$OPTS -d %{buildroot}%{php_extdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q --show-diff
%endif
%if %{with_zts}
-cd ../ZTS
-
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
@@ -164,7 +164,7 @@ cd ../ZTS
%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="$OPTS -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="$OPTS -d %{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php -q --show-diff
%endif
@@ -192,7 +192,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -206,6 +206,11 @@ fi
%changelog
+* Thu Sep 14 2023 Remi Collet <remi@remirepo.net> - 3.3.5-3
+- add patch for PHP 8.3 from
+ https://github.com/laruence/yaf/pull/579
+- build out of sources tree
+
* Mon Sep 19 2022 Remi Collet <remi@remirepo.net> - 3.3.5-2
- add patch for PHP 8.2 from
https://github.com/laruence/yaf/pull/579