summaryrefslogtreecommitdiffstats
path: root/php-pecl-mustache.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-06-08 12:34:50 +0200
committerRemi Collet <remi@remirepo.net>2017-06-08 12:34:50 +0200
commit7e0af6d69fbc915ce3760984fbc180fee51c7249 (patch)
tree53b3d57eaa9dfee6be3598fe15e73c5a7151dd22 /php-pecl-mustache.spec
parent3b269efd7bce0ec087c82d2a6a1b3bfeb3098b2e (diff)
new package
Diffstat (limited to 'php-pecl-mustache.spec')
-rw-r--r--php-pecl-mustache.spec37
1 files changed, 30 insertions, 7 deletions
diff --git a/php-pecl-mustache.spec b/php-pecl-mustache.spec
index 2bfc23f..30aff1b 100644
--- a/php-pecl-mustache.spec
+++ b/php-pecl-mustache.spec
@@ -12,8 +12,9 @@
%endif
%global pecl_name mustache
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global ini_name 40-%{pecl_name}.ini
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global ini_name 40-%{pecl_name}.ini
+%global with_tests 0%{!?_without_tests:1}
%global upstream_version 0.7.4
%global upstream_prever RC1
@@ -27,9 +28,11 @@ Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: %{pecl_name}-pr34.patch
+
BuildRequires: %{?scl_prefix}php-devel > 5.6
BuildRequires: %{?scl_prefix}php-pear
-#BuildRequires: mustache-devel
+BuildRequires: libmustache-devel
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -86,6 +89,7 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1
# Sanity check, really often broken
extver=$(sed -n '/PHP_MUSTACHE_VERSION/{s/.* "//;s/".*$//;p}' php_mustache.h)
@@ -108,7 +112,8 @@ EOF
%build
-%{?dtsenable}
+# can't use {?dtsenable}
+# https://github.com/jbboehr/php-mustache/issues/35
cd NTS
%{_bindir}/phpize
@@ -132,8 +137,6 @@ make %{?_smp_mflags}
%install
-%{?dtsenable}
-
make -C NTS install INSTALL_ROOT=%{buildroot}
# install config file
@@ -181,18 +184,38 @@ cd NTS
--define extension=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" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__php} -n run-tests.php --show-diff
+%endif
+
%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}
+
+%if %{with_tests}
+# Upstream test suite
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__ztsphp} -n run-tests.php --show-diff
+%endif
%endif
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
+%license NTS/LICENSE.md
+%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}