]> git.pld-linux.org Git - packages/php-redis.git/blame - php-redis.spec
Up to 4.3.0, last version with php5 support
[packages/php-redis.git] / php-redis.spec
CommitLineData
2b82b6de
ER
1# TODO
2# - use external igbinary and make it's dependency optional
b91beefc
ER
3#
4# Conditional build:
303e815d 5%bcond_without phpdoc # build phpdoc package
24c6c494 6%bcond_with tests # build without tests
b91beefc 7
303e815d
ER
8# build "phpdoc" only for 7.3 version on pld builders
9%if 0%{?_pld_builder:1} && "%{?php_suffix}" != "73"
10%undefine with_phpdoc
11%endif
12
67fa4b41 13%define php_name php%{?php_suffix}
48db7d63
ER
14%define modname redis
15Summary: %{modname} A PHP extension for Redis
67fa4b41 16Name: %{php_name}-%{modname}
4058d4d3 17Version: 4.3.0
f2c23d87 18Release: 1
48db7d63
ER
19License: PHP 3.01
20Group: Development/Languages/PHP
7345c0d0 21Source0: https://github.com/phpredis/phpredis/tarball/%{version}/%{modname}-%{version}.tar.gz
4058d4d3 22# Source0-md5: a038194807474611cf76dd727098b986
7345c0d0
ER
23Source1: https://github.com/ukko/phpredis-phpdoc/archive/9ec1795bcd45ec83a19b46cf9a8b78b4e4d7ac80/%{modname}-phpdoc.tar.gz
24# Source1-md5: eaba2e5fad040e2f4526374c073ae5f7
25URL: https://github.com/phpredis/phpredis
7345c0d0 26BuildRequires: %{php_name}-cli
24c6c494 27BuildRequires: %{php_name}-devel >= 4:5.0.4
c61b27e4
AM
28BuildRequires: %{php_name}-pcre
29BuildRequires: %{php_name}-session
30BuildRequires: %{php_name}-simplexml
a56ffbc5 31%if %{with tests}
24c6c494
ER
32BuildRequires: %{php_name}-pecl-igbinary
33BuildRequires: %{php_name}-zlib
c61b27e4 34%endif
48db7d63
ER
35BuildRequires: rpmbuild(macros) >= 1.519
36%{?requires_php_extension}
67fa4b41 37Requires: %{php_name}-session
54d79b38 38Provides: php(%{modname}) = %{version}
e15e2353 39Obsoletes: php-redis < 2.2.5-1
48db7d63
ER
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42%description
43The phpredis extension provides an API for communicating with the
44Redis key-value store.
45
46This extension also provides session support.
47
303e815d
ER
48%package -n php-redis-phpdoc
49Summary: @phpdoc extension PHP for IDE autocomplete
50Group: Documentation
51URL: https://github.com/ukko/phpredis-phpdoc
52Requires: php-dirs
53BuildArch: noarch
54
55%description -n php-redis-phpdoc
56@phpdoc extension PHP for IDE autocomplete.
57
48db7d63 58%prep
2b82b6de 59%setup -qc -a1
bc808e49 60mv phpredis-phpredis-*/* .
7345c0d0 61mv phpredis-phpdoc-* phpdoc
48db7d63
ER
62
63%build
64phpize
65%configure
66%{__make}
67
24c6c494
ER
68export TEST_PHP_EXECUTABLE="%{__php}"
69export TEST_PHP_ARGS=" -n \
b91beefc 70 -dextension_dir=modules \
fd0294ec 71 -dextension=%{php_extensiondir}/pcre.so \
b91beefc 72 -dextension=%{php_extensiondir}/spl.so \
fd0294ec 73 -dextension=%{php_extensiondir}/simplexml.so \
b91beefc
ER
74 -dextension=%{php_extensiondir}/session.so \
75 -dextension=%{modname}.so \
24c6c494
ER
76"
77
78# simple module load test
79$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS -m > modules.log
b91beefc 80grep %{modname} modules.log
b91beefc 81
24c6c494
ER
82%if %{with tests}
83TEST_PHP_ARGS="
84 $TEST_PHP_ARGS
85 -dextension=%{php_extensiondir}/zlib.so \
86"
87
88# Run tests for Redis class (note this is the default)
89$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class Redis
90
91# Run tests for RedisArray class
92tests/mkring.sh start
93$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class RedisArray
94tests/mkring.sh stop
95
96# Run tests for the RedisCluster class
97tests/make-cluster.sh start
98$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class RedisCluster
99tests/make-cluster.sh stop
100%endif
101
48db7d63
ER
102%install
103rm -rf $RPM_BUILD_ROOT
48db7d63
ER
104%{__make} install \
105 EXTENSION_DIR=%{php_extensiondir} \
106 INSTALL_ROOT=$RPM_BUILD_ROOT
107
108install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
109cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
110; Enable %{modname} extension module
111extension=%{modname}.so
112EOF
113
303e815d
ER
114install -d $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
115cp -a phpdoc/src/*.php $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version}
7345c0d0 116
48db7d63
ER
117%clean
118rm -rf $RPM_BUILD_ROOT
119
120%post
121%php_webserver_restart
122
123%postun
124if [ "$1" = 0 ]; then
125 %php_webserver_restart
126fi
127
128%files
129%defattr(644,root,root,755)
7345c0d0 130%doc CREDITS README.markdown
48db7d63
ER
131%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
132%attr(755,root,root) %{php_extensiondir}/%{modname}.so
303e815d
ER
133
134%if %{with phpdoc}
135%files -n php-redis-phpdoc
136%defattr(644,root,root,755)
137%{_examplesdir}/php-%{modname}-%{version}
138%endif
This page took 0.088518 seconds and 5 git commands to generate.