2 # - use external igbinary and make it's dependency optional
5 %bcond_without tests # build without tests
7 %define php_name php%{?php_suffix}
9 Summary: %{modname} A PHP extension for Redis
10 Name: %{php_name}-%{modname}
14 Group: Development/Languages/PHP
15 Source0: https://github.com/nicolasff/phpredis/tarball/%{version}#/%{modname}-%{version}.tgz
16 # Source0-md5: eb2bee7e42f7a32a38c2a45377f21086
17 Source1: https://github.com/ukko/phpredis-phpdoc/tarball/master/%{modname}-phpdoc.tgz
18 # Source1-md5: b7cce5ee29c6597e0fdd3557397e1b2a
19 URL: https://github.com/nicolasff/phpredis
20 %{?with_tests:BuildRequires: /usr/bin/php}
21 BuildRequires: %{php_name}-devel >= 4:5.0.4
22 %{?with_tests:BuildRequires: %{php_name}-session}
23 %{?with_tests:BuildRequires: %{php_name}-simplexml}
24 BuildRequires: rpmbuild(macros) >= 1.519
25 %{?requires_php_extension}
26 Requires: %{php_name}-session
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 The phpredis extension provides an API for communicating with the
31 Redis key-value store.
33 This extension also provides session support.
37 mv nicolasff-php%{modname}-*/* .
38 mv ukko-phpredis-phpdoc-* phpdoc
46 # simple module load test
48 -dextension_dir=modules \
49 -dextension=%{php_extensiondir}/simplexml.so \
50 -dextension=%{php_extensiondir}/spl.so \
51 -dextension=%{php_extensiondir}/session.so \
52 -dextension=%{modname}.so \
54 grep %{modname} modules.log
58 rm -rf $RPM_BUILD_ROOT
60 EXTENSION_DIR=%{php_extensiondir} \
61 INSTALL_ROOT=$RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
64 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
65 ; Enable %{modname} extension module
66 extension=%{modname}.so
70 rm -rf $RPM_BUILD_ROOT
73 %php_webserver_restart
77 %php_webserver_restart
81 %defattr(644,root,root,755)
82 %doc CREDITS README.markdown phpdoc
83 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
84 %attr(755,root,root) %{php_extensiondir}/%{modname}.so