From a04ce94f22942f1236f60b55565e708462b72be8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 17 Jul 2013 15:28:36 +0200 Subject: php-pecl-gnupg: 1.3.3 --- gnupg-gpg1.patch | 13 ------ gnupg-php54.patch | 113 ---------------------------------------------------- gnupg-svn.patch | 21 ++++++++++ gnupg-tests.patch | 28 ------------- php-pecl-gnupg.spec | 48 +++++++++++----------- 5 files changed, 44 insertions(+), 179 deletions(-) delete mode 100644 gnupg-gpg1.patch delete mode 100644 gnupg-php54.patch create mode 100644 gnupg-svn.patch delete mode 100644 gnupg-tests.patch diff --git a/gnupg-gpg1.patch b/gnupg-gpg1.patch deleted file mode 100644 index 8b079bc..0000000 --- a/gnupg-gpg1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up gnupg-1.3.2/gnupg.c.orig gnupg-1.3.2/gnupg.c ---- gnupg-1.3.2/gnupg.c.orig 2012-01-28 10:24:09.763192106 +0100 -+++ gnupg-1.3.2/gnupg.c 2012-01-28 10:25:36.644195977 +0100 -@@ -137,6 +137,9 @@ static void gnupg_res_init(gnupg_object - gpgme_ctx_t ctx; - gpgme_check_version (NULL); - gpgme_new (&ctx); -+#ifdef GNUPG_PATH -+ gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, GNUPG_PATH, NULL); -+#endif - gpgme_set_armor (ctx,1); - intern->ctx = ctx; - intern->encryptkeys = NULL; diff --git a/gnupg-php54.patch b/gnupg-php54.patch deleted file mode 100644 index 47f7e95..0000000 --- a/gnupg-php54.patch +++ /dev/null @@ -1,113 +0,0 @@ -diff -up gnupg-1.3.2/gnupg.c.php54 gnupg-1.3.2/gnupg.c ---- gnupg-1.3.2/gnupg.c.php54 1970-01-01 10:13:08.000000000 +0100 -+++ gnupg-1.3.2/gnupg.c 2012-05-06 09:36:28.377935185 +0200 -@@ -18,6 +18,7 @@ - - #include "php.h" - #include "php_ini.h" -+#include "zend_exceptions.h" - #include "ext/standard/info.h" - #include "php_gnupg.h" - -@@ -53,7 +54,7 @@ static zend_object_handlers gnupg_object - php_error_docref(NULL TSRMLS_CC, E_WARNING, (char*)error); \ - break; \ - case 2: \ -- zend_throw_exception(zend_exception_get_default(), (char*) error, 0 TSRMLS_CC); \ -+ zend_throw_exception(zend_exception_get_default(TSRMLS_C), (char*) error, 0 TSRMLS_CC); \ - break; \ - default: \ - intern->errortxt = (char*)error; \ -@@ -170,7 +171,9 @@ static void gnupg_obj_dtor(gnupg_object - /* {{{ objects_new */ - zend_object_value gnupg_obj_new(zend_class_entry *class_type TSRMLS_DC){ - gnupg_object *intern; -+#if PHP_VERSION_ID < 50400 - zval *tmp; -+#endif - zend_object_value retval; - - intern = emalloc(sizeof(gnupg_object)); -@@ -179,7 +182,12 @@ zend_object_value gnupg_obj_new(zend_cla - - ALLOC_HASHTABLE (intern->zo.properties); - zend_hash_init (intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); -+ -+#if PHP_VERSION_ID < 50400 - zend_hash_copy (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); -+#else -+ object_properties_init( (zend_object*)intern, class_type ); -+#endif - - retval.handle = zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC); - retval.handlers = (zend_object_handlers *) & gnupg_object_handlers; -@@ -379,7 +387,7 @@ PHP_MINFO_FUNCTION(gnupg) - /* {{{ callback func for setting the passphrase */ - - gpgme_error_t passphrase_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){ -- char uid[16]; -+ char uid[17]; - int idx; - char *passphrase = NULL; - zval *return_value = NULL; -@@ -407,7 +415,7 @@ gpgme_error_t passphrase_cb (gnupg_objec - } - - gpgme_error_t passphrase_decrypt_cb (gnupg_object *intern, const char *uid_hint, const char *passphrase_info,int last_was_bad, int fd TSRMLS_DC){ -- char uid[16]; -+ char uid[17]; - int idx; - char *passphrase = NULL; - zval *return_value = NULL; -@@ -1244,7 +1252,6 @@ PHP_FUNCTION(gnupg_decryptverify){ - gpgme_data_t in, out; - gpgme_decrypt_result_t decrypt_result; - gpgme_verify_result_t verify_result; -- gpgme_signature_t gpg_signatures; - - GNUPG_GETOBJ(); - -@@ -1472,13 +1479,12 @@ PHP_FUNCTION(gnupg_gettrustlist){ - /* {{{ proto array gnupg_listsignatures(string keyid) */ - PHP_FUNCTION(gnupg_listsignatures){ - char *keyid; -- char keyid_len; -+ int keyid_len; - - zval *sub_arr; - zval *sig_arr; - - gpgme_key_t gpgme_key; -- gpgme_subkey_t gpgme_subkey; - gpgme_user_id_t gpgme_userid; - gpgme_key_sig_t gpgme_signature; - -diff -up gnupg-1.3.2/gnupg_keylistiterator.c.php54 gnupg-1.3.2/gnupg_keylistiterator.c ---- gnupg-1.3.2/gnupg_keylistiterator.c.php54 1970-01-01 10:13:08.000000000 +0100 -+++ gnupg-1.3.2/gnupg_keylistiterator.c 2012-05-06 09:35:59.584823512 +0200 -@@ -23,6 +23,7 @@ - #include "php_ini.h" - #include "ext/standard/info.h" - #include "zend_interfaces.h" -+#include "zend_exceptions.h" - #include "php_gnupg.h" - #include "php_gnupg_keylistiterator.h" - -@@ -148,7 +149,7 @@ PHP_METHOD(gnupg_keylistiterator,next){ - gpgme_key_release(intern->gpgkey); - } - -- if(intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey)){ -+ if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))){ - gpgme_key_release(intern->gpgkey); - intern->gpgkey = NULL; - } -@@ -159,7 +160,7 @@ PHP_METHOD(gnupg_keylistiterator,rewind) - GNUPG_GET_ITERATOR(); - - if((intern->err = gpgme_op_keylist_start(intern->ctx, Z_STRVAL(intern->pattern), 0)) != GPG_ERR_NO_ERROR){ -- zend_throw_exception(zend_exception_get_default(),gpg_strerror(intern->err),1 TSRMLS_CC); -+ zend_throw_exception(zend_exception_get_default(TSRMLS_C),gpg_strerror(intern->err),1 TSRMLS_CC); - } - if((intern->err = gpgme_op_keylist_next(intern->ctx, &intern->gpgkey))!=GPG_ERR_NO_ERROR){ - RETURN_FALSE; diff --git a/gnupg-svn.patch b/gnupg-svn.patch new file mode 100644 index 0000000..2df6cee --- /dev/null +++ b/gnupg-svn.patch @@ -0,0 +1,21 @@ +--- pecl/gnupg/trunk/php_gnupg.h 2013/07/17 11:48:09 330949 ++++ pecl/gnupg/trunk/php_gnupg.h 2013/07/17 11:55:40 330950 +@@ -19,7 +19,7 @@ + extern zend_module_entry gnupg_module_entry; + #define phpext_gnupg_ptr &gnupg_module_entry + +-#define PHP_GNUPG_VERSION "1.3.3-dev" ++#define PHP_GNUPG_VERSION "1.3.3" + + #ifdef PHP_WIN32 + #define PHP_GNUPG_API __declspec(dllexport) +--- pecl/gnupg/trunk/gnupg.c 2013/07/17 12:00:06 330953 ++++ pecl/gnupg/trunk/gnupg.c 2013/07/17 12:11:24 330954 +@@ -1307,7 +1307,6 @@ + if(!verify_result->signatures){ + GNUPG_ERR ("no signature found"); + gpgme_data_release(in); +- free(out); + return; + } + gnupg_fetchsignatures (verify_result->signatures, return_value); diff --git a/gnupg-tests.patch b/gnupg-tests.patch deleted file mode 100644 index f26b53e..0000000 --- a/gnupg-tests.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -up gnupg-1.3.2/tests/gnupg_oo_export.phpt.orig gnupg-1.3.2/tests/gnupg_oo_export.phpt ---- gnupg-1.3.2/tests/gnupg_oo_export.phpt.orig 2012-01-28 08:43:44.138922329 +0100 -+++ gnupg-1.3.2/tests/gnupg_oo_export.phpt 2012-01-28 08:44:44.152924641 +0100 -@@ -11,8 +11,8 @@ $ret = $gpg -> export($fingerprint); - var_dump($ret); - ?> - --EXPECTF-- --string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK----- --Version: GnuPG v1.4.3 (GNU/Linux) -+string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK----- -+Version: GnuPG v%d.%d.%d (GNU/Linux) - - mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3 - afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z -diff -up gnupg-1.3.2/tests/gnupg_res_export.phpt.orig gnupg-1.3.2/tests/gnupg_res_export.phpt ---- gnupg-1.3.2/tests/gnupg_res_export.phpt.orig 2012-01-28 08:43:54.576921963 +0100 -+++ gnupg-1.3.2/tests/gnupg_res_export.phpt 2012-01-28 08:44:40.582924190 +0100 -@@ -9,8 +9,8 @@ $ret = gnupg_export($gpg, $fingerprint); - var_dump($ret); - ?> - --EXPECTF-- --string(1336) "-----BEGIN PGP PUBLIC KEY BLOCK----- --Version: GnuPG v1.4.3 (GNU/Linux) -+string(%d) "-----BEGIN PGP PUBLIC KEY BLOCK----- -+Version: GnuPG v%d.%d.%d (GNU/Linux) - - mQGiBENQAKwRBADpy828KU+0SuoetJTrJ5dR86PiO3CsH8K6QRP7wY82Eh/9NTJ3 - afRj0FNPaVSP0NciPeM4G4uFoQ3lsIf+FBEPXH1D97/XigWObU8K6ha2/s8wU98z diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec index 4269576..85a90c2 100644 --- a/php-pecl-gnupg.spec +++ b/php-pecl-gnupg.spec @@ -11,22 +11,17 @@ Summary: Wrapper around the gpgme library Name: php-pecl-gnupg -Version: 1.3.2 -Release: 4%{?dist} +Version: 1.3.3 +Release: 1%{?dist}.1 License: BSD Group: Development/Languages URL: http://pecl.php.net/package/gnupg Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# http://svn.php.net/viewvc/pecl/gnupg/trunk/tests/vars.inc?view=co -Source1: vars.inc -# https://bugs.php.net/60915 PHP 5.4 build -Patch0: gnupg-php54.patch -# https://bugs.php.net/60913 Fix test suite -Patch1: gnupg-tests.patch -# https://bugs.php.net/60916 Force use of /usr/bin/gpg -Patch2: gnupg-gpg1.patch +# http://svn.php.net/viewvc?view=revision&revision=330950 Fix version +# http://svn.php.net/viewvc?view=revision&revision=330954 Fix double-free +Patch0: %{pecl_name}-svn.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: php-devel @@ -69,32 +64,27 @@ Documentation : http://www.php.net/gnupg %prep %setup -c -q -cp %{SOURCE1} %{pecl_name}-%{version}/tests -%patch0 -p0 -b .php54 -%patch1 -p0 -b .tests -%patch2 -p0 -b .gpg1 - # Create configuration file cat >%{pecl_name}.ini << 'EOF' ; Enable %{pecl_name} extension module extension=%{pecl_name}.so EOF +cd %{pecl_name}-%{version}/ +%patch0 -p3 -b .svn + %if 0%{?rhel} == 5 # GnuPG seems to old -rm -f %{pecl_name}-%{version}/tests/gnupg_{oo,res}_listsignatures.phpt +rm -f tests/gnupg_{oo,res}_listsignatures.phpt %endif -# Fix version for phpinfo() -# https://bugs.php.net/60914 -sed -i -e /PHP_GNUPG_VERSION/s/1.3.2-dev/1.3.2/ %{pecl_name}-%{version}/php_gnupg.h - # Check extension version -extver=$(sed -n '/#define PHP_GNUPG_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_gnupg.h) +extver=$(sed -n '/#define PHP_GNUPG_VERSION/{s/.* "//;s/".*$//;p}' php_gnupg.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi +cd .. # Build ZTS extension if ZTS devel available (fedora >= 17) cp -r %{pecl_name}-%{version} %{pecl_name}-zts @@ -121,8 +111,6 @@ make %{?_smp_mflags} %install rm -rf %{buildroot} -# for short-circuit -rm -rf %{pecl_name}-*/modules/{json,mysqlnd}.so make install -C %{pecl_name}-%{version} \ INSTALL_ROOT=%{buildroot} @@ -157,9 +145,16 @@ cd %{pecl_name}-%{version} unset GPG_AGENT_INFO +# ignore test result on EL-6 which only have gnupg2 +%if 0%{?rhel} == 6 +status=0 +%else +status=1 +%endif + # run full test suite TEST_PHP_EXECUTABLE=%{_bindir}/php \ -REPORT_EXIT_STATUS=0 \ +REPORT_EXIT_STATUS=$status \ NO_INTERACTION=1 \ php run-tests.php \ -n -q \ @@ -170,7 +165,7 @@ cd ../%{pecl_name}-zts # run full test suite TEST_PHP_EXECUTABLE=%{__ztsphp} \ -REPORT_EXIT_STATUS=0 \ +REPORT_EXIT_STATUS=$status \ NO_INTERACTION=1 \ %{__ztsphp} run-tests.php \ -n -q \ @@ -191,6 +186,9 @@ NO_INTERACTION=1 \ %changelog +* Wed Jul 17 2013 Remi Collet - 1.3.3-1 +- update to 1.3.3 + * Sun Jun 30 2013 Remi Collet - 1.3.2-4 - ignore test result -- cgit