]> git.pld-linux.org Git - packages/php-redis.git/blobdiff - php-redis.spec
- simplexml for tests
[packages/php-redis.git] / php-redis.spec
index 9e221768bf21077501901a2222389f86da05c58a..79c4ada20fea97033ed21ed04f1d736763ad690a 100644 (file)
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
 %define                modname redis
 Summary:       %{modname} A PHP extension for Redis
 Name:          php-%{modname}
@@ -8,9 +12,13 @@ Group:                Development/Languages/PHP
 Source0:       https://github.com/nicolasff/phpredis/tarball/%{version}#/%{name}-%{version}.tgz
 # Source0-md5: eb2bee7e42f7a32a38c2a45377f21086
 URL:           https://github.com/nicolasff/phpredis
+%{?with_tests:BuildRequires:   /usr/bin/php}
 BuildRequires: php-devel >= 4:5.0.4
+%{?with_tests:BuildRequires:   php-session}
+%{?with_tests:BuildRequires:   php-simplexml}
 BuildRequires: rpmbuild(macros) >= 1.519
 %{?requires_php_extension}
+Requires:      php-session
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -28,9 +36,19 @@ phpize
 %configure
 %{__make}
 
+%if %{with tests}
+# simple module load test
+%{__php} -n \
+       -dextension_dir=modules \
+       -dextension=%{php_extensiondir}/spl.so \
+       -dextension=%{php_extensiondir}/session.so \
+       -dextension=%{modname}.so \
+       -m > modules.log
+grep %{modname} modules.log
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
-
 %{__make} install \
        EXTENSION_DIR=%{php_extensiondir} \
        INSTALL_ROOT=$RPM_BUILD_ROOT
This page took 0.055113 seconds and 5 git commands to generate.