]> git.pld-linux.org Git - packages/php-redis.git/blob - php-redis.spec
- rel 2; just BR cli
[packages/php-redis.git] / php-redis.spec
1 # TODO
2 # - use external igbinary and make it's dependency optional
3 #
4 # Conditional build:
5 %bcond_without  tests           # build without tests
6
7 %define         php_name        php%{?php_suffix}
8 %define         modname redis
9 Summary:        %{modname} A PHP extension for Redis
10 Name:           %{php_name}-%{modname}
11 Version:        3.1.4
12 Release:        2
13 License:        PHP 3.01
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 %if %{with tests}
22 BuildRequires:  %{php_name}-pcre
23 BuildRequires:  %{php_name}-session
24 BuildRequires:  %{php_name}-simplexml
25 BuildRequires:  %{php_name}-cli
26 %endif
27 BuildRequires:  rpmbuild(macros) >= 1.519
28 %{?requires_php_extension}
29 Requires:       %{php_name}-session
30 Provides:       php(%{modname}) = %{version}
31 Obsoletes:      php-redis < 2.2.5-1
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 The phpredis extension provides an API for communicating with the
36 Redis key-value store.
37
38 This extension also provides session support.
39
40 %prep
41 %setup -qc -a1
42 mv phpredis-phpredis-*/* .
43 mv ukko-phpredis-phpdoc-* phpdoc
44
45 %build
46 phpize
47 %configure
48 %{__make}
49
50 %if %{with tests}
51 # simple module load test
52 %{__php} -n \
53         -dextension_dir=modules \
54         -dextension=%{php_extensiondir}/pcre.so \
55         -dextension=%{php_extensiondir}/spl.so \
56         -dextension=%{php_extensiondir}/simplexml.so \
57         -dextension=%{php_extensiondir}/session.so \
58         -dextension=%{modname}.so \
59         -m > modules.log
60 grep %{modname} modules.log
61 %endif
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 %{__make} install \
66         EXTENSION_DIR=%{php_extensiondir} \
67         INSTALL_ROOT=$RPM_BUILD_ROOT
68
69 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
70 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
71 ; Enable %{modname} extension module
72 extension=%{modname}.so
73 EOF
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 %post
79 %php_webserver_restart
80
81 %postun
82 if [ "$1" = 0 ]; then
83         %php_webserver_restart
84 fi
85
86 %files
87 %defattr(644,root,root,755)
88 %doc CREDITS README.markdown phpdoc
89 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
90 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.212063 seconds and 4 git commands to generate.