]> git.pld-linux.org Git - packages/php-redis.git/blob - php-redis.spec
79c4ada20fea97033ed21ed04f1d736763ad690a
[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 %{?with_tests:BuildRequires:    php-simplexml}
19 BuildRequires:  rpmbuild(macros) >= 1.519
20 %{?requires_php_extension}
21 Requires:       php-session
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 The phpredis extension provides an API for communicating with the
26 Redis key-value store.
27
28 This extension also provides session support.
29
30 %prep
31 %setup -qc
32 mv *-php%{modname}-*/* .
33
34 %build
35 phpize
36 %configure
37 %{__make}
38
39 %if %{with tests}
40 # simple module load test
41 %{__php} -n \
42         -dextension_dir=modules \
43         -dextension=%{php_extensiondir}/spl.so \
44         -dextension=%{php_extensiondir}/session.so \
45         -dextension=%{modname}.so \
46         -m > modules.log
47 grep %{modname} modules.log
48 %endif
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 %{__make} install \
53         EXTENSION_DIR=%{php_extensiondir} \
54         INSTALL_ROOT=$RPM_BUILD_ROOT
55
56 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
57 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
58 ; Enable %{modname} extension module
59 extension=%{modname}.so
60 EOF
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 %post
66 %php_webserver_restart
67
68 %postun
69 if [ "$1" = 0 ]; then
70         %php_webserver_restart
71 fi
72
73 %files
74 %defattr(644,root,root,755)
75 %doc CREDITS README.markdown
76 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
77 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.068402 seconds and 4 git commands to generate.