]>
Commit | Line | Data |
---|---|---|
2b82b6de ER |
1 | # TODO |
2 | # - use external igbinary and make it's dependency optional | |
b91beefc ER |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without tests # build without tests | |
6 | ||
67fa4b41 | 7 | %define php_name php%{?php_suffix} |
48db7d63 ER |
8 | %define modname redis |
9 | Summary: %{modname} A PHP extension for Redis | |
67fa4b41 | 10 | Name: %{php_name}-%{modname} |
d3d2f6ca | 11 | Version: 2.2.5 |
fd0294ec | 12 | Release: 4 |
48db7d63 ER |
13 | License: PHP 3.01 |
14 | Group: Development/Languages/PHP | |
d3d2f6ca ER |
15 | Source0: https://github.com/nicolasff/phpredis/tarball/%{version}/%{modname}-%{version}.tar.gz |
16 | # Source0-md5: 0e82aed77f2c23a9072b277ecdef6dba | |
12140a38 ER |
17 | Source1: https://github.com/ukko/phpredis-phpdoc/tarball/master/%{modname}-phpdoc.tar.gz |
18 | # Source1-md5: 9667e1b2976826915044e3a642847625 | |
48db7d63 | 19 | URL: https://github.com/nicolasff/phpredis |
67fa4b41 | 20 | BuildRequires: %{php_name}-devel >= 4:5.0.4 |
fd0294ec | 21 | %{?with_tests:BuildRequires: %{php_name}-pcre} |
67fa4b41 ER |
22 | %{?with_tests:BuildRequires: %{php_name}-session} |
23 | %{?with_tests:BuildRequires: %{php_name}-simplexml} | |
e15e2353 | 24 | %{?with_tests:BuildRequires: /usr/bin/php} |
48db7d63 ER |
25 | BuildRequires: rpmbuild(macros) >= 1.519 |
26 | %{?requires_php_extension} | |
67fa4b41 | 27 | Requires: %{php_name}-session |
54d79b38 | 28 | Provides: php(%{modname}) = %{version} |
e15e2353 | 29 | Obsoletes: php-redis < 2.2.5-1 |
48db7d63 ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | The phpredis extension provides an API for communicating with the | |
34 | Redis key-value store. | |
35 | ||
36 | This extension also provides session support. | |
37 | ||
38 | %prep | |
2b82b6de ER |
39 | %setup -qc -a1 |
40 | mv nicolasff-php%{modname}-*/* . | |
41 | mv ukko-phpredis-phpdoc-* phpdoc | |
48db7d63 ER |
42 | |
43 | %build | |
44 | phpize | |
45 | %configure | |
46 | %{__make} | |
47 | ||
b91beefc ER |
48 | %if %{with tests} |
49 | # simple module load test | |
50 | %{__php} -n \ | |
51 | -dextension_dir=modules \ | |
fd0294ec | 52 | -dextension=%{php_extensiondir}/pcre.so \ |
b91beefc | 53 | -dextension=%{php_extensiondir}/spl.so \ |
fd0294ec | 54 | -dextension=%{php_extensiondir}/simplexml.so \ |
b91beefc ER |
55 | -dextension=%{php_extensiondir}/session.so \ |
56 | -dextension=%{modname}.so \ | |
57 | -m > modules.log | |
58 | grep %{modname} modules.log | |
59 | %endif | |
60 | ||
48db7d63 ER |
61 | %install |
62 | rm -rf $RPM_BUILD_ROOT | |
48db7d63 ER |
63 | %{__make} install \ |
64 | EXTENSION_DIR=%{php_extensiondir} \ | |
65 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
66 | ||
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 | |
71 | EOF | |
72 | ||
73 | %clean | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | ||
76 | %post | |
77 | %php_webserver_restart | |
78 | ||
79 | %postun | |
80 | if [ "$1" = 0 ]; then | |
81 | %php_webserver_restart | |
82 | fi | |
83 | ||
84 | %files | |
85 | %defattr(644,root,root,755) | |
2b82b6de | 86 | %doc CREDITS README.markdown phpdoc |
48db7d63 ER |
87 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini |
88 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |