From a0d20333a6feba65c7a1582f40ba054398d33e69 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 22 Aug 2014 19:33:31 +0200 Subject: [PATCH 1/1] - new --- coolkey-includes.patch | 42 +++++++++++++++++++++ coolkey-pcsc.patch | 46 +++++++++++++++++++++++ coolkey-sh.patch | 14 +++++++ coolkey.spec | 83 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 185 insertions(+) create mode 100644 coolkey-includes.patch create mode 100644 coolkey-pcsc.patch create mode 100644 coolkey-sh.patch create mode 100644 coolkey.spec diff --git a/coolkey-includes.patch b/coolkey-includes.patch new file mode 100644 index 0000000..1e338e3 --- /dev/null +++ b/coolkey-includes.patch @@ -0,0 +1,42 @@ +--- coolkey-1.1.0/src/coolkey/log.cpp.orig 2007-02-14 20:54:01.000000000 +0100 ++++ coolkey-1.1.0/src/coolkey/log.cpp 2014-08-22 18:04:04.179081106 +0200 +@@ -23,6 +23,8 @@ + #include + #include "log.h" + #include ++#include ++#include + #include "PKCS11Exception.h" + #ifndef _WIN32 + #include "syslog.h" +--- coolkey-1.1.0/src/coolkey/machdep.cpp.orig 2007-02-14 01:46:28.000000000 +0100 ++++ coolkey-1.1.0/src/coolkey/machdep.cpp 2014-08-22 18:05:03.519078616 +0200 +@@ -20,6 +20,8 @@ + #include "machdep.h" + #include "mypkcs11.h" + #include "PKCS11Exception.h" ++#include ++#include + #ifdef _WIN32 + #include + #include +--- coolkey-1.1.0/src/coolkey/object.cpp.orig 2007-02-09 19:53:21.000000000 +0100 ++++ coolkey-1.1.0/src/coolkey/object.cpp 2014-08-22 18:05:30.302410825 +0200 +@@ -21,6 +21,7 @@ + #include "PKCS11Exception.h" + #include "object.h" + #include ++#include + + using std::find_if; + +--- coolkey-1.1.0/src/coolkey/slot.cpp.orig 2007-02-16 22:16:11.000000000 +0100 ++++ coolkey-1.1.0/src/coolkey/slot.cpp 2014-08-22 18:12:28.982393254 +0200 +@@ -26,6 +26,7 @@ + #include + #include "slot.h" + #include ++#include + #include "zlib.h" + #include "params.h" + diff --git a/coolkey-pcsc.patch b/coolkey-pcsc.patch new file mode 100644 index 0000000..a76b37a --- /dev/null +++ b/coolkey-pcsc.patch @@ -0,0 +1,46 @@ +--- coolkey-1.1.0/src/libckyapplet/cky_card.h.orig 2006-06-09 20:44:17.000000000 +0200 ++++ coolkey-1.1.0/src/libckyapplet/cky_card.h 2014-08-22 18:01:19.189088030 +0200 +@@ -41,23 +41,23 @@ CKYLIST_DECLARE(CKYReaderName, char *) + CKYLIST_DECLARE(CKYCardConnection, CKYCardConnection *) + + CKY_BEGIN_PROTOS +-void CKYReader_Init(SCARD_READERSTATE_A *reader); +-void CKYReader_FreeData(SCARD_READERSTATE_A *reader); ++void CKYReader_Init(SCARD_READERSTATE *reader); ++void CKYReader_FreeData(SCARD_READERSTATE *reader); + + /* +- * "Accessors": for SCARD_READERSTATE_A structure as a class. +- * These functions take an SCARD_READERSTATE_A which can also be referenced ++ * "Accessors": for SCARD_READERSTATE structure as a class. ++ * These functions take an SCARD_READERSTATE which can also be referenced + * directly. + */ +-CKYStatus CKYReader_SetReaderName(SCARD_READERSTATE_A *reader, const char *name); +-const char *CKYReader_GetReaderName(const SCARD_READERSTATE_A *reader); +-CKYStatus CKYReader_SetKnownState(SCARD_READERSTATE_A *reader, ++CKYStatus CKYReader_SetReaderName(SCARD_READERSTATE *reader, const char *name); ++const char *CKYReader_GetReaderName(const SCARD_READERSTATE *reader); ++CKYStatus CKYReader_SetKnownState(SCARD_READERSTATE *reader, + unsigned long state); +-unsigned long CKYReader_GetKnownState(const SCARD_READERSTATE_A *reader); +-unsigned long CKYReader_GetEventState(const SCARD_READERSTATE_A *reader); +-CKYStatus CKYReader_GetATR(const SCARD_READERSTATE_A *reader, CKYBuffer *buf); ++unsigned long CKYReader_GetKnownState(const SCARD_READERSTATE *reader); ++unsigned long CKYReader_GetEventState(const SCARD_READERSTATE *reader); ++CKYStatus CKYReader_GetATR(const SCARD_READERSTATE *reader, CKYBuffer *buf); + /* create an array of READERSTATEs from a LIST of Readers */ +-SCARD_READERSTATE_A *CKYReader_CreateArray(const CKYReaderNameList readerNames, ++SCARD_READERSTATE *CKYReader_CreateArray(const CKYReaderNameList readerNames, + unsigned long *readerCount); + /* frees the reader, then the full array */ + void CKYReader_DestroyArray(SCARD_READERSTATE *reader, unsigned long count); +@@ -88,7 +88,7 @@ CKYStatus CKYCardContext_FindReadersByAT + const CKYBuffer *targetATR); + /* return if any of the readers in our array has changed in status */ + CKYStatus CKYCardContext_WaitForStatusChange(CKYCardContext *context, +- SCARD_READERSTATE_A *readers, ++ SCARD_READERSTATE *readers, + unsigned long readerCount, + unsigned long timeout); + /* cancel any current operation (such as wait for status change) on this diff --git a/coolkey-sh.patch b/coolkey-sh.patch new file mode 100644 index 0000000..f53102b --- /dev/null +++ b/coolkey-sh.patch @@ -0,0 +1,14 @@ +--- coolkey-1.1.0/configure.in.orig 2007-02-16 20:50:50.000000000 +0100 ++++ coolkey-1.1.0/configure.in 2014-08-22 18:15:55.079051272 +0200 +@@ -124,9 +124,9 @@ + if test $WINDOWS -ne 1; then + PKG_CHECK_MODULES(NSS, nss, true, [ AC_MSG_ERROR(could not find NSS Crypto libraries) ]) + fi +- enable_pk11install = "yes" ++ enable_pk11install="yes" + else +- enable_pk11install = "no" ++ enable_pk11install="no" + AC_MSG_WARN([skipping pk11install]) + fi + diff --git a/coolkey.spec b/coolkey.spec new file mode 100644 index 0000000..d902b11 --- /dev/null +++ b/coolkey.spec @@ -0,0 +1,83 @@ +Summary: CoolKey PKCS #11 module +Summary(pl.UTF-8): Moduł PKCS #11 CoolKey +Name: coolkey +Version: 1.1.0 +Release: 1 +License: LGPL v2.1 +Group: Libraries +Source0: http://directory.fedoraproject.org/download/coolkey/%{name}-%{version}.tar.gz +# Source0-md5: 815a1811a46bf9b8782107c073149cbe +Patch0: %{name}-includes.patch +Patch1: %{name}-pcsc.patch +Patch2: %{name}-sh.patch +URL: http://directory.fedoraproject.org/wiki/CoolKey +BuildRequires: autoconf >= 2.52 +BuildRequires: automake +BuildRequires: libstdc++-devel +BuildRequires: libtool +# for obsolete pk11install +#BuildRequires: nss-devel +BuildRequires: pcsc-lite-devel +BuildRequires: pkgconfig +BuildRequires: zlib-devel +# dlopened +Requires: pcsc-lite-libs +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Linux Driver support for the CoolKey and CAC products. + +%description -l pl.UTF-8 +Wsparcie sterownika linuksowego dla produktów CoolKey oraz CAC. + +%package devel +Summary: Header files for CoolKey Applet library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki CoolKey Applet +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +Header files for CoolKey Applet library. + +%description devel -l pl.UTF-8 +Pliki nagłówkowe biblioteki CoolKey Applet. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%build +%{__libtoolize} +%{__aclocal} +%{__autoconf} +%{__autoheader} +%{__automake} +%configure +%{__make} + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%doc README +%attr(755,root,root) %{_libdir}/libckyapplet.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libckyapplet.so.1 +%attr(755,root,root) %{_libdir}/pkcs11/libcoolkeypk11.so + +%files devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libckyapplet.so +%{_includedir}/cky_*.h +%{_pkgconfigdir}/libckyapplet.pc -- 2.43.0