File pcsc-cyberjack.spec of Package pcsc-cyberjack

#
# spec file for package pcsc-cyberjack (Version 3.3.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           pcsc-cyberjack
%define _name ctapi-cyberjack
BuildRequires:  dummy-release gcc-c++ hal hal-devel pcsc-lite-devel pkg-config readline-devel
%if %suse_version > 1020
BuildRequires:  libusb-devel licenses
%endif
%if %suse_version > 1100
BuildRequires:  sysfsutils
%endif
Version:        3.3.0
Release:        3
Provides:       locale(MozillaFirefox:de_BE;en_BE;fr_BE;nl_BE;wa_BE)
Group:          Productivity/Security
License:        LGPL v2.1 or later
Url:            http://www.reiner-sct.de/support/treiber_cyberjack.php
Summary:        PC/SC IFD Handler for the Reiner SCT Cyberjack USB-SmartCard Reader
Source0:        %{_name}-%{version}.tar.bz2
Patch1:         configure.patch
Patch2:         pcsc-cyberjack-libpath.patch
Patch3:         ctapi-cyberjack-overflow.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %suse_version > 1020
%define ifddir %(pkg-config --variable=usbdropdir libpcsclite)
%else
%define ifddir %{_libdir}/readers
%endif

%description
This package includes the PC/SC IFD handler for the Reiner SCT
Cyberjack pinpad/e-com USB chipcard reader.

This driver is meant to be used with the PCSC-Lite daemon from the
pcsc-lite package.

For more information about the reader and software updates see:

http://www.reiner-sct.de/db/reiner-sct.de/html/e-com.html
http://www.reiner-sct.de/db/reiner-sct.de/html/pinpad.html



Authors:
--------
    Matthias Bruestle <m@mbsks.franken.de>

%package -n ctapi-cyberjack
License:        LGPL v2.1 or later
Group:          System/Libraries
Summary:        CT-API and tools for Reiner SCT Cyberjack USB-SmartCard Reader
# Modules: cyberjack.ko
Supplements:    modalias(usb:v0C4Bp0100d*dc*dsc*dp*ic*isc*ip*)
# Generated with: extract-modaliases -i cyberjack kernel-default.rpm

%description -n ctapi-cyberjack
REINER SCT Cyberjack pinpad/e-com USB user space driver. This package
includes the CT-API driver for the Cyberjack pinpad/e-com USB chipcard
reader and some tools as a simple CT shell around it.

For more information about the reader, software updates, and more see:

http://www.reiner-sct.de/db/reiner-sct.de/html/e-com.html
http://www.reiner-sct.de/db/reiner-sct.de/html/pinpad.html



Authors:
--------
    Matthias Bruestle <m@mbsks.franken.de>

%prep
%setup -q -n %{_name}-%{version}
# configure.patch (this together with --enable-udev=no enables hal)
%patch1
%patch2
%patch3
%if %suse_version > 1030
sed -i 's/key="info.category" string="usbraw"/key="info.subsystem" string="usb_device"/;s/@info.parent://;' etc/hal/80-cyberjack.fdi
%endif
%if %suse_version == 1030
sed -i 's/key="info.category" string="usbraw"/key="info.bus" string="usb_device"/;s/@info.parent://;' etc/hal/80-cyberjack.fdi
%endif

%build
%configure\
	--enable-release\
	--libdir=%{ifddir}\
	--enable-udev=no
make %{?jobs:-j%jobs}

%install
%makeinstall
# symlinks (workaround for #336707)
# FIXME: Code should use compile time linking or fix paths.
for lib in $RPM_BUILD_ROOT%{ifddir}/*so* ; do
  ln -s readers/$(basename $lib) $RPM_BUILD_ROOT%{_libdir}/$(basename $lib)
done
# clean up
rm $RPM_BUILD_ROOT/%{ifddir}/libctapi-cyberjack.la
rm $RPM_BUILD_ROOT/%{ifddir}/pcsc/drivers/ifd-cyberjack.bundle/Contents/Linux/ifd-cyberjack.la
rm $RPM_BUILD_ROOT/%{ifddir}/cyberjack/getdist.sh
mv $RPM_BUILD_ROOT/%{ifddir}/pcsc/drivers/ifd-cyberjack.bundle $RPM_BUILD_ROOT/%{ifddir}
mv $RPM_BUILD_ROOT/%{_sysconfdir}/cyberjack.conf{.default,}
%if %suse_version > 1020
for FILE in COPYING COPYRIGHT.GPL COPYRIGHT.LGPL ; do
  MD5SUM=$(md5sum $FILE | sed 's/ .*//')
  if test -f /usr/share/doc/licenses/md5/$MD5SUM ; then
    ln -sf /usr/share/doc/licenses/md5/$MD5SUM $FILE
  fi
done
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc COPYRIGHT.GPL COPYRIGHT.LGPL
%dir %{ifddir}
%{ifddir}/ifd-cyberjack.bundle

%files -n ctapi-cyberjack
%defattr(-,root,root,755)
%doc COPYRIGHT.GPL COPYRIGHT.LGPL doc/README.* doc/LIESMICH.* NEWS
%dir %{ifddir}
%{ifddir}/*.so*
%{_libdir}/*.so*
%{_bindir}/*
%{_sysconfdir}/hal/fdi/policy/10osvendor/*.fdi
%config(noreplace) %{_sysconfdir}/cyberjack.conf
# FIXME: should be owned by hal:
%dir %{_sysconfdir}/hal/fdi/policy/10osvendor

%changelog
* Fri Sep 19 2008 ro@suse.de
- replacing openSUSE-release with dummy-release in buildreq
- patch configure, parsing /etc/SuSE-release is a really bad idea
* Mon Sep 08 2008 sbrabec@suse.cz
- Update to version 3.3.0:
  * improves support for rdesktop
  * fixes some PC/SC-related bugs
  * implements FEATURE_MCT_READER_DIRECT
  * support for latest versions of pcsclite which rely on libHAL
* Thu Jul 31 2008 wr@opensuse.org
- Update to version 3.3.0beta4:
  * IFD handler works correctly again (#413282)
- Fixed hal rules for openSUSE 11.0
* Thu May 08 2008 schwab@suse.de
- Fix configure script.
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Fri Apr 04 2008 sbrabec@suse.cz
- Updated to version 3.1.0:
  * introduces a new method of selecting devices by serial number.
  * adds support for Cyberjacks connected via serial cable.
  * fixes a problem with the APDU 20,10 and Ecom(a).
  * special handling for port values 0x9000 and above.
  * with the latest firmware should fix the problems Cyberjack Ecom
  (a).
  * Bug fixes.
* Tue Dec 04 2007 sbrabec@suse.cz
- Updated to version 3.0.5:
  * fixes a bug which makes Moneyplex unable to read cards with new
  ecoms
  * enables reading of German medical cards with 0x400 devices
  * introduces a workaround for hanging USB hardware
  * fixes a bug in the USB logging code
  * fixes bug which can cause the driver to crash
- Fixed hal rules for OpenSUSE >= 10.3 (#336704).
- Added symlinks to work-around incorrect dynamic linking
  (#336707).
* Tue Jul 31 2007 sbrabec@suse.cz
- Detect SuSE distribution correctly.
* Thu Jul 26 2007 sbrabec@suse.cz
- Updated package from Build Service security:chipcard.
* Mon Jul 23 2007 wr@rosenauer.org
- update to version 3.0.3
- added 10.2 to configure options
- removed rpath patch since it doesn't work anymore
* Wed May 16 2007 olh@suse.de
- Remove unneded Requires libusb
* Tue Apr 17 2007 sbrabec@suse.cz
- Updated package from Build Service security:chipcard (#264252).
- Spec file cleanup.
* Wed Apr 11 2007 wr@rosenauer.org
- update to version 2.0.14
  * ctapi.h is not packaged anymore (someone need it?)
* Tue Jan 09 2007 wr@rosenauer.org
- update to version 2.0.13
* Thu Dec 28 2006 wr@rosenauer.org
- update to version 2.0.13beta5
* Thu Dec 21 2006 wr@rosenauer.org
- update to version 2.0.13beta3
* Mon Aug 07 2006 stark@suse.de
- added HAL config to map the reader to usb resmgr class (#191958)
* Sat May 06 2006 kukuk@suse.de
- Fix inclusion of kernel headers
* Sun Apr 02 2006 sndirsch@suse.de
- added missing locale provides (Bug #161867)
* Mon Mar 27 2006 schwab@suse.de
- Fix building of shared libs.
* Wed Mar 08 2006 agruen@suse.de
- Add modalias tags (155357).
* Thu Mar 02 2006 stark@suse.de
- update to version 2.0.10
  * version 2.0.9 almost crashed everytime accessing the reader
  * added wrapper/Extension code to libusb-0.1 to support
  asynchronous requests
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 06 2006 stark@suse.de
- fixed file modes of executables
* Wed Jan 04 2006 stark@suse.de
- readded rpath and make options patches
* Tue Jan 03 2006 mjancar@suse.cz
- move to separate source package
* Mon Jan 02 2006 stark@suse.de
- removed obsolete hotplug stuff for cyberjack
- Updated pcsc-lite to version 1.2.9-beta9
- Updated CCID driver to 0.9.4
- Updated GemPC driver to 1.0.0
- package pkgconfig files to be able to build drivers outside
  the package
* Tue Dec 20 2005 ro@suse.de
- removed unpackaged man-page symlinks
* Tue Nov 29 2005 ro@suse.de
- remove keeper from nfb (unused)
* Mon Oct 10 2005 stark@suse.de
- Updated towitoko driver to 2.0.7 and install USB bundle
* Thu Sep 22 2005 stark@suse.de
- Repackaged CCID as bundle for USB usage (#116497)
* Tue Sep 20 2005 stark@suse.de
- handle old reader.conf in upgrade case
- compile with -fno-strict-aliasing
- fixed missing return in ctapi-cyberjack
* Sat Sep 17 2005 stark@suse.de
- Updated pcsc-lite to version 1.2.9beta8 (#116497)
  * use /etc/reader.conf.d/
  * adapted init script to create /etc/reader.conf
- Updated cyberjack driver to version 2.0.9
  * use rpath for cyberjack tools
- Updated ccid driver to version 0.9.3 (#116497)
- Use RPM_OPT_FLAGS everywhere
- Fixed serious compiler warnings
* Mon Sep 05 2005 skh@suse.de
- fix off-by-one error in hotplug_libusb.c [#112964]
* Mon Aug 29 2005 skh@suse.de
- Remove unnecessary files from pcsc-acr38 again [#112927]
* Mon Aug 29 2005 skh@suse.de
- package ACR38 driver in correct bundle format [#112927]
- remove orphaned /var/run/pcscd.pub when necessary [#112928]
- update ACR38u driver to version 100705 to fix crash when reader
  is plugged in [#112964]
* Tue Aug 16 2005 skh@suse.de
- Updated ACR38u driver to version 100703
* Tue Jul 26 2005 okir@suse.de
- Added ACR38u driver
* Tue Jul 26 2005 okir@suse.de
- Updated description in init script (#79287)
* Thu Jun 16 2005 meissner@suse.de
- use RPM_OPT_FLAGS in 1 more driver
- added includes to avoid implict declaration of memcpy and similar.
* Mon Apr 18 2005 ro@suse.de
- make it build with gcc-4
* Thu Mar 17 2005 okir@suse.de
- Disable support for extended-apdus, it eats 32MB of memory (#73629)
* Thu Mar 10 2005 okir@suse.de
- Fix default search location for USB bundles
* Fri Jan 21 2005 okir@suse.de
- Updated to latest upstream version
- Updated several drivers
- Added CCID driver
- Provide a more informative readers.conf file (#42620)
* Thu Jan 20 2005 ro@suse.de
- drop subpackage gpr400
* Wed Apr 28 2004 ro@suse.de
- compile formaticc with no-strict-aliasing
- fix unused return type in musclecard.c
* Wed Mar 31 2004 okir@suse.de
- Properly install testpcsc, formaticc (#37625)
- Build towitoko driver with --enable-win32-com
* Thu Mar 18 2004 okir@suse.de
- cyberjack apps installed in /bin should be executable (#36409)
* Sat Jan 10 2004 adrian@suse.de
- add %%run_ldconfig
* Tue Aug 05 2003 mge@suse.de
- merge ctapi-cyberjack into pcsc-lite: two additional
  packages are created: ctapi-cyberjack and pcsc-cyberjack
* Thu Jun 26 2003 ro@suse.de
- remove unpackaged files from buildroot
- added directories to filelist
* Fri Nov 29 2002 okir@suse.de
- added -fPIC when building eToken driver
* Fri Nov 29 2002 okir@suse.de
- Updated to latest upstream version
- Included driver for Aladdin eToken PRO
- More GNU auto#*@! headaches
- Various minor fixes
* Wed Aug 28 2002 okir@suse.de
- Moved shared objects to /usr/lib64 on ppc64/s390x (#18421)
* Mon Aug 05 2002 olh@suse.de
- fix initscript, Should-start: setserial hotplug
* Fri Aug 02 2002 okir@suse.de
- added PreReq for insserv_and_fillup
* Wed Jul 31 2002 okir@suse.de
- fixed build problem on s390x (force aclocal.m4 regen)
* Wed Jun 26 2002 ro@suse.de
- use -fPIC when building a shared lib
* Wed Jun 12 2002 okir@suse.de
- fix for bug #15051 (hey, it's a palindrome bug:):
  missing %%doc DRIVERS file; misc silly binaries moved
  out of /usr/bin
* Tue Apr 30 2002 okir@suse.de
- Fixed build problem introduced by previous patch
* Tue Apr 30 2002 okir@suse.de
- updated to latest upstream version
- added drivers for these readers: Towitoko, Schlumberger Reflex 6x,
  Gemplus GPR 400, GemPlus GemPC 410/430
* Tue Apr 09 2002 ro@suse.de
- fixed for latest automake/autoconf
* Wed Feb 13 2002 stark@suse.de
- spec-file cleanup
- LSB compliant init-script
* Mon Jan 14 2002 ro@suse.de
- removed START_PCSCD
* Wed Nov 14 2001 ro@suse.de
- call aclocal
* Sun Aug 26 2001 mge@suse.de
- updated to 1.0.0Beta
- fixed /etc/init.d/pcscd status-handling (bug #9069)
* Thu Jun 07 2001 ro@suse.de
- fix broken Makefile.am
* Mon Apr 23 2001 mge@suse.de
- update to 0.9.1
* Thu Apr 19 2001 mge@suse.de
- created package
openSUSE Build Service is sponsored by