File pcsc-lite.spec of Package pcsc-lite

#
# spec file for package pcsc-lite (Version 1.4.102)
#
# 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-lite
# FIXME: Maybe we should use /usr/lib/pcsc/drivers as others do:
%define ifddir %{_libdir}/readers
BuildRequires:  hal-devel pkg-config readline-devel
# For directory ownership:
BuildRequires:  udev
Version:        1.4.102
Release:        1.<RELEASE249>
PreReq:         %{insserv_prereq} %{fillup_prereq}
# For upgrade from <= SLES9:
PreReq:         coreutils
Group:          Productivity/Security
License:        BSD 3-Clause
Url:            http://pcsclite.alioth.debian.org/
Summary:        PCS Smart Cards Library
Source:         %{name}-%{version}.tar.bz2
Source1:        pcscd.init
Source2:        README.SUSE
Source3:        pre_checkin.sh
Patch:          pcsc-lite-musclecard.patch
Patch2:         pcsc-lite-CVE-2010-0407.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The purpose of PCSC Lite is to provide a Windows(R) SCard interface in
a very small form factor for communication with smart cards and
readers. PCSC Lite can be compiled directly for a desired reader driver
or can be used to dynamically allocate/deallocate reader drivers at
runtime (the default behavior).

PCSC Lite uses the same winscard API as used in Windows(R).

Security aware people should read the SECURITY file for possible
vulnerabilities of pcsclite and how to fix them. For information on how
to install drivers please read the DRIVERS file.

Memory cards will be supported through the MCT specification, which is
an APDU like manner sent normally through the SCardTransmit() function.
This functionality is exercised in the driver.



Authors:
--------
    David Corcoran <corcoran@linuxnet.com>
    Ludovic Rousseau <ludovic.rousseau@free.fr>
    Damien Sauveron <sauveron@labri.fr>
    Carlos Prados <cprados@yahoo.com>
    Antti Tapaninen <aet@cc.hut.fi>

%package devel
License:        BSD 3-Clause
Group:          Development/Libraries/C and C++
Summary:        Development package for the MUSCLE project SmartCards library
Requires:       %{name} = %{version} pcsc-lite glibc-devel

%description devel
This package contains the development files for pcsc-lite. It allows to
compile plugins for the pcsc-lite package.



Authors:
--------
    David Corcoran <corcoran@linuxnet.com>

%prep
%setup -q
cp -a %{S:2} .
%patch
%patch2 -p1

%build
ACLOCAL="aclocal -I m4" autoreconf -f -i
%configure\
	--docdir=%{_docdir}/%{name}\
	--enable-usbdropdir=%{ifddir}\
	--disable-static
make %{?jobs:-j%jobs}

%install
%makeinstall
touch $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf
mkdir $RPM_BUILD_ROOT%{ifddir}
# this program is noinst in the package
install src/.libs/testpcsc $RPM_BUILD_ROOT%{_sbindir}/
mkdir $RPM_BUILD_ROOT/etc/init.d
install -m 755 %{S:1} $RPM_BUILD_ROOT/etc/init.d/pcscd
ln -sf ../../etc/init.d/pcscd $RPM_BUILD_ROOT%{_sbindir}/rcpcscd
# For upgrade from <= SLES9:
touch $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/old-reader.conf
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
sed -n '/udev rules for pcscd and CCID readers/,/^\\end{verbatim}/{/{verbatim}/d;p;}' <doc/ifdhandler-3.tex >$RPM_BUILD_ROOT/etc/udev/rules.d/99-pcsc_lite.rules
mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}
cp -a AUTHORS ChangeLog ChangeLog.svn COPYING DRIVERS HELP NEWS README README.SUSE SECURITY TODO $RPM_BUILD_ROOT%{_docdir}/%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# save old reader.conf in case of upgrade from <= SLES9
if [ "$1" = "2" ]; then
    if [ ! -d etc/reader.conf.d ]; then # update from old version
	mkdir -p etc/reader.conf.d
	cp etc/reader.conf etc/reader.conf.d/old-reader.conf
    fi
fi

%preun
%{stop_on_removal pcscd}

%post
/sbin/ldconfig
%{fillup_and_insserv pcscd}

%postun
/sbin/ldconfig
%{restart_on_update pcscd}
%{insserv_cleanup}

%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{_libdir}/*.so.*
# .so must be in the main package (#235773):
%{_libdir}/*.so
%doc %{_mandir}/man?/*.*
%{_sbindir}/*
%ghost %{_sysconfdir}/reader.conf
%dir %{_sysconfdir}/reader.conf.d
%config %{_sysconfdir}/reader.conf.d/reader.conf
%ghost %config %{_sysconfdir}/reader.conf.d/old-reader.conf
%{ifddir}
/etc/init.d/pcscd
/etc/udev/rules.d/99-pcsc_lite.rules

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc

%changelog
openSUSE Build Service is sponsored by