summaryrefslogtreecommitdiffstats
path: root/php-pecl-mustache.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-mustache.spec')
-rw-r--r--php-pecl-mustache.spec64
1 files changed, 33 insertions, 31 deletions
diff --git a/php-pecl-mustache.spec b/php-pecl-mustache.spec
index fe55d35..5dea509 100644
--- a/php-pecl-mustache.spec
+++ b/php-pecl-mustache.spec
@@ -1,31 +1,31 @@
# remirepo spec file for php-pecl-mustache
#
-# Copyright (c) 2017-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2017-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-mustache
-%endif
-%bcond_without tests
+%{?scl:%scl_package php-pecl-mustache}
-%global pecl_name mustache
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global ini_name 40-%{pecl_name}.ini
+%bcond_without tests
+%global pecl_name mustache
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global ini_name 40-%{pecl_name}.ini
%global upstream_version 0.9.3
#global upstream_prever RC2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Mustache templating language
Name: %{?scl_prefix}php-pecl-%{pecl_name}
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/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -40,7 +40,6 @@ BuildRequires: gcc-c++
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}
@@ -57,14 +56,13 @@ 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/register tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/PHP_MUSTACHE_VERSION/{s/.* "//;s/".*$//;p}' php_mustache.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -73,9 +71,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -91,22 +89,23 @@ source /opt/rh/devtoolset-6/enable
g++ --version
%endif
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-mustache \
--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 \
--enable-mustache \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -133,7 +132,7 @@ 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
@@ -158,17 +157,18 @@ fi
%check
+cd %{sources}
+
: Minimal load test for NTS extension
-cd NTS
%{__php} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --define extension=../NTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
# Upstream test suite
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php --show-diff
@@ -176,15 +176,14 @@ REPORT_EXIT_STATUS=1 \
%if %{with_zts}
: Minimal load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --define extension=../ZTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
%if %{with tests}
# Upstream test suite
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php --show-diff
@@ -194,7 +193,7 @@ REPORT_EXIT_STATUS=1 \
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE.md
+%license %{sources}/LICENSE.md
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -208,6 +207,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 0.9.3-2
+- build out of sources tree
+
* Mon Nov 28 2022 Remi Collet <remi@remirepo.net> - 0.9.3-1
- update to 0.9.3
- drop patch merged upstream