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}.tar.gz
16 # Source0-md5: c5ba8b560b5766d5318d25ea65ca929f
17 Source1: https://github.com/ukko/phpredis-phpdoc/tarball/master/%{modname}-phpdoc.tar.gz
18 # Source1-md5: eb4163a1c5eaaa41beccfba9be0a9878
19 URL: https://github.com/nicolasff/phpredis
20 BuildRequires: %{php_name}-devel >= 4:5.0.4
21 %{?with_tests:BuildRequires: %{php_name}-pcre}
22 %{?with_tests:BuildRequires: %{php_name}-session}
23 %{?with_tests:BuildRequires: %{php_name}-simplexml}
24 %{?with_tests:BuildRequires: %{__php}}
25 BuildRequires: rpmbuild(macros) >= 1.519
26 %{?requires_php_extension}
27 Requires: %{php_name}-session
28 Provides: php(%{modname}) = %{version}
29 Obsoletes: php-redis < 2.2.5-1
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 The phpredis extension provides an API for communicating with the
34 Redis key-value store.
36 This extension also provides session support.
40 mv phpredis-phpredis-*/* .
41 mv ukko-phpredis-phpdoc-* phpdoc
49 # simple module load test
51 -dextension_dir=modules \
52 -dextension=%{php_extensiondir}/pcre.so \
53 -dextension=%{php_extensiondir}/spl.so \
54 -dextension=%{php_extensiondir}/simplexml.so \
55 -dextension=%{php_extensiondir}/session.so \
56 -dextension=%{modname}.so \
58 grep %{modname} modules.log
62 rm -rf $RPM_BUILD_ROOT
64 EXTENSION_DIR=%{php_extensiondir} \
65 INSTALL_ROOT=$RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
68 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
69 ; Enable %{modname} extension module
70 extension=%{modname}.so
74 rm -rf $RPM_BUILD_ROOT
77 %php_webserver_restart
81 %php_webserver_restart
85 %defattr(644,root,root,755)
86 %doc CREDITS README.markdown phpdoc
87 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
88 %attr(755,root,root) %{php_extensiondir}/%{modname}.so