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