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