- Add PECL Redis with version 5.3.2
[packages/php-pecl-redis.git] / php-pecl-redis.spec
1 %define         php_name        php%{?php_suffix}
2 %define         modname redis
3 Summary:        %{modname} - PHP extension for interfacing with Redis
4 Name:           %{php_name}-pecl-%{modname}
5 Version:        5.3.2
6 Release:        1
7 License:        PHP
8 Group:          Development/Languages/PHP
9 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
10 # Source0-md5:  6d3a7048ab73b0fab931f28c484dbf76
11 URL:            https://pecl.php.net/package/redis
12 BuildRequires:  %{php_name}-devel >= 4:7.2
13 BuildRequires:  rpmbuild(macros) >= 1.747-3
14 Provides:       php(redis)
15 %{?requires_php_extension}
16 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17
18 %description
19 This extension provides an API for communicating with Redis servers.
20
21 %prep
22 %setup -qc
23 mv %{modname}-%{version}/* .
24
25 %build
26 phpize
27 %configure
28 %{__make}
29
30 %install
31 rm -rf $RPM_BUILD_ROOT
32 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
33
34 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
35 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
36 ; Enable %{modname} extension module
37 extension=%{modname}.so
38 EOF
39
40 %clean
41 rm -rf $RPM_BUILD_ROOT
42
43 %post
44 %php_webserver_restart
45
46 %postun
47 if [ "$1" = 0 ]; then
48     %php_webserver_restart
49 fi
50
51 %files
52 %defattr(644,root,root,755)
53 %doc CREDITS
54 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
55 %attr(755,root,root) %{php_extensiondir}/%{modname}.so