packages: libcacard/libcacard-pcsc.patch (NEW), libcacard/libcacard-sh.patc...

qboosh qboosh at pld-linux.org
Sat Jul 16 20:20:14 CEST 2011


Author: qboosh                       Date: Sat Jul 16 18:20:14 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- new package
- sh patch to fix build with sh not being bash
- pcsc patch to fix build passthru interface (typo fix, includes fix, update for pcsc-lite 1.6+)

---- Files affected:
packages/libcacard:
   libcacard-pcsc.patch (NONE -> 1.1)  (NEW), libcacard-sh.patch (NONE -> 1.1)  (NEW), libcacard.spec (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/libcacard/libcacard-pcsc.patch
diff -u /dev/null packages/libcacard/libcacard-pcsc.patch:1.1
--- /dev/null	Sat Jul 16 20:20:14 2011
+++ packages/libcacard/libcacard-pcsc.patch	Sat Jul 16 20:20:09 2011
@@ -0,0 +1,94 @@
+--- libcacard-0.1.2/passthru.c.orig	2010-12-09 12:36:19.000000000 +0100
++++ libcacard-0.1.2/passthru.c	2011-07-16 13:10:29.302870462 +0200
+@@ -9,6 +9,8 @@
+ #include "mutex.h"
+ #include "vcard_emul.h"
+ #include "passthru.h"
++#include <stdint.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <pcsclite.h>
+@@ -325,8 +327,8 @@
+ /*
+  *  Get the state entry that matches this reader. If none found, return NULL
+  */
+-static SCARD_READERSTATE_A *
+-passthru_get_reader_state(SCARD_READERSTATE_A *reader_states,
++static SCARD_READERSTATE *
++passthru_get_reader_state(SCARD_READERSTATE *reader_states,
+                           int reader_count, char *name)
+ {
+     int i;
+@@ -349,8 +351,8 @@
+ /*
+  * find a card slot that has been cleared out
+  */
+-static SCARD_READERSTATE_A *
+-passthru_get_blank_reader(SCARD_READERSTATE_A *reader_states, int reader_count)
++static SCARD_READERSTATE *
++passthru_get_blank_reader(SCARD_READERSTATE *reader_states, int reader_count)
+ {
+     return passthru_get_reader_state(reader_states,  reader_count, NULL);
+ }
+@@ -365,7 +367,7 @@
+ {
+     char *reader_list = NULL;
+     int reader_list_len = 0;
+-    SCARD_READERSTATE_A *reader_states = NULL;
++    SCARD_READERSTATE *reader_states = NULL;
+     int reader_count = 0;     /* number of active readers */
+     int max_reader_count = 0; /* size of the reader_state array (including
+                                  inactive readers) */
+@@ -414,7 +416,7 @@
+             /* count the readers and mark the ones that are still with us */
+             for (reader_entry = new_reader_list; *reader_entry;
+                  reader_entry += strlen(reader_entry)+1) {
+-                SCARD_READERSTATE_A *this_state;
++                SCARD_READERSTATE *this_state;
+                 new_reader_count++;
+                 /* if the reader is still on the list, mark it present */
+                 this_state = passthru_get_reader_state(reader_states,
+@@ -441,7 +443,7 @@
+                  * array up into those locations vacated by ejected readers. */
+                 for (i=reader_count-1; i < (new_reader_count -1); i--) {
+                         if (reader_states[i].szReader) {
+-                            SCARD_READERSTATE_A *blank_reader;
++                            SCARD_READERSTATE *blank_reader;
+                             blank_reader =
+                                 passthru_get_blank_reader(reader_states,
+                                                           new_reader_count);
+@@ -453,12 +455,12 @@
+             }
+             /* handle the growing list */
+             if (new_reader_count >  max_reader_count) {
+-                SCARD_READERSTATE_A *new_reader_states;
++                SCARD_READERSTATE *new_reader_states;
+ 
+                 /* grow the list */
+                 new_reader_states =
+-                    (SCARD_READERSTATE_A *)realloc(reader_states,
+-                        sizeof(SCARD_READERSTATE_A)*new_reader_count);
++                    (SCARD_READERSTATE *)realloc(reader_states,
++                        sizeof(SCARD_READERSTATE)*new_reader_count);
+                 if (new_reader_states) {
+                     /* successful, update our current state */
+                     reader_states = new_reader_states;
+@@ -477,7 +479,7 @@
+             /* now walk the reader list, updating the state */
+             for (reader_entry = new_reader_list; *reader_entry;
+                  reader_entry += strlen(reader_entry)+1) {
+-                SCARD_READERSTATE_A *this_state;
++                SCARD_READERSTATE *this_state;
+                 this_state = passthru_get_reader_state(reader_states,
+                                                        new_reader_count,
+                                                        reader_entry);
+@@ -528,7 +530,7 @@
+                 return; /* exit thread */
+             }
+             status = passthru_pcsc_lite_init();
+-            assert(status == CARD_DONE);
++            assert(status == VCARD_DONE);
+             sleep(1);
+             continue;
+         }

================================================================
Index: packages/libcacard/libcacard-sh.patch
diff -u /dev/null packages/libcacard/libcacard-sh.patch:1.1
--- /dev/null	Sat Jul 16 20:20:14 2011
+++ packages/libcacard/libcacard-sh.patch	Sat Jul 16 20:20:09 2011
@@ -0,0 +1,28 @@
+--- libcacard-0.1.2/configure.ac.orig	2011-02-03 16:03:10.000000000 +0100
++++ libcacard-0.1.2/configure.ac	2011-07-16 12:54:44.076172146 +0200
+@@ -28,14 +28,14 @@
+ dnl =========================================================================
+ dnl Check deps
+ 
+-CAC_CARD_NONPKGCONFIG_LIBS+=" -pthread"
++CAC_CARD_NONPKGCONFIG_LIBS="$CAC_CARD_NONPKGCONFIG_LIBS -pthread"
+ 
+ CAC_CARD_REQUIRES=""
+ 
+ PKG_CHECK_MODULES(NSS, nss)
+ AC_SUBST(NSS_CFLAGS)
+ AC_SUBST(NSS_LIBS)
+-CAC_CARD_REQUIRES+=" nss"
++CAC_CARD_REQUIRES="$CAC_CARD_REQUIRES nss"
+ 
+ 
+ AS_IF([test "$_cflags_is_set" = "yes"], [], [
+@@ -78,7 +78,7 @@
+ PKG_CHECK_MODULES(PCSC,libpcsclite)
+ AC_SUBST(PCSC_CFLAGS)
+ AC_SUBST(PCSC_LIBS)
+-CAC_CARD_REQUIRES+=" pcsc-lite"
++CAC_CARD_REQUIRES="$CAC_CARD_REQUIRES pcsc-lite"
+ USE_PASSTHRU=-DUSE_PASSTHRU
+ AC_SUBST(USE_PASSTHRU)
+ fi

================================================================
Index: packages/libcacard/libcacard.spec
diff -u /dev/null packages/libcacard/libcacard.spec:1.1
--- /dev/null	Sat Jul 16 20:20:14 2011
+++ packages/libcacard/libcacard.spec	Sat Jul 16 20:20:09 2011
@@ -0,0 +1,121 @@
+# $Revision$, $Date$
+Summary:	Virtual Smart Card Emulator library
+Summary(pl.UTF-8):	Biblioteka emulator wirtualnych kart procesorowych
+Name:		libcacard
+Version:	0.1.2
+Release:	1
+License:	GPL v3
+Group:		Libraries
+Source0:	http://spice-space.org/download/libcacard/%{name}-%{version}.tar.gz
+# Source0-md5:	d06480131936ea45a60e98c87b2bb4d9
+Patch0:		%{name}-sh.patch
+Patch1:		%{name}-pcsc.patch
+URL:		http://spice-space.org/
+BuildRequires:	autoconf >= 2.60
+BuildRequires:	automake
+BuildRequires:	libtool
+BuildRequires:	nss-devel
+BuildRequires:	pcsc-lite-devel >= 1.6
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This emulator is designed to provide emulation of actual smart cards
+to a virtual card reader running in a guest virtual machine. The
+emulated smart cards can be representations of real smart cards, where
+the necessary functions such as signing, card removal/insertion, etc.
+are mapped to real, physical cards which are shared with the client
+machine the emulator is running on, or the cards could be pure
+software constructs.
+
+%description -l pl.UTF-8
+Ten pakiet ma na celu zapewnienie emulacji kart procesorowych w
+wirtualnym czytniku kart działającym na wirtualnej maszynie-gościu.
+Emulowane karty procesorowe mogą reprezentować prawdziwe karty
+procesorowe, których potrzebne funkcje, takie jak podpisywanie,
+wyjęcie/włożenie karty itp. są odwzorowywane na prawdziwe karty
+współdzielone z maszyną kliencką, na której działa emulator, lub
+karty czysto programowe.
+
+%package devel
+Summary:	Header files for cacard library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki cacard
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	nss-devel
+Requires:	pcsc-lite-devel >= 1.6
+
+%description devel
+Header files for cacard library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki cacard.
+
+%package static
+Summary:	Static cacard library
+Summary(pl.UTF-8):	Statyczna biblioteka cacard
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static cacard library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka cacard.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	--enable-passthru
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcacard.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS README
+%attr(755,root,root) %{_bindir}/vscclient
+%attr(755,root,root) %{_libdir}/libcacard.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcacard.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libcacard.so
+%{_includedir}/cacard
+%{_pkgconfigdir}/libcacard.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libcacard.a
+
+%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1  2011/07/16 18:20:09  qboosh
+- new package
+- sh patch to fix build with sh not being bash
+- pcsc patch to fix build passthru interface (typo fix, includes fix, update for pcsc-lite 1.6+)
================================================================


More information about the pld-cvs-commit mailing list