packages: kde4-kdepim/kde4-kdepim.spec, kde4-kdepim/kleopatra-4.4.3-assuan2...

arekm arekm at pld-linux.org
Sun Sep 12 21:18:02 CEST 2010


Author: arekm                        Date: Sun Sep 12 19:18:02 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 2; add assuan2 fixes from gentoo

---- Files affected:
packages/kde4-kdepim:
   kde4-kdepim.spec (1.147 -> 1.148) , kleopatra-4.4.3-assuan2.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/kde4-kdepim/kde4-kdepim.spec
diff -u packages/kde4-kdepim/kde4-kdepim.spec:1.147 packages/kde4-kdepim/kde4-kdepim.spec:1.148
--- packages/kde4-kdepim/kde4-kdepim.spec:1.147	Fri Sep 10 11:57:23 2010
+++ packages/kde4-kdepim/kde4-kdepim.spec	Sun Sep 12 21:17:57 2010
@@ -10,12 +10,14 @@
 Summary(uk.UTF-8):	Персональный планувальник (PIM) для KDE
 Name:		kde4-kdepim
 Version:	4.4.6
-Release:	1
+Release:	2
 License:	GPL
 Group:		X11/Applications
 Source0:	ftp://ftp.kde.org/pub/kde/%{_state}/kdepim-%{version}/src/%{orgname}-%{version}.tar.bz2
 # Source0-md5:	dab253004c2660c75b61a3caeb117ed1
 Patch100:	%{name}-branch.diff
+# http://mirrors.ludost.net/gentoo/distfiles/kleopatra-4.4.3-assuan2.patch.bz2
+Patch0:		kleopatra-4.4.3-assuan2.patch
 URL:		http://www.kde.org/
 BuildRequires:	Qt3Support-devel >= %{qtver}
 BuildRequires:	QtDesigner-devel >= %{qtver}
@@ -29,7 +31,7 @@
 BuildRequires:	gpgme-devel >= 1:1.2.0
 BuildRequires:	kde4-kdelibs-devel >= %{version}
 BuildRequires:	kde4-kdepimlibs-devel >= %{version}
-BuildRequires:	libassuan1-devel
+BuildRequires:	libassuan-devel
 BuildRequires:	libindicate-qt-devel >= 0.2.2
 BuildRequires:	openssl-devel
 BuildRequires:	pcre-devel
@@ -671,6 +673,7 @@
 %prep
 %setup -q -n %{orgname}-%{version}
 #%patch100 -p0
+%patch0 -p0
 
 %build
 install -d build
@@ -1377,6 +1380,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.148  2010/09/12 19:17:57  arekm
+- rel 2; add assuan2 fixes from gentoo
+
 Revision 1.147  2010/09/10 09:57:23  shadzik
 - 4.4.6
 

================================================================
Index: packages/kde4-kdepim/kleopatra-4.4.3-assuan2.patch
diff -u /dev/null packages/kde4-kdepim/kleopatra-4.4.3-assuan2.patch:1.1
--- /dev/null	Sun Sep 12 21:18:02 2010
+++ packages/kde4-kdepim/kleopatra-4.4.3-assuan2.patch	Sun Sep 12 21:17:57 2010
@@ -0,0 +1,1083 @@
+Index: cmake/modules/FindAssuan2.cmake
+===================================================================
+--- cmake/modules/FindAssuan2.cmake	(revision 0)
++++ cmake/modules/FindAssuan2.cmake	(revision 1078528)
+@@ -0,0 +1,251 @@
++# - Try to find the assuan v2 library
++
++# Variables set:
++#  ASSUAN2_{INCLUDES,FOUND,LIBRARIES} will be set for each of the above
++
++# do away with crappy condition repetition on else/endfoo
++set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_assuan2_saved ${CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS} )
++set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
++
++#if this is built-in, please replace, if it isn't, export into a MacroToBool.cmake of it's own
++macro( macro_bool_to_bool FOUND_VAR )
++  foreach( _current_VAR ${ARGN} )
++    if ( ${FOUND_VAR} )
++      set( ${_current_VAR} TRUE )
++    else()
++      set( ${_current_VAR} FALSE )
++    endif()
++  endforeach()
++endmacro()
++
++include (MacroEnsureVersion)
++
++message( STATUS "In FindAssuan2.cmake" )
++
++if ( WIN32 )
++
++  # On Windows, we don't have a libassuan-config script, so we need to
++  # look for the stuff ourselves:
++
++  # in cmake, AND and OR have the same precedence, there's no
++  # subexpressions, and expressions are evaluated short-circuit'ed
++  # IOW: CMake if() suxx.
++  set( _seem_to_have_cached_assuan2 false )
++  if ( ASSUAN2_INCLUDES )
++    if ( ASSUAN2_VANILLA_LIBRARIES )#OR ASSUAN2_QT_LIBRARIES OR ASSUAN2_GLIB_LIBRARIES )
++      set( _seem_to_have_cached_assuan2 true )
++    endif()
++  endif()
++
++  if ( _seem_to_have_cached_assuan2 )
++
++    macro_bool_to_bool( ASSUAN2_VANILLA_LIBRARIES  ASSUAN2_VANILLA_FOUND )
++    # this would have been preferred:
++    #set( ASSUAN2_*_FOUND macro_bool_to_bool(ASSUAN2_*_LIBRARIES) )
++
++    if ( ASSUAN2_VANILLA_FOUND ) #OR ASSUAN2_GLIB_FOUND OR ASSUAN2_QT_FOUND )
++      set( ASSUAN2_FOUND true )
++    else()
++      set( ASSUAN2_FOUND false )
++    endif()
++
++  else()
++
++    set( ASSUAN2_FOUND         false )
++    set( ASSUAN2_VANILLA_FOUND false )
++    #set( ASSUAN2_GLIB_FOUND    false )
++    #set( ASSUAN2_QT_FOUND      false )
++
++    find_path( ASSUAN2_INCLUDES assuan.h
++      ${CMAKE_INCLUDE_PATH}
++      ${CMAKE_INSTALL_PREFIX}/include
++    )
++
++    find_library( _assuan2_library NAMES assuan assuan0 assuan2 libassuan libassuan0 libassuan2
++      PATHS 
++        ${CMAKE_LIBRARY_PATH}
++        ${CMAKE_INSTALL_PREFIX}/lib
++    )
++
++    find_library( _gpg_error_library     NAMES gpg-error libgpg-error gpg-error-0 libgpg-error-0
++      PATHS 
++        ${CMAKE_LIBRARY_PATH}
++        ${CMAKE_INSTALL_PREFIX}/lib
++    )
++
++    set( ASSUAN2_INCLUDES ${ASSUAN2_INCLUDES} )
++
++    if ( _assuan2_library AND _gpg_error_library )
++      set( ASSUAN2_LIBRARIES ${_assuan2_library} ${_gpg_error_library} ws2_32 )
++      set( ASSUAN2_FOUND             true )
++    endif()
++
++  endif()
++
++  macro_bool_to_01( ASSUAN2_FOUND HAVE_ASSUAN2 )
++
++else() # not WIN32
++
++  # On *nix, we have the libassuan-config script which can tell us all we
++  # need to know:
++
++  # see WIN32 case for an explanation of what this does:
++  set( _seem_to_have_cached_assuan2 false )
++  if ( ASSUAN2_INCLUDES AND ASSUAN2_LIBRARIES )
++    set( _seem_to_have_cached_assuan2 true )
++  endif()
++
++  if ( _seem_to_have_cached_assuan2 )
++
++    set( ASSUAN2_FOUND true )
++
++  else()
++
++    set( ASSUAN2_FOUND         false )
++
++    find_program( _ASSUAN2CONFIG_EXECUTABLE NAMES libassuan-config )
++
++    # if libassuan-config has been found
++    if ( _ASSUAN2CONFIG_EXECUTABLE )
++      
++      message( STATUS "Found libassuan-config at ${_ASSUAN2CONFIG_EXECUTABLE}" )
++
++      exec_program( ${_ASSUAN2CONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE ASSUAN2_VERSION )
++
++      set( _ASSUAN2_MIN_VERSION "2.0.0" )
++      macro_ensure_version( ${_ASSUAN2_MIN_VERSION} ${ASSUAN2_VERSION} _ASSUAN2_INSTALLED_VERSION_OK )
++
++      if ( NOT _ASSUAN2_INSTALLED_VERSION_OK )
++
++        message( STATUS "The installed version of assuan is too old: ${ASSUAN2_VERSION} (required: >= ${_ASSUAN2_MIN_VERSION})" )
++
++      else()
++
++        message( STATUS "Found assuan v${ASSUAN2_VERSION}" )
++
++        exec_program( ${_ASSUAN2CONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE _assuan2_config_libs RETURN_VALUE _ret )
++	if ( _ret )
++	  set( _assuan2_config_libs )
++	endif()
++
++        # append -lgpg-error to the list of libraries, if necessary
++        if ( _assuan2_config_libs AND NOT _assuan2_config_libs MATCHES "lgpg-error" )
++          set( _assuan2_config_libs "${_assuan2_config_libs} -lgpg-error" )
++        endif()
++
++        if ( _assuan2_config_libs )
++
++          exec_program( ${_ASSUAN2CONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE _ASSUAN2_CFLAGS )
++
++          if ( _ASSUAN2_CFLAGS )
++            string( REGEX REPLACE "(\r?\n)+$" " " _ASSUAN2_CFLAGS  "${_ASSUAN2_CFLAGS}" )
++            string( REGEX REPLACE " *-I"      ";" ASSUAN2_INCLUDES "${_ASSUAN2_CFLAGS}" )
++          endif()
++
++          if ( _assuan2_config_libs )
++
++            set( _assuan2_library_dirs )
++            set( _assuan2_library_names )
++
++            string( REGEX REPLACE " +" ";" _assuan2_config_libs "${_assuan2_config_libs}" )
++
++            foreach( _flag ${_assuan2_config_libs} )
++              if ( "${_flag}" MATCHES "^-L" )
++                string( REGEX REPLACE "^-L" "" _dir "${_flag}" )
++                file( TO_CMAKE_PATH "${_dir}" _dir )
++                set( _assuan2_library_dirs ${_assuan2_library_dirs} "${_dir}" )
++              elseif( "${_flag}" MATCHES "^-l" )
++                string( REGEX REPLACE "^-l" "" _name "${_flag}" )
++                set( _assuan2_library_names ${_assuan2_library_names} "${_name}" )
++              endif()
++            endforeach()
++
++            set( ASSUAN2_FOUND true )
++
++            foreach( _name ${_assuan2_library_names} )
++              set( _assuan2_${_name}_lib )
++
++              # if -L options were given, look only there
++              if ( _assuan2_library_dirs )
++                find_library( _assuan2_${_name}_lib NAMES ${_name} PATHS ${_assuan2_library_dirs} NO_DEFAULT_PATH )
++              endif()
++
++              # if not found there, look in system directories
++              if ( NOT _assuan2_${_name}_lib )
++                find_library( _assuan2_${_name}_lib NAMES ${_name} )
++              endif()
++
++              # if still not found, then the whole flavour isn't found
++              if ( NOT _assuan2_${_name}_lib )
++                if ( ASSUAN2_FOUND )
++                  set( ASSUAN2_FOUND false )
++                  set( _not_found_reason "dependant library ${_name} wasn't found" )
++                endif()
++              endif()
++
++              set( ASSUAN2_LIBRARIES ${ASSUAN2_LIBRARIES} "${_assuan2_${_name}_lib}" )
++            endforeach()
++
++            #check_c_library_exists_explicit( assuan         assuan_check_version "${_ASSUAN2_CFLAGS}" "${ASSUAN2_LIBRARIES}"         ASSUAN2_FOUND         )
++            if ( ASSUAN2_FOUND )
++              message( STATUS " Checking whether assuan is usable...yes" )
++            else()
++              message( STATUS " Checking whether assuan is usable...no" )
++              message( STATUS "  (${_not_found_reason})" )
++            endif()
++          endif()
++
++          # ensure that they are cached
++          set( ASSUAN2_INCLUDES  ${ASSUAN2_INCLUDES}  )
++          set( ASSUAN2_LIBRARIES ${ASSUAN2_LIBRARIES} )
++
++        endif()
++
++      endif()
++
++    endif()
++
++  endif()
++
++  macro_bool_to_01( ASSUAN2_FOUND         HAVE_ASSUAN2         )
++
++endif() # WIN32 | Unix
++
++
++if ( NOT Assuan2_FIND_QUIETLY )
++
++  if ( ASSUAN2_FOUND )
++    message( STATUS "Usable assuan found." )
++    message( STATUS " Includes:  ${ASSUAN2_INCLUDES}" )
++    message( STATUS " Libraries: ${ASSUAN2_LIBRARIES}" )
++  else()
++    message( STATUS "No usable assuan found." )
++  endif()
++
++  macro_bool_to_bool( Assuan2_FIND_REQUIRED _req )
++
++  if ( WIN32 )
++    set( _assuan2_homepage "http://www.gpg4win.org" )
++  else()
++    set( _assuan2_homepage "http://www.gnupg.org/related_software/libassuan" )
++  endif()
++
++  macro_log_feature(
++    ASSUAN2_FOUND
++    "assuan2"
++    "Assuan v2 IPC library"
++    ${_assuan2_homepage}
++    ${_req}
++    "${_ASSUAN2_MIN_VERSION} or greater"
++    "Needed for Kleopatra to act as the GnuPG UI Server"
++  )
++
++else()
++
++  if ( Assuan2_FIND_REQUIRED AND NOT ASSUAN2_FOUND )
++    message( FATAL_ERROR "" )
++  endif()
++
++endif()
++
++set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS_assuan2_saved )
+Index: kleopatra/ConfigureChecks.cmake
+===================================================================
+--- kleopatra/ConfigureChecks.cmake	(revision 1078527)
++++ kleopatra/ConfigureChecks.cmake	(revision 1078528)
+@@ -1,21 +1,18 @@
+ # assuan configure checks
+ include(CheckFunctionExists)
+ 
+-macro_optional_find_package(Assuan)
++macro_optional_find_package(Assuan2)
+ 
+ set( USABLE_ASSUAN_FOUND false )
+ 
+-if ( ASSUAN_FOUND )
++if ( ASSUAN2_FOUND )
+ 
+-  set( CMAKE_REQUIRED_INCLUDES ${ASSUAN_INCLUDES} )
++  set( CMAKE_REQUIRED_INCLUDES ${ASSUAN2_INCLUDES} )
+ 
+-  if ( WIN32 AND ASSUAN_VANILLA_FOUND )
+-    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN_VANILLA_LIBRARIES} )
++  if ( ASSUAN2_FOUND )
++    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN2_LIBRARIES} )
+     set( USABLE_ASSUAN_FOUND true )
+-  elseif( NOT WIN32 AND ASSUAN_PTHREAD_FOUND )
+-    set( CMAKE_REQUIRED_LIBRARIES ${ASSUAN_PTHREAD_LIBRARIES} )
+-    set( USABLE_ASSUAN_FOUND true )
+-  endif( WIN32 AND ASSUAN_VANILLA_FOUND )
++  endif( ASSUAN2_FOUND )
+ 
+   # TODO: this workaround will be removed as soon as we find better solution
+   if(MINGW)
+@@ -24,7 +21,7 @@
+     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDE_DIR}/msvc)
+   endif(MINGW)
+ 
+-endif( ASSUAN_FOUND )
++endif( ASSUAN2_FOUND )
+ 
+ if ( USABLE_ASSUAN_FOUND )
+   # check if assuan.h can be compiled standalone (it couldn't, on
+@@ -48,40 +45,6 @@
+ 
+ if ( USABLE_ASSUAN_FOUND )
+ 
+-  # check if assuan has assuan_fd_t
+-  check_cxx_source_compiles("
+-        #include <assuan.h>
+-        int main() {
+-            assuan_fd_t fd = ASSUAN_INVALID_FD;
+-            return fd ? 1 : 0 ;
+-        }
+-        "
+-    HAVE_ASSUAN_FD_T )
+-
+-  if ( WIN32 AND NOT HAVE_ASSUAN_FD_T )
+-    set( USABLE_ASSUAN_FOUND false )
+-  endif ( WIN32 AND NOT HAVE_ASSUAN_FD_T )
+-
+-  # check if assuan has assuan_inquire_ext, old style
+-  check_function_exists( "assuan_inquire_ext" HAVE_ASSUAN_INQUIRE_EXT )
+-
+-  if ( NOT HAVE_ASSUAN_INQUIRE_EXT )
+-    set( USABLE_ASSUAN_FOUND false )
+-  endif( NOT HAVE_ASSUAN_INQUIRE_EXT )
+-
+-  # check if assuan has new-style assuan_inquire_ext:
+-  check_cxx_source_compiles("
+-        #include <assuan.h>
+-        static int handler( void *, int, unsigned char*, size_t ) { return 0; }
+-        int main() {
+-            assuan_context_t ctx = 0;
+-            const size_t maxSize = 0U;
+-            assuan_error_t err = assuan_inquire_ext( ctx, \"FOO\", maxSize, handler, (void*)0 );
+-            return err ? 1 : 0 ;
+-        }
+-        "
+-    HAVE_NEW_STYLE_ASSUAN_INQUIRE_EXT )
+-
+   # check if gpg-error already has GPG_ERR_SOURCE_KLEO
+   check_cxx_source_compiles("
+         #include <gpg-error.h>
+@@ -90,21 +53,6 @@
+         "
+     HAVE_GPG_ERR_SOURCE_KLEO )
+ 
+-  # check if assuan has assuan_sock_get_nonce (via assuan_sock_nonce_t)
+-  # function_exists runs into linking errors - libassuan is static,
+-  # and assuan_sock_get_nonce drags in stuff that needs linking
+-  # against winsock2.
+-  check_cxx_source_compiles("
+-        #include <assuan.h>
+-        static assuan_sock_nonce_t nonce;
+-        int main() { return 0; }
+-        "
+-    HAVE_ASSUAN_SOCK_GET_NONCE )
+-
+-  if ( WIN32 AND NOT HAVE_ASSUAN_SOCK_GET_NONCE )
+-    set( USABLE_ASSUAN_FOUND false )
+-  endif ( WIN32 AND NOT HAVE_ASSUAN_SOCK_GET_NONCE )  
+-
+ endif ( USABLE_ASSUAN_FOUND )
+ 
+ if ( USABLE_ASSUAN_FOUND )
+@@ -113,45 +61,14 @@
+   message( STATUS "NO usable assuan found for Kleopatra" )
+ endif ( USABLE_ASSUAN_FOUND )
+ 
+-#
+-# Check that libassuan (which is built statically) can be linked into a DSO
+-# (e.g. on amd64, this requires it to be compiled with -fPIC).
+-#
+-
+-set ( ASSUAN_LINKABLE_TO_DSO false )
+-
+ OPTION( BUILD_libkleopatraclient "Build directory kleopatra/libkleopatraclient" ${USABLE_ASSUAN_FOUND} )
+ 
+ if ( NOT USABLE_ASSUAN_FOUND )
+   set( BUILD_libkleopatraclient false )
+ endif ( NOT USABLE_ASSUAN_FOUND )
+ 
+-if ( BUILD_libkleopatraclient )
+-
+-  message( STATUS "Checking whether libassuan can be linked against from DSO's" )
+-
+-  set ( YUP TRUE )
+-  if ( YUP )
+-    set ( ASSUAN_LINKABLE_TO_DSO true )
+-    message( STATUS "--> Assuming that it can. If compilation of libkleopatraclient fails on AMD64, check that libassuan is compiled with -fPIC and try again. Otherwise, pass -DBUILD_libkleopatraclient=OFF." )
+-  else ( YUP )
+-  # TODO: make this one executed at configure time, so the check below works:
+-  add_library( dso_with_assuan_check SHARED ${CMAKE_SOURCE_DIR}/kleopatra/dso_with_assuan_check.c )
+-
+-  set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dso_with_assuan_check )
+-  check_cxx_source_compiles( "int main() { return 0; }" ASSUAN_LINKABLE_TO_DSO )
+-
+-  if ( ASSUAN_LINKABLE_TO_DSO )
+-    message( STATUS "Usable assuan found for libkleopatraclient" )
+-  else ( ASSUAN_LINKABLE_TO_DSO )
+-    message( STATUS "NO usable assuan found for libkleopatraclient - if this is AMD64, check that libassuan is compiled with -fPIC" )
+-  endif ( ASSUAN_LINKABLE_TO_DSO )
+-  endif ( YUP )
+-
+-endif ( BUILD_libkleopatraclient )
+-
+ macro_bool_to_01( USABLE_ASSUAN_FOUND  HAVE_USABLE_ASSUAN )
+-macro_bool_to_01( ASSUAN_LINKABLE_TO_DSO HAVE_KLEOPATRACLIENT_LIBRARY )
++macro_bool_to_01( USABLE_ASSUAN_FOUND  HAVE_KLEOPATRACLIENT_LIBRARY )
+ 
+ set(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_REQUIRED_LIBRARIES)
+Index: kleopatra/config-kleopatra.h.cmake
+===================================================================
+--- kleopatra/config-kleopatra.h.cmake	(revision 1078527)
++++ kleopatra/config-kleopatra.h.cmake	(revision 1078528)
+@@ -1,18 +1,6 @@
+ /* Define to 1 if you have a recent enough libassuan */
+ #cmakedefine HAVE_USABLE_ASSUAN 1
+ 
+-/* Define to 1 if your libassuan has the assuan_fd_t type  */
+-#cmakedefine HAVE_ASSUAN_FD_T 1
+-
+-/* Define to 1 if your libassuan has the assuan_inquire_ext function */
+-#cmakedefine HAVE_ASSUAN_INQUIRE_EXT 1
+-
+-/* Define to 1 if your assuan_inquire_ext puts the buffer arguments into the callback signature */
+-#cmakedefine HAVE_NEW_STYLE_ASSUAN_INQUIRE_EXT 1
+-
+-/* Define to 1 if your libassuan has the assuan_sock_get_nonce function */
+-#cmakedefine HAVE_ASSUAN_SOCK_GET_NONCE 1
+-
+ /* Define to 1 if you build libkleopatraclient */
+ #cmakedefine HAVE_KLEOPATRACLIENT_LIBRARY 1
+ 
+Index: kleopatra/tests/test_uiserver.cpp
+===================================================================
+--- kleopatra/tests/test_uiserver.cpp	(revision 1078527)
++++ kleopatra/tests/test_uiserver.cpp	(revision 1078528)
+@@ -89,17 +89,17 @@
+     exit( 1 );
+ }
+ 
+-static assuan_error_t data( void * void_ctx, const void * buffer, size_t len ) {
++static gpg_error_t data( void * void_ctx, const void * buffer, size_t len ) {
+     (void)void_ctx; (void)buffer; (void)len;
+     return 0; // ### implement me
+ }
+ 
+-static assuan_error_t status( void * void_ctx, const char * line ) {
++static gpg_error_t status( void * void_ctx, const char * line ) {
+     (void)void_ctx; (void)line;
+     return 0;
+ }
+ 
+-static assuan_error_t inquire( void * void_ctx, const char * keyword ) {
++static gpg_error_t inquire( void * void_ctx, const char * keyword ) {
+     assuan_context_t ctx = (assuan_context_t)void_ctx;
+     assert( ctx );
+     const std::map<std::string,std::string>::const_iterator it = inquireData.find( keyword );
+@@ -121,7 +121,7 @@
+ 
+     const Kleo::WSAStarter _wsastarter;
+ 
+-    assuan_set_assuan_err_source( GPG_ERR_SOURCE_DEFAULT );
++    assuan_set_gpg_err_source( GPG_ERR_SOURCE_DEFAULT );
+ 
+     if ( argc < 3 )
+         usage(); // need socket and command, at least
+@@ -185,7 +185,12 @@
+ 
+     assuan_context_t ctx = 0;
+ 
+-    if ( const gpg_error_t err = assuan_socket_connect_ext( &ctx, socket, -1, ASSUAN_CONNECT_FLAGS ) ) {
++    if ( const gpg_error_t err = assuan_new( &ctx ) ) {
++        qDebug( "%s", Exception( err, "assuan_new" ).what() );
++        return 1;
++    }
++
++    if ( const gpg_error_t err = assuan_socket_connect( ctx, socket, -1, ASSUAN_CONNECT_FLAGS ) ) {
+         qDebug( "%s", Exception( err, "assuan_socket_connect_ext" ).what() );
+         return 1;
+     }
+@@ -279,7 +284,7 @@
+         return 1;
+     }
+ 
+-    assuan_disconnect( ctx );
++    assuan_release( ctx );
+ 
+     return 0;
+ }
+Index: kleopatra/uiserver/assuancommand.h
+===================================================================
+--- kleopatra/uiserver/assuancommand.h	(revision 1078527)
++++ kleopatra/uiserver/assuancommand.h	(revision 1078528)
+@@ -39,6 +39,8 @@
+ #include <gpgme++/global.h>
+ #include <gpgme++/error.h>
+ 
++#include <gpg-error.h>
++
+ #include <kmime/kmime_header_parsing.h>
+ 
+ #include <qwindowdefs.h> // for WId
+@@ -329,16 +331,16 @@
+         virtual boost::shared_ptr<AssuanCommand> create() const = 0;
+         virtual const char * name() const = 0;
+ 
+-        typedef int(*_Handler)( assuan_context_s*, char *);
++        typedef gpg_error_t(*_Handler)( assuan_context_s*, char *);
+         virtual _Handler _handler() const = 0;
+     protected:
+-        static int _handle( assuan_context_s*, char *, const char * );
++        static gpg_error_t _handle( assuan_context_s*, char *, const char * );
+     };
+ 
+     template <typename Command>
+     class GenericAssuanCommandFactory : public AssuanCommandFactory {
+         /* reimp */ AssuanCommandFactory::_Handler _handler() const { return &GenericAssuanCommandFactory::_handle; }
+-        static int _handle( assuan_context_s* _ctx, char * _line ) {
++        static gpg_error_t _handle( assuan_context_s* _ctx, char * _line ) {
+             return AssuanCommandFactory::_handle( _ctx, _line, Command::staticName() );
+         }
+         /* reimp */ boost::shared_ptr<AssuanCommand> create() const { return make(); }
+Index: kleopatra/uiserver/assuanserverconnection.cpp
+===================================================================
+--- kleopatra/uiserver/assuanserverconnection.cpp	(revision 1078527)
++++ kleopatra/uiserver/assuanserverconnection.cpp	(revision 1078528)
+@@ -116,13 +116,18 @@
+ static const int FOR_READING = 0;
+ static const unsigned int MAX_ACTIVE_FDS = 32;
+ 
++static void my_assuan_release( assuan_context_t ctx ) {
++    if ( ctx )
++        assuan_release( ctx );
++}
++
+ // shared_ptr for assuan_context_t w/ deleter enforced to assuan_deinit_server:
+ typedef shared_ptr< remove_pointer<assuan_context_t>::type > AssuanContextBase;
+ struct AssuanContext : AssuanContextBase {
+     AssuanContext() : AssuanContextBase() {}
+-    explicit AssuanContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &assuan_deinit_server ) {}
++    explicit AssuanContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &my_assuan_release ) {}
+ 
+-    void reset( assuan_context_t ctx=0 ) { AssuanContextBase::reset( ctx, &assuan_deinit_server ); }
++    void reset( assuan_context_t ctx=0 ) { AssuanContextBase::reset( ctx, &my_assuan_release ); }
+ };
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kde4-kdepim/kde4-kdepim.spec?r1=1.147&r2=1.148&f=u



More information about the pld-cvs-commit mailing list