From 0ecd5de952e078961c47222fb8ad468ab685069f Mon Sep 17 00:00:00 2001 From: frankb Date: May 31 2007 05:56:14 +0000 Subject: first build for the new version --- diff --git a/.cvsignore b/.cvsignore index 2334e20..ab6f965 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -ctapi-cyberjack-2.0.14.tar.gz +ctapi-cyberjack-3.0.0beta1.tar.gz diff --git a/ctapi-cyberjack.spec b/ctapi-cyberjack.spec index 7a543e5..e87ae1d 100644 --- a/ctapi-cyberjack.spec +++ b/ctapi-cyberjack.spec @@ -1,18 +1,19 @@ Name: ctapi-cyberjack Summary: CT-API 1.1 driver for REINER SCT cyberjack USB chipcard reader -Version: 2.0.14 -Release: 2%{?dist} +Version: 3.0.0beta1 +Release: 1%{?dist} Requires: %{_libdir}/ctapi #ExcludeArch: x86_64 BuildRequires: libusb-devel readline-devel pcsc-lite-devel >= 1.3.0 -URL: http://downloads.sourceforge.net/libchipcard/ctapi-cyberjack-2.0.14b1.tar.gz +URL: http://mesh.dl.sourceforge.net/sourceforge/libchipcard/ctapi-cyberjack-3.0.0beta1.tar.gz License: LGPL Group: Development/Libraries Source0: %{name}-%{version}.tar.gz Source1: 91-cyberjack.rules +Source2: ctapi.h Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define readers_dir %(pkg-config libpcsclite --variable=usbdropdir) @@ -29,6 +30,11 @@ Requires: pcsc-lite Group: Development/Libraries Provides: pcsc-ifd-handler +%package tools +Summary: Some tools for the reader +Requires: %{name} = %{version} +Group: Applications/System + %description REINER SCT cyberJack pinpad/e-com USB user space driver @@ -59,6 +65,9 @@ Development files for libctapi-cyberjack %description pcsc Files for the PC/SC system. +%description tools +The tool for read the german Geldkarte and flash the firmware of the reader. + %prep %setup -q -n %{name}-%{version} @@ -73,8 +82,6 @@ make DESTDIR=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT%{_libdir}/ctapi mkdir -p $RPM_BUILD_ROOT%{_includedir}/ctapi-cyberjack mv $RPM_BUILD_ROOT%{_libdir}/libctapi-cyberjack* $RPM_BUILD_ROOT%{_libdir}/ctapi/ -#fix for missing file -install -c -m 644 ctapi/include/ctapi.h $RPM_BUILD_ROOT%{_includedir}/ctapi-cyberjack/ctapi.h # fix for crash when no X server running mv $RPM_BUILD_ROOT%{_sysconfdir}/cyberjack.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/cyberjack.conf sed -i "s\flags=0\flags=0x10000\1" $RPM_BUILD_ROOT%{_sysconfdir}/cyberjack.conf @@ -83,6 +90,8 @@ rm -f $RPM_BUILD_ROOT/sbin/udev.cyberjack.sh rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/99-cyberjack.rules #use my own udev file, because the orginal is more forSuSE install -c -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/91-cyberjack.rules +# add the header, because the orginal was removed +install -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/ctapi-cyberjack/ctapi.h %post pcsc #register PC/SC driver and restart daemon @@ -108,8 +117,6 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) # CT-API %{_libdir}/ctapi/libctapi-cyberjack.so.* -%{_bindir}/cjgeldkarte -%{_bindir}/ctsh %config %{_sysconfdir}/cyberjack.conf %config %{_sysconfdir}/udev/rules.d/91-cyberjack.rules @@ -124,12 +131,20 @@ rm -rf $RPM_BUILD_ROOT %files devel %defattr(0644,root,root) -%dir %{_includedir}/ctapi-cyberjack +%attr(0755,root,root)%dir %{_includedir}/ctapi-cyberjack %{_includedir}/ctapi-cyberjack/ctapi.h %{_libdir}/ctapi/libctapi-cyberjack.so %{_libdir}/ctapi/libctapi-cyberjack.la +%files tools +%defattr(0755,root,root) +%{_bindir}/cjgeldkarte +%{_bindir}/cjflash + %changelog +* Thu May 08 2007 Frank Büttner - 3.0.0beta1-1%{?dist} +- first build for the new version + * Fri May 04 2007 Frank Büttner - 2.0.14-2%{?dist} - rebuild for the ppc64 arch diff --git a/ctapi.h b/ctapi.h new file mode 100644 index 0000000..bb80299 --- /dev/null +++ b/ctapi.h @@ -0,0 +1,112 @@ +/*************************************************************************** + * CT-API library for the REINER SCT cyberJack pinpad/e-com USB. + * Copyright (C) 2001 REINER SCT + * Author: Matthias Bruestle + * Support: support@reiner-sct.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * File: ctapi.h + * CVS: $Id$ + ***************************************************************************/ + +#ifndef H_CTAPI +#define H_CTAPI + +/* More uniqe defines */ + +#define CT_API_AD_HOST 2 +#define CT_API_AD_REMOTE 5 + +#define CT_API_AD_CT 1 +#define CT_API_AD_ICC1 0 +#define CT_API_AD_ICC2 2 +#define CT_API_AD_ICC3 3 +#define CT_API_AD_ICC4 4 +#define CT_API_AD_ICC5 5 +#define CT_API_AD_ICC6 6 +#define CT_API_AD_ICC7 7 +#define CT_API_AD_ICC8 8 +#define CT_API_AD_ICC9 9 +#define CT_API_AD_ICC10 10 +#define CT_API_AD_ICC11 11 +#define CT_API_AD_ICC12 12 +#define CT_API_AD_ICC13 13 +#define CT_API_AD_ICC14 14 + +#define CT_API_RV_OK 0 +#define CT_API_RV_ERR_INVALID -1 +#define CT_API_RV_ERR_CT -8 +#define CT_API_RV_ERR_TRANS -10 +#define CT_API_RV_ERR_MEMORY -11 +#define CT_API_RV_ERR_HOST -127 +#define CT_API_RV_ERR_HTSI -128 + +/* MUSCLE style defines */ + +#define OK 0 /* Success */ +#define ERR_INVALID -1 /* Invalid Data */ +#define ERR_CT -8 /* CT Error */ +#define ERR_TRANS -10 /* Transmission Error */ +#define ERR_MEMORY -11 /* Memory Allocate Error */ +#define ERR_HOST -127 /* Host Error */ +#define ERR_HTSI -128 /* HTSI Error */ + +#define PORT_COM1 0 /* COM 1 */ +#define PORT_COM2 1 /* COM 2 */ +#define PORT_COM3 2 /* COM 3 */ +#define PORT_COM4 3 /* COM 4 */ +#define PORT_Printer 4 /* Printer Port (MAC) */ +#define PORT_Modem 5 /* Modem Port (MAC) */ +#define PORT_LPT1 6 /* LPT 1 */ +#define PORT_LPT2 7 /* LPT 2 */ + +#define CT 1 +#define HOST 2 + +// Short +#define CJ_CTAPI_MAX_LENC 4+1+255+1 +#define CJ_CTAPI_MAX_LENR 256+2 +// Extended +//#define CJ_CTAPI_MAX_LENC 5+2+65535+2 +//#define CJ_CTAPI_MAX_LENR 65536+2 +// Maximum for CTAPI +//#define CJ_CTAPI_MAX_LENC 65535 +//#define CJ_CTAPI_MAX_LENR 65535 + + +typedef unsigned char IU8; +typedef unsigned short IU16; + +typedef signed char IS8; +typedef signed short IS16; + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +IS8 CT_init( IU16 ctn, IU16 pn ); +IS8 CT_data( IU16 ctn, IU8 *dad, IU8 *sad, IU16 lenc, IU8 *command, IU16 *lenr, + IU8 *response ); +IS8 CT_close( IU16 ctn ); + +/* Proprietary extension */ +IS8 CT_keycb( IU16 ctn, void (* cb)(IU16 ctn, IU8 status) ); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* H_CTAPI */ + diff --git a/sources b/sources index a20138b..24c308e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -21f244b849205dcabdcb90cb1eebb4ff ctapi-cyberjack-2.0.14.tar.gz +f5835724e949bfc2402df92f5de12282 ctapi-cyberjack-3.0.0beta1.tar.gz