summaryrefslogtreecommitdiffstats
path: root/php-pecl-yaml.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-yaml.spec')
-rw-r--r--php-pecl-yaml.spec39
1 files changed, 22 insertions, 17 deletions
diff --git a/php-pecl-yaml.spec b/php-pecl-yaml.spec
index 93b9e89..19034c3 100644
--- a/php-pecl-yaml.spec
+++ b/php-pecl-yaml.spec
@@ -21,11 +21,13 @@
%global upstream_version 2.2.3
#global upstream_prever b2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: PHP Bindings for yaml
Name: %{?scl_prefix}php-pecl-yaml
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
URL: https://pecl.php.net/package/yaml
@@ -73,14 +75,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -c -q
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Remove test file to avoid regsitration
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
+cd %{sources}
# Check upstream version (often broken)
extver=$(sed -n '/#define PHP_YAML_VERSION/{s/.* "//;s/".*$//;p}' php_yaml.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -116,25 +117,26 @@ extension=%{pecl_name}.so
;yaml.decode_php = 0
EOF
-cp -pr NTS ZTS
+mkdir NTS ZTS
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -156,36 +158,36 @@ install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-cd NTS
+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 NTS
+cd %{sources}
+
: Minimal load test for NTS extension
%{__php} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=$PWD/../NTS/modules/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite for NTS extension
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q -P --show-diff
%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=$PWD/../ZTS/modules/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with tests}
: Upstream test suite for ZTS extension
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php -q -P --show-diff
%endif
@@ -213,7 +215,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -227,6 +229,9 @@ fi
%changelog
+* Tue Jul 18 2023 Remi Collet <remi@remirepo.net> - 2.2.3-2
+- build out of sources tree
+
* Mon Mar 6 2023 Remi Collet <remi@remirepo.net> - 2.2.3-1
- update to 2.2.3
- drop patch merged upstream