From: Elan Ruusamäe Date: Wed, 23 Nov 2016 01:47:05 +0000 (+0200) Subject: simple module load test X-Git-Tag: auto/th/php-pecl-memcache-3.0.9-1~9 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=8dfd8797a4a6e5598f5a51bfa875ea63f5e6a40e;p=packages%2Fphp-pecl-memcache.git simple module load test --- diff --git a/php-pecl-memcache.spec b/php-pecl-memcache.spec index 3df2f04..06f542c 100644 --- a/php-pecl-memcache.spec +++ b/php-pecl-memcache.spec @@ -1,3 +1,7 @@ +# +# Conditional build: +%bcond_without tests # build without tests + %define php_name php%{?php_suffix} %define modname memcache %define php_min_version 5.0.0 @@ -23,6 +27,10 @@ BuildRequires: %{php_name}-xml BuildRequires: php-packagexml2cl BuildRequires: rpm-php-pearprov >= 4.4.2-11 BuildRequires: rpmbuild(macros) >= 1.650 +%if %{with tests} +BuildRequires: %{php_name}-cli +BuildRequires: %{php_name}-session +%endif %{?requires_php_extension} Requires: %{php_name}-session Requires: %{php_name}-zlib @@ -87,6 +95,16 @@ phpize --with-zlib-dir=/usr %{__make} +%if %{with tests} +# simple module load test +%{__php} -n -q \ + -d extension_dir=modules \ + -d extension=%{php_extensiondir}/session.so \ + -d extension=%{modname}.so \ + -m > modules.log +grep %{modname} modules.log +%endif + %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}