File pcsc-cyberjack.spec of Package pcsc-cyberjack
#
# spec file for package pcsc-cyberjack (Version 3.3.5)
#
# Copyright (c) 2010 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: distribution-release gcc-c++ hal-devel pcsc-lite-devel pkg-config readline-devel
%if %suse_version >= 1120
BuildRequires: libusb-1_0-devel
%endif
%if %suse_version > 1020
BuildRequires: libusb-devel licenses
%endif
Version: 3.3.5
Release: 4
Group: Productivity/Security
License: LGPLv2.1+
Url: http://www.reiner-sct.de/support/treiber_cyberjack.php
Summary: PC/SC IFD Handler for the Reiner SCT Cyberjack USB-SmartCard Reader
Source: %{_name}-%{version}.tar.bz2
Source1: %{name}-README.SUSE
Source2: 40-cyberjack.rules
Source3: baselibs.conf
Patch1: ctapi-cyberjack-configure.patch
Patch6: ctapi-cyberjack-check.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: pcsc-lite
%if %suse_version > 1020
Requires: licenses
%endif
%if %suse_version > 1020
%define ifddir %(pkg-config --variable=usbdropdir libpcsclite)
%else
%define ifddir %{_libdir}/readers
%endif
%define LBRACE (
%define RBRACE )
%define QUOTE "
%define BACKSLASH \\
%define USBDRIVERS %(set -x ; bunzip2 <%{S:0} | tr a-z A-Z | sed -n 's/^ACTION=="ADD", SUBSYSTEM=="USB", ENV{PRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^{QUOTE}%{BACKSLASH}/]*%{BACKSLASH}%{RBRACE}%{BACKSLASH}/%{BACKSLASH}%{LBRACE}[^{QUOTE}]*%{BACKSLASH}%{RBRACE}%{BACKSLASH}/%{BACKSLASH}*%{QUOTE}.*$/modalias%{LBRACE}usb:v0%{BACKSLASH}1p0%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ')
Supplements: %USBDRIVERS
%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
%package -n ctapi-cyberjack
License: LGPLv2.1+
Group: System/Libraries
Summary: CT-API and tools for Reiner SCT Cyberjack USB-SmartCard Reader
%if %suse_version > 1020
Requires: licenses
%endif
# Modules: cyberjack.ko
Supplements: %USBDRIVERS
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
%prep
%setup -q -n %{_name}-%{version}
cp -a %{S:1} README.SUSE
%patch1
%patch6 -p1
# No patching needed for openSUSE >= 11.2 and above: Use udev.
%if %suse_version < 1120
%if %suse_version >= 1110
# openSUSE >= 11.1: No resmgr, use HAL capabilities, which does it for us using HAL ACL, USB us "subsystem".
# NOTE: openSUSE 11.1 does not support smart_card_reader HAL ACL category yet.
sed -i 's/key="info.category" string="usbraw"/key="info.subsystem" string="usb"/;s/@info.parent:usb_device/usb/;
s:^\([[:space:]]*\)<merge key="resmgr.class" type="string">usb</merge>:\1<merge key="info.category" type="string">smart_card_reader</merge>\
\1<append key="info.capabilities" type="strlist">smart_card_reader</append>:' etc/hal/80-cyberjack.fdi
sed -i 's:haldir=/etc/hal/fdi/policy/10osvendor:haldir=/usr/share/hal/fdi/information/20thirdparty:' etc/hal/Makefile.am
%else
%if %suse_version > 1030
# openSUSE > 10.3: USB is "subsystem", not "bus"
sed -i 's/key="info.category" string="usbraw"/key="info.subsystem" string="usb_device"/;s/@info.parent://;' etc/hal/80-cyberjack.fdi
%else
%if %suse_version == 1030
# openSUSE == 10.3: USB is "bus", not abusing "category" any more
sed -i 's/key="info.category" string="usbraw"/key="info.bus" string="usb_device"/;s/@info.parent://;' etc/hal/80-cyberjack.fdi
%endif
%endif
%endif
%endif
%build
%if %suse_version >1030
ACLOCAL="aclocal -I m4" autoreconf -f -i
%endif
%configure\
--disable-static\
--enable-release\
%if %suse_version < 1120
--enable-udev=no\
%endif
--with-usbdropdir=%{ifddir}
make %{?jobs:-j%jobs}
%install
%makeinstall
%if %suse_version >= 1120
mkdir -p $RPM_BUILD_ROOT/lib/udev/rules.d/
install %{SOURCE2} $RPM_BUILD_ROOT/lib/udev/rules.d/
rm $RPM_BUILD_ROOT%{_sysconfdir}/hal/fdi/policy/10osvendor/80-cyberjack.fdi
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/hal/fdi/policy/10osvendor
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/hal/fdi/policy
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/hal/fdi
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/hal
%endif
# symlinks (workaround for #336707)
for lib in $RPM_BUILD_ROOT%{_libdir}/libctapi-cyberjack*so* ; do
ln -s %{_libdir}/$(basename $lib) $RPM_BUILD_ROOT%{ifddir}/$(basename $lib)
done
# clean up
rm $RPM_BUILD_ROOT%{_libdir}/libcyberjack.la
rm $RPM_BUILD_ROOT%{_libdir}/libctapi-cyberjack.la
rm $RPM_BUILD_ROOT%{ifddir}/ifd-cyberjack.bundle/Contents/Linux/ifd-cyberjack.la
mv $RPM_BUILD_ROOT%{_sysconfdir}/cyberjack.conf{.default,}
%if %suse_version > 1020
# licenses
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
%post -n ctapi-cyberjack -p /sbin/ldconfig
%postun -n ctapi-cyberjack -p /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir %{ifddir}
%{ifddir}/ifd-cyberjack.bundle
%files -n ctapi-cyberjack
%defattr(-,root,root)
%doc COPYRIGHT.GPL COPYRIGHT.LGPL doc/README.* README.SUSE doc/LIESMICH.* ChangeLog NEWS
%dir %{ifddir}
%{ifddir}/*.so*
%{_libdir}/*.so*
%{_libdir}/cyberjack
%{_bindir}/*
%if %suse_version >= 1120
/lib/udev/rules.d/*
%else
%if %suse_version < 1120
%if %suse_version > 1100
%{_datadir}/hal/fdi/information/20thirdparty/*.fdi
%else
%{_sysconfdir}/hal/fdi/policy/10osvendor/*.fdi
%dir %{_sysconfdir}/hal/fdi/policy/10osvendor
%endif
%endif
%endif
%config(noreplace) %{_sysconfdir}/cyberjack.conf
%changelog