From 078a1abe342db1b063990e994056f74c1a542e5bbb0908c5e52ec708af51cfcb Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Wed, 17 Aug 2011 17:40:50 +0000 Subject: [PATCH] Added pcsc-perl-noSCardSetTimeout.patch. OBS-URL: https://build.opensuse.org/package/show/security:chipcard/perl-pcsc?expand=0&rev=3 --- pcsc-perl-noSCardSetTimeout.patch | 66 +++++++++++++++++++++++++++++++ perl-pcsc.spec | 3 ++ 2 files changed, 69 insertions(+) create mode 100644 pcsc-perl-noSCardSetTimeout.patch diff --git a/pcsc-perl-noSCardSetTimeout.patch b/pcsc-perl-noSCardSetTimeout.patch new file mode 100644 index 0000000..add0c94 --- /dev/null +++ b/pcsc-perl-noSCardSetTimeout.patch @@ -0,0 +1,66 @@ +Index: pcsc-perl-1.4.10/PCSC.xs +=================================================================== +--- pcsc-perl-1.4.10.orig/PCSC.xs ++++ pcsc-perl-1.4.10/PCSC.xs +@@ -369,13 +369,8 @@ _LoadPCSCLibrary () + hConnect = (TSCardConnect) GET_FCT (ghDll, "SCardConnect"); + hStatus = (TSCardStatus) GET_FCT (ghDll, "SCardStatus"); + hGetStatusChange = (TSCardGetStatusChange) GET_FCT (ghDll, "SCardGetStatusChange"); +- /* SetTimeout is not part of the original PCSC yet it is still important */ +- hSetTimeout = (TSCardSetTimeout) GET_FCT (ghDll, "SCardSetTimeout"); + #endif + if ( +-#ifndef WIN32 +- !hSetTimeout || +-#endif + !hEstablishContext || !hReleaseContext || !hListReaders || !hConnect || + !hReconnect || ! hDisconnect || !hBeginTransaction || !hEndTransaction || + !hTransmit || !hStatus || !hGetStatusChange || !hCancel || !hControl) +@@ -1329,8 +1324,7 @@ _Cancel (hContext) + #/////////////////////////////////////////////////////////////////////////////// + #// SetTimeout () + #// +-#// This function is only defined for PCSClite that is why we build a +-#// stub after the #else processing command ++#// This function is no more defined that is why we build a stub + #// + #// INPUT : + #// - $hContext -> +@@ -1338,30 +1332,6 @@ _Cancel (hContext) + #// OUTPUT : + #// returns either true or false depending on successful completion + +-#ifndef WIN32 +- +-unsigned long +-_SetTimeout (hContext, dwTimeout) +- unsigned long hContext; +- unsigned long dwTimeout; +- CODE: +- +- +- gnLastError = hSetTimeout (hContext, dwTimeout); +- +- /* Then we check for an error */ +- if (gnLastError != SCARD_S_SUCCESS) +- RETVAL = FALSE; +- else +- RETVAL = TRUE; +- OUTPUT: +- RETVAL +- +-#else +- +-#// Win32 does not implement SetTimeout therefore we simply define +-#// a stub. +- + unsigned long + _SetTimeout (hContext, dwTimeout) + unsigned long hContext; +@@ -1371,6 +1341,4 @@ _SetTimeout (hContext, dwTimeout) + OUTPUT: + RETVAL + +-#endif +- + # End of File # diff --git a/perl-pcsc.spec b/perl-pcsc.spec index df6e579..896a101 100644 --- a/perl-pcsc.spec +++ b/perl-pcsc.spec @@ -27,6 +27,8 @@ License: GPLv2+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/pcsc-perl/ Source: %{cpan_name}-%{version}.tar.bz2 +# PATCH-FIX-OPENSUSE pcsc-perl-noSCardSetTimeout.patch sbrabec@suse.cz -- Fix for the latest pcsc-lite. +Patch: pcsc-perl-noSCardSetTimeout.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %{perl_requires} BuildRequires: perl @@ -41,6 +43,7 @@ readers through a standardized API. %prep %setup -q -n %{cpan_name}-%{version} +%patch -p1 %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"