]> git.pld-linux.org Git - packages/php-pecl-redis.git/blob - php-redis.spec
- release 3
[packages/php-pecl-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         modname redis
8 Summary:        %{modname} A PHP extension for Redis
9 Name:           php-%{modname}
10 Version:        2.1.3
11 Release:        3
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
16 Source1:        https://github.com/ukko/phpredis-phpdoc/tarball/master/%{name}-phpdoc.tgz
17 # Source1-md5:  110fec82bf7699e7be195a2ec911f3c8
18 URL:            https://github.com/nicolasff/phpredis
19 %{?with_tests:BuildRequires:    /usr/bin/php}
20 BuildRequires:  php-devel >= 4:5.0.4
21 %{?with_tests:BuildRequires:    php-session}
22 %{?with_tests:BuildRequires:    php-simplexml}
23 BuildRequires:  rpmbuild(macros) >= 1.519
24 %{?requires_php_extension}
25 Requires:       php-session
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
35 %setup -qc -a1
36 mv nicolasff-php%{modname}-*/* .
37 mv ukko-phpredis-phpdoc-* phpdoc
38
39 %build
40 phpize
41 %configure
42 %{__make}
43
44 %if %{with tests}
45 # simple module load test
46 %{__php} -n \
47         -dextension_dir=modules \
48         -dextension=%{php_extensiondir}/simplexml.so \
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
56 %install
57 rm -rf $RPM_BUILD_ROOT
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)
81 %doc CREDITS README.markdown phpdoc
82 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
83 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.061513 seconds and 4 git commands to generate.