File openct.spec of Package openct

#
# spec file for package openct (Version 0.6.15)
#
# 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:           openct
Version:        0.6.15
Release:        4
BuildRequires:  db-devel doxygen krb5-devel libusb-devel licenses openldap2-devel pcsc-lite-devel pkg-config
# NOTE: We prefer multiple RPM directory ownership here, because
# dependency on hal increases bootstrap build time.
#BuildRequires:  hal
PreReq:         %insserv_prereq %fillup_prereq
Group:          Productivity/Security
License:        BSD 3-Clause; LGPL v2.1 or later
Url:            http://www.opensc-project.org/openct/
Summary:        OpenCT Tools for Smart Card Readers
Source:         %{name}-%{version}.tar.bz2
Patch:          %{name}-hal.patch
Patch1:         %{name}-init.patch
Patch2:         %{name}-hald-addon.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       licenses
## Only for directory ownership:
#Requires:       hal
# Existed up to 10.2, maintained in SLES9:
Provides:       pcsc-etoken <= 0.3.2
Obsoletes:      pcsc-etoken <= 0.3.2
%define ifddir %(pkg-config libpcsclite --variable=usbdropdir)
%define USER	daemon
%define GROUP	daemon

%description
OpenCT is a set of library and tools to talk to smart card readers.
OpenCT is used by the OpenSC Smart Card library.

For a list of supported readers, please read documentation in
/usr/share/doc/packages/openct/wiki/index.html - some readers may be
supported only with particular firmware or particular connection type.

There are other packages that may support your reader in a different
way. Name of all these packages starts with "pcsc-".



Authors:
--------
    Olaf Kirch <okir@suse.de>
    Andreas Jellinghaus <aj@dungeon.inka.de>

%package -n libopenct1
License:        BSD 3-Clause; LGPL v2.1 or later
Group:          System/Libraries
Summary:        OpenCT Library for Smart Card Readers

%description -n libopenct1
OpenCT is a set of library and tools to talk to smart card readers.
OpenCT is used by the OpenSC Smart Card library.

For a list of supported readers, please read documentation in
/usr/share/doc/packages/openct/wiki/index.html - some readers may be
supported only with particular firmware or particular connection type.

There are other packages that may support your reader in a different
way. Name of all these packages starts with "pcsc-".



Authors:
--------
    Olaf Kirch <okir@suse.de>
    Andreas Jellinghaus <aj@dungeon.inka.de>

%package -n pcsc-openct
License:        BSD 3-Clause; LGPL v2.1 or later
Group:          Productivity/Security
Summary:        PC/SC IFD Handler for OpenCT Smart Card Drivers

%description -n pcsc-openct
PC/SC Connector for OpenCT. It allows to use any of OpenCT Smart Card
drivers with the PCSC-Lite daemon from the pcsc-lite package.

OpenCT is a set of library and tools to talk to smart card readers.
OpenCT is used by the OpenSC Smart Card library.

For a list of supported readers, please read documentation in
/usr/share/doc/packages/openct/wiki/index.html - some readers may be
supported only with particular firmware or particular connection type.

There are other packages that may support your reader in a different
way. Name of all these packages starts with "pcsc-".



Authors:
--------
    Olaf Kirch <okir@suse.de>
    Andreas Jellinghaus <aj@dungeon.inka.de>

%package devel
License:        BSD 3-Clause; LGPL v2.1 or later
Group:          Development/Libraries/C and C++
Summary:        OpenCT Library for Smart Card Readers
Requires:       libopenct1 = %{version} glibc-devel

%description devel
OpenCT is a set of library and tools to talk to smart card readers.
OpenCT is used by the OpenSC Smart Card library.

For a list of supported readers, please read documentation in
/usr/share/doc/packages/openct/wiki/index.html - some readers may be
supported only with particular firmware or particular connection type.

There are other packages that may support your reader in a different
way. Name of all these packages starts with "pcsc-".



Authors:
--------
    Olaf Kirch <okir@suse.de>
    Andreas Jellinghaus <aj@dungeon.inka.de>

%prep
%setup -q -n %{name}-%{version}
%if %suse_version > 1030
# Patch and sed script converts fdi file to the new hal syntax:
%patch
sed -i 's/key="usb\./key="usb_device./g' etc/openct.fdi
%endif
%patch1
%patch2
sed -i 's/@USER@/%{USER}/g;s/@GROUP@/%{GROUP}/g' etc/openct.hald.in etc/init-script.in

%build
ACLOCAL="aclocal -I m4" autoreconf -f -i
%configure\
	--docdir=%{_docdir}/%{name}\
	--disable-static\
	--enable-doc\
	--enable-api-doc\
	--enable-usb\
	--enable-pcsc\
	--enable-non-privileged\
	--with-daemon-user=%{USER}\
	--with-daemon-groups=%{GROUP}\
	--with-bundle=%{ifddir}\
	--with-ifddir=%{ifddir}
# FIXME: Fix PCMCIA and serial readers hotplug.
# udev scripts are outdated, HAL rules don't exist yet:
# --with-udev=%{_sysconfdir}/udev/rules.d\
make %{?jobs:-j%jobs}

%install
%makeinstall
#
# HAL stuff
mkdir -p $RPM_BUILD_ROOT%{_datadir}/hal/fdi/information/10freedesktop
cp etc/openct.fdi $RPM_BUILD_ROOT%{_datadir}/hal/fdi/information/10freedesktop/10-usb-openct.fdi
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/hal
install etc/openct.hald $RPM_BUILD_ROOT%{_libexecdir}/hal/hald-addon-openct
#
# Create directory
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/openct
# NOTE: Example in the source recommends 750, but this value allows
# access only to dedicated users and root.
chmod 0755 $RPM_BUILD_ROOT%{_localstatedir}/run/openct
#
# Install init script
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
install etc/init-script $RPM_BUILD_ROOT%{_sysconfdir}/init.d/openct
ln -s ../..%{_sysconfdir}/init.d/openct $RPM_BUILD_ROOT%{_sbindir}/rcopenct
#
# Copy the rest of documentation
cp LGPL-2.1 TODO doc/nonpersistent/ChangeLog $RPM_BUILD_ROOT%{_docdir}/%{name}
# And remove pointless .la file
rm $RPM_BUILD_ROOT%{_libdir}/libopenct.la

%preun
%{stop_on_removal openct}

%post
%{fillup_and_insserv openct}
chown %{USER}:%{GROUP} %{_localstatedir}/run/openct
chmod 0755 %{_localstatedir}/run/openct

%postun
%{restart_on_update openct}
%{insserv_cleanup}

%post -n libopenct1 -p /sbin/ldconfig

%postun -n libopenct1 -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/ChangeLog
%doc %{_docdir}/%{name}/LGPL-2.1
%doc %{_docdir}/%{name}/NEWS
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/TODO
%doc %{_docdir}/%{name}/wiki
%{_bindir}/*
%{_datadir}/hal/fdi/information/10freedesktop/10-usb-openct.fdi
%dir %attr(-,%{USER},%{GROUP}) %{_localstatedir}/run/openct
%{_libexecdir}/hal/hald-addon-*
%doc %{_mandir}/man?/*.*
%{_sbindir}/*
%{_sysconfdir}/init.d/openct
%config(noreplace) %{_sysconfdir}/openct.conf
# NOTE: These directories logically belong to hal.
# To prevent dependency on hal, add it to the file list.
%dir %{_datadir}/hal
%dir %{_datadir}/hal/fdi
%dir %{_datadir}/hal/fdi/information
%dir %{_datadir}/hal/fdi/information/10freedesktop
%dir %{_libexecdir}/hal

%files -n libopenct1
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n pcsc-openct
%defattr(-,root,root)
%{ifddir}/openct-ifd.bundle

%files devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}/api
%{_includedir}/openct
%{_libdir}/*.so
%{_libdir}/*.*a
%{_libdir}/pkgconfig/libopenct.pc

%changelog
* Thu Oct 30 2008 sbrabec@suse.cz
- Fixed HAL FDI files and hald-addon scripts (bnc#304149).
- Fixed permissions in hald-addon script and /var/run.
- Build a pcsc-openct package.
- "rcopenct stop" does not fail if there is nothing to stop
  (bnc#303829).
* Tue Sep 09 2008 sbrabec@suse.cz
- Updated to version 0.6.15:
  * Build system rewritten.
  * Non privileged configuration added.
  * /etc/openct.conf ifdhandler was modified, please review sample
  before upgrade.
  * Basic coldplug support on Linux is available without libusb
  dependency.
  * CCID-1.10 is now supported.
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Thu Apr 03 2008 sbrabec@suse.cz
- Updated to version 0.6.14:
  * further fixes to udev script
* Tue Apr 01 2008 sbrabec@suse.cz
- FDI rule adapted to new HAL (bnc#372557).
  Patch from Felix Möller.
* Wed Sep 12 2007 sbrabec@suse.cz
- Make hald-addon-openct script executable (#304149).
* Mon Sep 10 2007 sbrabec@suse.cz
- Provide and obsolete pcsc-etoken (#284583).
* Fri Aug 24 2007 sbrabec@suse.cz
- Updated to version 0.6.13 (#304149):
  * hotplugging works correctly
- Fixed sub-package dependencies (#299307).
- Do not hard-depend on syslog for the init script (#299299).
* Wed Jul 25 2007 sbrabec@suse.cz
- Updated to version 0.6.12:
  * add alternative udev rules based on MODALIAS.
  * update wiki export (fix links, add images).
  * make lots of functions static.
  * rename variables clashing with function names such as index.
  * add small delays to smph driver.
  * fix pcsclite compile issue.
  * add ccid as fallback driver if no other is found.
  * add more drivers to etc/ files, get them in sync.
  * fix lots of warnings/issues.
  * add patch for contactless reader support (librfid).
  * add set_params to pcmcia and pcmcia-block code to get
  cm4000/cm4040 drivers to work again.
- Split package according to shared library packaging policy.
* Mon Apr 23 2007 sbrabec@suse.cz
- Updated to version 0.6.11:
  * add usb reset for non-linux too (dummy code only).
  * fix three small bugs/warnings
  * fix etc/Makefile installation
  * bsd compile fixed
  * include string.h in utils.c
  * fix 'BUS="pcmcia"' match in udev rules file.
  * improve egate reset logic
  * implement usb reset
* Mon Oct 23 2006 mjancar@suse.cz
- make /etc/init.d/openct executable (#212507)
- add syslog to Requires (#214298)
* Wed Oct 04 2006 sbrabec@suse.cz
- Do not depend on hal and use multiple ownership of hal
  directories to save bootstrap build time.
* Tue Oct 03 2006 sbrabec@suse.cz
- Updated to version 0.6.9:
  * more work on wbeiuu driver.
  * small delays in egate initialisation for new sealed egate
  token.
  * fix openct.conf for wbeeui driver.
  * move scripts used by udev to /lib/udev/ by default.
  * udev scripts for usb, pcmcia_block and serial readers.
  * add several usb ids to ccid driver config.
  * cleanup the parameters to ifdhandler and openct-control attach.
  * new driver for WB Electronics' Infinity USB Unlimited.
  * new pertosmart ac1038 driver by Carlos Henrique Bauer.
  * new smartkey driver.
  * improved T=1 implementation.
  * improved eutron driver.
  * OPENCT_SOCKETDIR environment can point to any dir for the
  sockets so users can use it without being root.
  * sample reader.conf included for pcsc-lite.
  * add phoenix/smartmouse driver.
  * License is now officialy LGPL.
  Libopenct is still 100%% BSD, in case you want to use it.
  * Siemens B1 driver improved by Lorenz Knauer.
  * bug fixes.
* Fri Jun 16 2006 schwab@suse.de
- Fix syntax error in configure script.
* Fri Mar 24 2006 anicka@suse.cz
- fix uninitialised variable [#159683]
* Mon Feb 06 2006 mjancar@suse.cz
- fix array overflow (#145804)
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Fri Jan 20 2006 ro@suse.de
- remove hal from needeforbuild
- add directories to filelist instead
* Wed Jan 11 2006 mjancar@suse.cz
- update to 0.6.6
* Thu Dec 22 2005 kukuk@suse.de
- Add PreReq.
* Tue Nov 08 2005 dmueller@suse.de
- don't build as root
* Fri Aug 26 2005 okir@suse.de
- added hal to neededforbuild, so that autobuild stops complaining
  about /usr/share/hal/* directories not being owned by any package.
  This comment is fifty times the size of the change itself :-)
* Thu Aug 25 2005 okir@suse.de
- Converted hotplug support to HAL (#105276)
* Thu Jul 14 2005 okir@suse.de
- Updated to latest upstream version
* Thu Jan 27 2005 okir@suse.de
- Make the init script provide "openct" (#48840)
* Fri Jan 21 2005 okir@suse.de
- Updated to latest released version (0.6.2)
* Thu Nov 18 2004 ro@suse.de
- use kerberos-devel-packages
* Fri Aug 06 2004 okir@suse.de
- get rid of 64bit warnings
* Thu Aug 05 2004 okir@suse.de
- Updated to latest upstream version (0.5.0)
* Mon Sep 22 2003 okir@suse.de
- Packaged directory /var/run/openct (#31330)
* Wed Sep 10 2003 okir@suse.de
- Made init script LSB compliant
* Sat Aug 02 2003 aj@suse.de
- Make 64-bit clean.
* Thu Jul 31 2003 okir@suse.de
- Initial packaging
openSUSE Build Service is sponsored by