]> git.pld-linux.org Git - packages/php-pecl-solr.git/commitdiff
up to 2.1.0.
authorElan Ruusamäe <glen@delfi.ee>
Thu, 14 May 2015 13:06:51 +0000 (16:06 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 14 May 2015 13:07:38 +0000 (16:07 +0300)
Notice: PECL Solr 2.x is not compatible with Apache Solr Server 3.x

do-not-screw-with-random-seed.patch [deleted file]
php-pecl-solr.spec

diff --git a/do-not-screw-with-random-seed.patch b/do-not-screw-with-random-seed.patch
deleted file mode 100644 (file)
index 0b387dd..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-DO NOT SCREW WITH RANDOM SEED
-
-Do not initialize the seed with srand or mt_srand, it is already initialized
-since PHP 4.2.0 (See the docs). And if you initialize it with time or microtime
-you make it only more worse (predictable).
-
-And initializing random seed with predictable value is extremely stupid.
-
-I had situation that three machines simulatenously produced temporary directory
-names based on random generator, and they all got same results, this is utterly
-screwed up up the application!
-
-Jul  6 10:37:26 segusilm php.fcgi: PHP Fatal error:  Uncaught exception 'Exception' with message 'Can't mkdir '/tmp/foo_UZNHCMUDWZ/archive': mkdir(): File exists' in /usr/share/foo/lib/plugins/Plugin.php:127
-Jul  6 10:37:26 lordi php.fcgi: PHP Warning:  unlink(/tmp/foo_UZNHCMUDWZ/archive/title.inc): No such file or directory in /usr/share/foo/lib/helper/OutputHelper.php on line 68
-
-it is strongly recommended for PHP application developers to keep their fingers
-away from srand() or mt_srand() and to never ever use rand() or mt_rand() for
-cryptographic secrets:
-http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/
-
-Bugreport: https://bugs.php.net/bug.php?id=62835
-Source: http://cvs.pld-linux.org/packages/php-pecl-solr/do-not-screw-with-random-seed.patch
-Signed-Off-By: Elan Ruusamäe <glen@pld-linux.org>
-Tested-By: Elan Ruusamäe <glen@delfi.ee>
---- php-pecl-solr-1.0.2/php_solr.c~    2011-11-29 04:50:07.000000000 +0200
-+++ php-pecl-solr-1.0.2/php_solr.c     2012-07-06 18:15:25.730180032 +0300
-@@ -1082,9 +1082,6 @@
-       /* Always NULL. Kept for API backward compatibility purposes only */
-       hash_func_t pHashFunction    = NULL;
--      /* initialize random seed */
--      srand(time(NULL));
--
-       ALLOC_HASHTABLE(SOLR_GLOBAL(documents));
-       ALLOC_HASHTABLE(SOLR_GLOBAL(clients));
-       ALLOC_HASHTABLE(SOLR_GLOBAL(params));
index fd95afd399c25015a51b478b055d213eb4c7eaf5..1353f3fe8c0f9c05bb3f1c4e6d9259c182aaee2c 100644 (file)
@@ -7,13 +7,12 @@
 Summary:       Object oriented API to Apache Solr
 Summary(fr.UTF-8):     API orientée objet pour Apache Solr
 Name:          %{php_name}-pecl-solr
-Version:       1.0.2
-Release:       7
-License:       PHP
+Version:       2.1.0
+Release:       1
+License:       PHP v3.01
 Group:         Development/Languages
 Source0:       http://pecl.php.net/get/%{modname}-%{version}.tgz
-# Source0-md5: 1632144b462ab22b91d03e4d59704fab
-Patch0:                do-not-screw-with-random-seed.patch
+# Source0-md5: 258865d4517312afda6890827f18f93f
 URL:           http://pecl.php.net/package/solr
 BuildRequires: %{php_name}-cli
 %{?with_tests:BuildRequires:   %{php_name}-curl}
@@ -49,6 +48,8 @@ for connecting to Solr servers secured behind HTTP Authentication or
 HTTP proxy servers. It is also able to connect to SSL-enabled
 containers.
 
+Notice: PECL Solr 2.x is not compatible with Apache Solr Server 3.x
+
 %description -l fr.UTF-8
 Bibliothèque riche en fonctionnalités qui permet aux développeurs PHP
 de communiquer facilement et efficacement avec des instances du
@@ -70,22 +71,14 @@ authentification HTTP ou par un serveur mandataire. Il est également
 possible de se connecter à des serveurs via SSL.
 
 %prep
-%setup -q -c
+%setup -qc
 mv %{modname}-%{version}/* .
 
-# avoid 1970 dates in doc
-find -newer TODO -o -print | xargs touch --reference %{SOURCE0}
-
-%patch0 -p1
-
-# Fix version
-sed -i -e '/PHP_SOLR_DOTTED_VERSION/s/1.0.1/1.0.2/' php_solr_version.h
-
 %build
 packagexml2cl package.xml > ChangeLog
 
 # Check version
-extver=$(sed -n '/#define PHP_SOLR_DOTTED_VERSION/{s/.* "//;s/".*$//;p}' php_solr_version.h)
+extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' php_solr_version.h)
 if test "x${extver}" != "x%{version}"; then
        : Error: Upstream version is ${extver}, expecting %{version}.
        exit 1
@@ -112,6 +105,7 @@ install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
 %{__make} install \
        EXTENSION_DIR=%{php_extensiondir} \
        INSTALL_ROOT=$RPM_BUILD_ROOT
+
 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
 ; Enable Solr extension module
 extension=%{modname}.so
This page took 0.076662 seconds and 4 git commands to generate.