X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=php-redis.spec;h=d8bb5a6ee91a0ff28c32196524763b4c45382c3f;hb=4058d4d35cb328991d987a8e4af727f12d44a28b;hp=b728b5a65b0a6c1938936833f72dd89d259c011f;hpb=67fa4b41ce8ac27d7fa924c5ea67cb43ff98fcae;p=packages%2Fphp-redis.git diff --git a/php-redis.spec b/php-redis.spec index b728b5a..d8bb5a6 100644 --- a/php-redis.spec +++ b/php-redis.spec @@ -2,28 +2,41 @@ # - use external igbinary and make it's dependency optional # # Conditional build: -%bcond_without tests # build without tests +%bcond_without phpdoc # build phpdoc package +%bcond_with tests # build without tests + +# build "phpdoc" only for 7.3 version on pld builders +%if 0%{?_pld_builder:1} && "%{?php_suffix}" != "73" +%undefine with_phpdoc +%endif %define php_name php%{?php_suffix} %define modname redis Summary: %{modname} A PHP extension for Redis Name: %{php_name}-%{modname} -Version: 2.1.3 -Release: 3 +Version: 4.3.0 +Release: 1 License: PHP 3.01 Group: Development/Languages/PHP -Source0: https://github.com/nicolasff/phpredis/tarball/%{version}#/%{modname}-%{version}.tgz -# Source0-md5: eb2bee7e42f7a32a38c2a45377f21086 -Source1: https://github.com/ukko/phpredis-phpdoc/tarball/master/%{modname}-phpdoc.tgz -# Source1-md5: b7cce5ee29c6597e0fdd3557397e1b2a -URL: https://github.com/nicolasff/phpredis -%{?with_tests:BuildRequires: /usr/bin/php} +Source0: https://github.com/phpredis/phpredis/tarball/%{version}/%{modname}-%{version}.tar.gz +# Source0-md5: a038194807474611cf76dd727098b986 +Source1: https://github.com/ukko/phpredis-phpdoc/archive/9ec1795bcd45ec83a19b46cf9a8b78b4e4d7ac80/%{modname}-phpdoc.tar.gz +# Source1-md5: eaba2e5fad040e2f4526374c073ae5f7 +URL: https://github.com/phpredis/phpredis +BuildRequires: %{php_name}-cli BuildRequires: %{php_name}-devel >= 4:5.0.4 -%{?with_tests:BuildRequires: %{php_name}-session} -%{?with_tests:BuildRequires: %{php_name}-simplexml} +BuildRequires: %{php_name}-pcre +BuildRequires: %{php_name}-session +BuildRequires: %{php_name}-simplexml +%if %{with tests} +BuildRequires: %{php_name}-pecl-igbinary +BuildRequires: %{php_name}-zlib +%endif BuildRequires: rpmbuild(macros) >= 1.519 %{?requires_php_extension} Requires: %{php_name}-session +Provides: php(%{modname}) = %{version} +Obsoletes: php-redis < 2.2.5-1 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -32,26 +45,58 @@ Redis key-value store. This extension also provides session support. +%package -n php-redis-phpdoc +Summary: @phpdoc extension PHP for IDE autocomplete +Group: Documentation +URL: https://github.com/ukko/phpredis-phpdoc +Requires: php-dirs +BuildArch: noarch + +%description -n php-redis-phpdoc +@phpdoc extension PHP for IDE autocomplete. + %prep %setup -qc -a1 -mv nicolasff-php%{modname}-*/* . -mv ukko-phpredis-phpdoc-* phpdoc +mv phpredis-phpredis-*/* . +mv phpredis-phpdoc-* phpdoc %build phpize %configure %{__make} -%if %{with tests} -# simple module load test -%{__php} -n \ +export TEST_PHP_EXECUTABLE="%{__php}" +export TEST_PHP_ARGS=" -n \ -dextension_dir=modules \ - -dextension=%{php_extensiondir}/simplexml.so \ + -dextension=%{php_extensiondir}/pcre.so \ -dextension=%{php_extensiondir}/spl.so \ + -dextension=%{php_extensiondir}/simplexml.so \ -dextension=%{php_extensiondir}/session.so \ -dextension=%{modname}.so \ - -m > modules.log +" + +# simple module load test +$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS -m > modules.log grep %{modname} modules.log + +%if %{with tests} +TEST_PHP_ARGS=" + $TEST_PHP_ARGS + -dextension=%{php_extensiondir}/zlib.so \ +" + +# Run tests for Redis class (note this is the default) +$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class Redis + +# Run tests for RedisArray class +tests/mkring.sh start +$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class RedisArray +tests/mkring.sh stop + +# Run tests for the RedisCluster class +tests/make-cluster.sh start +$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS tests/TestRedis.php --class RedisCluster +tests/make-cluster.sh stop %endif %install @@ -66,6 +111,9 @@ cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini extension=%{modname}.so EOF +install -d $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version} +cp -a phpdoc/src/*.php $RPM_BUILD_ROOT%{_examplesdir}/php-%{modname}-%{version} + %clean rm -rf $RPM_BUILD_ROOT @@ -79,6 +127,12 @@ fi %files %defattr(644,root,root,755) -%doc CREDITS README.markdown phpdoc +%doc CREDITS README.markdown %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini %attr(755,root,root) %{php_extensiondir}/%{modname}.so + +%if %{with phpdoc} +%files -n php-redis-phpdoc +%defattr(644,root,root,755) +%{_examplesdir}/php-%{modname}-%{version} +%endif