summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CREDITS2
-rw-r--r--Judy-svn.patch155
-rw-r--r--LICENSE68
-rw-r--r--README210
-rw-r--r--php-pecl-judy.spec52
5 files changed, 30 insertions, 457 deletions
diff --git a/CREDITS b/CREDITS
deleted file mode 100644
index dd9d6cb..0000000
--- a/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-judy
-Nicolas Brousse
diff --git a/Judy-svn.patch b/Judy-svn.patch
deleted file mode 100644
index cc675a8..0000000
--- a/Judy-svn.patch
+++ /dev/null
@@ -1,155 +0,0 @@
---- pecl/judy/trunk/php_judy.c 2013/10/09 14:43:09 331752
-+++ pecl/judy/trunk/php_judy.c 2013/10/09 15:09:50 331753
-@@ -144,7 +144,7 @@
- long index = 0;
- Word_t j_index;
- Pvoid_t *PValue = NULL;
-- zval *result;
-+ zval *result = NULL;
- zval string_key, *pstring_key = &string_key;
- judy_object *intern = (judy_object *) zend_object_store_get_object(object TSRMLS_CC);
-
-@@ -603,7 +603,7 @@
- } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == SUCCESS) {
- JTYPE(jtype, type);
- intern->counter = 0;
-- intern->type = type;
-+ intern->type = jtype;
- intern->array = (Pvoid_t) NULL;
- }
-
-@@ -615,7 +615,7 @@
- Free Judy array and any other references */
- PHP_METHOD(judy, __destruct)
- {
-- JUDY_METHOD_GET_OBJECT
-+ zval *object = getThis();
-
- /* calling the object's free() method */
- zend_call_method_with_0_params(&object, NULL, NULL, "free", NULL);
-@@ -628,7 +628,7 @@
- {
- JUDY_METHOD_GET_OBJECT
-
-- Word_t Rc_word;
-+ Word_t Rc_word = 0;
- Word_t index;
- uint8_t kindex[PHP_JUDY_MAX_LENGTH];
- Word_t *PValue;
-@@ -1019,7 +1019,7 @@
- PHP_METHOD(judy, firstEmpty)
- {
- Word_t index = 0;
-- int Rc_int;
-+ int Rc_int = 0;
-
- JUDY_METHOD_GET_OBJECT
-
-@@ -1051,7 +1051,7 @@
- PHP_METHOD(judy, lastEmpty)
- {
- Word_t index = -1;
-- int Rc_int;
-+ int Rc_int = 0;
-
- JUDY_METHOD_GET_OBJECT
-
-@@ -1083,7 +1083,7 @@
- PHP_METHOD(judy, nextEmpty)
- {
- Word_t index;
-- int Rc_int;
-+ int Rc_int = 0;
-
- JUDY_METHOD_GET_OBJECT
-
-@@ -1115,7 +1115,7 @@
- PHP_METHOD(judy, prevEmpty)
- {
- Word_t index;
-- int Rc_int;
-+ int Rc_int = 0;
-
- JUDY_METHOD_GET_OBJECT
-
---- pecl/judy/trunk/judy_iterator.c 2013/10/09 15:20:22 331754
-+++ pecl/judy/trunk/judy_iterator.c 2013/10/09 17:14:16 331755
-@@ -151,6 +151,14 @@
-
- /* {{{ judy_iterator_current_key
- */
-+#if ZEND_MODULE_API_NO >= 20121212
-+void judy_iterator_current_key(zend_object_iterator *iterator, zval *key TSRMLS_DC)
-+{
-+ judy_iterator *it = (judy_iterator*) iterator;
-+
-+ ZVAL_ZVAL(key, it->key, 1, 0);
-+
-+#else
- int judy_iterator_current_key(zend_object_iterator *iterator,
- char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
- {
-@@ -171,6 +179,7 @@
- *str_key_len = Z_STRLEN_P(it->key)+1;
-
- return HASH_KEY_IS_STRING;
-+#endif
- }
- /* }}} */
-
---- pecl/judy/trunk/judy_iterator.h 2013/10/09 15:20:22 331754
-+++ pecl/judy/trunk/judy_iterator.h 2013/10/09 17:14:16 331755
-@@ -43,8 +43,12 @@
- void judy_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC);
- int judy_iterator_valid(zend_object_iterator *iterator TSRMLS_DC);
- void judy_iterator_current_data(zend_object_iterator *iterator, zval ***data TSRMLS_DC);
-+#if ZEND_MODULE_API_NO >= 20121212
-+void judy_iterator_current_key(zend_object_iterator *iterator, zval *key TSRMLS_DC);
-+#else
- int judy_iterator_current_key(zend_object_iterator *iterator,
- char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
-+#endif
- void judy_iterator_move_forward(zend_object_iterator *iterator TSRMLS_DC);
- void judy_iterator_rewind(zend_object_iterator *iterator TSRMLS_DC);
- /* }}} */
---- pecl/judy/trunk/php_judy.c 2013/10/09 19:10:22 331757
-+++ pecl/judy/trunk/php_judy.c 2013/10/10 02:24:32 331758
-@@ -94,7 +94,7 @@
- }
- /* }}} */
-
--PHPAPI zend_class_entry *php_judy_ce(void)
-+PHP_JUDY_API zend_class_entry *php_judy_ce(void)
- {
- return judy_ce;
- }
---- pecl/judy/trunk/php_judy.h 2013/10/10 02:24:40 331759
-+++ pecl/judy/trunk/php_judy.h 2013/10/10 04:38:41 331760
-@@ -19,7 +19,7 @@
- #ifndef PHP_JUDY_H
- #define PHP_JUDY_H
-
--#define PHP_JUDY_VERSION "0.1.6"
-+#define PHP_JUDY_VERSION "1.0.0"
- #define PHP_JUDY_EXTNAME "judy"
-
- #include <Judy.h>
---- pecl/judy/trunk/tests/001.phpt 2013/10/10 02:24:40 331759
-+++ pecl/judy/trunk/tests/001.phpt 2013/10/10 04:38:41 331760
-@@ -20,4 +20,4 @@
- ?>
- --EXPECT--
- judy extension is available
--PHP Judy Version: 0.1.6
-+PHP Judy Version: 1.0.0
---- pecl/judy/trunk/tests/github_issue2_003.phpt 2013/10/10 04:38:41 331760
-+++ pecl/judy/trunk/tests/github_issue2_003.phpt 2013/10/10 04:43:24 331761
-@@ -2,6 +2,8 @@
- Check for Judy ITERATOR using foreach() and INT_TO_MIXED
- --SKIPIF--
- <?php if (!extension_loaded("judy")) print "skip"; ?>
-+--INI--
-+date.timezone=UTC
- --FILE--
- <?php
- /*
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 3cc8b77..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,68 +0,0 @@
---------------------------------------------------------------------
- The PHP License, version 3.01
-Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
---------------------------------------------------------------------
-
-Redistribution and use in source and binary forms, with or without
-modification, is permitted provided that the following conditions
-are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- 3. The name "PHP" must not be used to endorse or promote products
- derived from this software without prior written permission. For
- written permission, please contact group@php.net.
-
- 4. Products derived from this software may not be called "PHP", nor
- may "PHP" appear in their name, without prior written permission
- from group@php.net. You may indicate that your software works in
- conjunction with PHP by saying "Foo for PHP" instead of calling
- it "PHP Foo" or "phpfoo"
-
- 5. The PHP Group may publish revised and/or new versions of the
- license from time to time. Each version will be given a
- distinguishing version number.
- Once covered code has been published under a particular version
- of the license, you may always continue to use it under the terms
- of that version. You may also choose to use such covered code
- under the terms of any subsequent version of the license
- published by the PHP Group. No one other than the PHP Group has
- the right to modify the terms applicable to covered code created
- under this License.
-
- 6. Redistributions of any form whatsoever must retain the following
- acknowledgment:
- "This product includes PHP software, freely available from
- <http://www.php.net/software/>".
-
-THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
-ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
-DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
---------------------------------------------------------------------
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the PHP Group.
-
-The PHP Group can be contacted via Email at group@php.net.
-
-For more information on the PHP Group and the PHP project,
-please see <http://www.php.net>.
-
-PHP includes the Zend Engine, freely available at
-<http://www.zend.com>.
diff --git a/README b/README
deleted file mode 100644
index 99b0f82..0000000
--- a/README
+++ /dev/null
@@ -1,210 +0,0 @@
- PHP Judy - extension creating and accessing dynamic arrays
- ================================================================
-
-Content
----------
- 1. Introduction
- 2. Directory Contents
- 3. How to install
- 4. Usage (Examples)
- 5. Reporting Bugs
- 6. Todo
-
-
-1. INTRODUCTION
------------------
-
-php-judy is an extension by Nicolas Brousse for the Judy C library.
- -> http://pecl.php.net/package/Judy
- -> http://github.com/orieg/php-judy
-
-(see Section 4 of this document for PHP examples)
-
-A Judy array is a complex but very fast associative array data structure for
-storing and looking up values using integer or string keys. Unlike normal
-arrays, Judy arrays may be sparse; that is, they may have large ranges of
-unassigned indices.
-
- -> http://en.wikipedia.org/wiki/Judy_array
-
-The PHP extension is base on the Judy C library that implements a dynamic array.
-A Judy array consumes memory only when populated yet can grow to take advantage
-of all available memory. Judy's key benefits are: scalability, performance,
-memory efficiency, and ease of use. Judy arrays are designed to grow without
-tuning into the peta-element range, scaling near O(log-base-256) -- 1 more RAM
-access at 256 X population.
-
- -> http://judy.sourceforge.net
-
-2. PHP JUDY TOP DIRECTORY CONTENTS:
-------------------------------------
-
-README This file.
-LICENSE The PHP License used by this project.
-EXPERIMENTAL Note about the status of this package.
-
-lib/ Header and source libraries used by the package.
-libjudy/ Bundled libJudy.
-tests/ Unit tests.
-*.c, *.h Header and source files used to build the package.
-*.php PHP test/examples scripts.
-
-
-3. HOW TO INSTALL
-------------------
-
- A. Linux
-
- From the PHP Judy sources :
-
- phpize
- ./configure --with-judy[=DIR]
- make
- make test
- make install
-
- If you are using Ubuntu or Debian, you can install libJudy with apt :
-
- apt-get install libjudydebian1 libjudy-dev
- phpize
- ./configure --with-judy=/usr
- make
- make test
- make install
-
- B. Windows
-
- On Windows, you will need to build LibJudy yourself.
-
- Download the sources at
-
- http://sourceforge.net/projects/judy/
-
- Extract the sources, and open the Visual Studio command prompt and navigate to
- the source directory. Then execute:
-
- build
-
- This creates "Judy.lib", copy this into the php-sdk library folder and name it
-
- libJudy.lib
-
- Then copy the include file "judy.h" into the php-sdk includes folder. Now its
- time to build pecl/judy, extract the pecl/judy into your build folder where
- the build scripts will be able to pick it up, e.g.:
-
- C:\php\pecl\judy\
-
- If your source of PHP is located in:
-
- C:\php\src\
-
- The rest of the steps is pretty straight forward, like any other external
- extension:
-
- buildconf
- configure --with-judy=shared
- nmake
-
- C. Mac OS X
-
- You will need to install the libJudy first. Download the sources at
-
- http://sourceforge.net/projects/judy/
-
- Extract the sources, then cd into the source directory and execute :
-
- ./configure
- make
- make install
-
- Use pecl to install the PHP Judy extension :
-
- sudo pecl -d preferred_state=beta install Judy
-
-
-4. USAGE (EXAMPLES)
-------------------
-
-Judy's array can be used like usual PHP arrays. The difference will be in the
-type of key/values that you can use. Judy arrays are optimised for memory usage
-but it force to some limitation in the PHP API.
-
-There is currently 5 type of PHP Judy Arrays :
- - BITSET (using Judy1)
- - INT_TO_INT (using JudyL)
- - INT_TO_MIXED (using JudyL)
- - STRING_TO_INT (using JudySL)
- - STRING_TO_MIXED (using JudySL)
-
-You can use foreach() and the PHP array notation on all PHP Judy arrays.
-
- A. BITSET
-
- Bitset implementation is quite basic for now. It allow you to set a bunch of index
- setting the value to false will be the same than using unset().
-
- $bitset = new Judy(Judy::BITSET);
- $bitset[124] = true;
- ...
-
- print $bitset[124]; // will print 1
-
- $bitset[124] = false; // is the same as unset($bitset[124])
-
- B. INT_TO_INT
-
- This type let you create an array with key and value of integer, and integer only.
-
- $int2int = new Judy(Judy::INT_TO_INT);
- $int2int[125] = 17;
- ...
-
- print $int2int[125]; // will print 17
-
- C. INT_TO_MIXED
-
- This type let you create an array with key as integer and value of any type, including
- other judy array or any object.
-
- $int2mixed = new Judy(Judy::INT_TO_MIXED);
- $int2mixed[1] = "one";
- $int2mixed[2] = array('a', 'b', 'c');
- $int2mixed[3] = new Judy(Judy::BITSET);
-
- D. STRING_TO_INT
-
- This type let you create an array with key as string (currently limited to 65536 char.)
- and an integer as the value.
-
- $string2int = new Judy(Judy::STRING_TO_INT);
- $string2int["one"] = 1;
- $string2int["two"] = 2;
-
- print $string2int["one"]; // will print 1
-
- E. STRING_TO_MIXED
-
- This type let you create an array with key as string and values of any type, including
- other judy array or any objects.
-
- $string2mixed = new Judy(Judy::STRING_TO_MIXED);
- $string2mixed["string"] = "hello world!";
- $string2mixed["array"] = array('a', 'b', 'c');
- $string2mixed["integer"] = 632;
- $string2mixed["bitset"] = new Judy(Judy::BITSET);
-
-
-5. REPORTING BUGS
-------------------
-
-If you encounter a bug, please submit it via the bug tracker on Git Hub:
-
- https://github.com/orieg/php-judy/issues
-
-
-6. TODO
---------
-
- * Implements comparator and cast handler
- * Add bitset comparator (cf. Judy1Op sample)
diff --git a/php-pecl-judy.spec b/php-pecl-judy.spec
index 2eeb496..7f8278d 100644
--- a/php-pecl-judy.spec
+++ b/php-pecl-judy.spec
@@ -1,4 +1,4 @@
-# spec file for php-pecl-xrange
+# spec file for php-pecl-judy
#
# Copyright (c) 2013 Remi Collet
# License: CC-BY-SA
@@ -14,28 +14,16 @@
%global ext_name judy
Summary: PHP Judy implements sparse dynamic arrays
-Name: php-pecl-%{pecl_name}
-Version: 1.0.0
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Name: php-pecl-judy
+Version: 1.0.1
+Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-# Retrieved from http://svn.php.net/viewvc/pecl/judy/trunk/
-Source1: LICENSE
-Source2: README
-Source3: CREDITS
-
-# http://svn.php.net/viewvc?view=revision&revision=331753
-# http://svn.php.net/viewvc?view=revision&revision=331755
-# http://svn.php.net/viewvc?view=revision&revision=331758
-# http://svn.php.net/viewvc?view=revision&revision=331760
-# http://svn.php.net/viewvc?view=revision&revision=331761
-Patch0: %{pecl_name}-svn.patch
-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: php-devel
+BuildRequires: php-devel > 5.3
BuildRequires: php-pear
BuildRequires: Judy-devel
@@ -49,10 +37,15 @@ Provides: php-%{ext_name} = %{version}
Provides: php-%{ext_name}%{?_isa} = %{version}
Provides: php-pecl(%{pecl_name}) = %{version}
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
+# Package have been renamed
+Obsoletes: php-pecl-Judy < 1.0.1
+Provides: php-pecl-Judy = %{version}-%{release}
+%if 0%{?fedora} < 20
# Filter shared private
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
+%endif
%description
@@ -68,6 +61,9 @@ Summary: %{name} developer files (header)
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: php-devel%{?_isa}
+# Package have been renamed
+Obsoletes: php-pecl-Judy-devel < 1.0.1
+Provides: php-pecl-Judy-devel = %{version}-%{release}
%description devel
These are the files needed to compile programs using %{name}.
@@ -78,10 +74,6 @@ These are the files needed to compile programs using %{name}.
mv %{pecl_name}-%{version} NTS
cd NTS
-%patch0 -p3
-
-cp %{SOURCE1} %{SOURCE2} %{SOURCE3} .
-
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_JUDY_VERSION/{s/.* "//;s/".*$//;p}' php_judy.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -139,6 +131,14 @@ make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{ext_name}.ini
%endif
+# Test & Documentation
+for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
+done
+for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+done
+
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
@@ -187,7 +187,8 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc NTS/{LICENSE,CREDITS}
+%doc %{pecl_docdir}/%{pecl_name}
+%doc %{pecl_testdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ext_name}.ini
%{php_extdir}/%{ext_name}.so
@@ -207,6 +208,13 @@ rm -rf %{buildroot}
%changelog
+* Mon Oct 21 2013 Remi Collet <remi@fedoraproject.org> - 1.0.1-1
+- rename from php-pecl-Judy to php-pecl-judy
+- Update to 1.0.1
+- install doc in pecl doc_dir
+- install tests in pecl test_dir
+- drop merged patches
+
* Thu Oct 10 2013 Remi Collet <remi@fedoraproject.org> - 1.0.0-2
- fix extension name in configuration file