]> git.pld-linux.org Git - packages/libcacard.git/commitdiff
- new package
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 16 Jul 2011 18:20:09 +0000 (18:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- 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+)

Changed files:
    libcacard-pcsc.patch -> 1.1
    libcacard-sh.patch -> 1.1
    libcacard.spec -> 1.1

libcacard-pcsc.patch [new file with mode: 0644]
libcacard-sh.patch [new file with mode: 0644]
libcacard.spec [new file with mode: 0644]

diff --git a/libcacard-pcsc.patch b/libcacard-pcsc.patch
new file mode 100644 (file)
index 0000000..b11b17d
--- /dev/null
@@ -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;
+         }
diff --git a/libcacard-sh.patch b/libcacard-sh.patch
new file mode 100644 (file)
index 0000000..9b34bad
--- /dev/null
@@ -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
diff --git a/libcacard.spec b/libcacard.spec
new file mode 100644 (file)
index 0000000..7fd5713
--- /dev/null
@@ -0,0 +1,109 @@
+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
This page took 0.115629 seconds and 4 git commands to generate.