# # spec file for package pcsc-lite # # Copyright (c) 2011 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: pkg-config readline-devel %if %suse_version >= 1120 #shouldn't be found automagically ? BuildRequires: libudev-devel %endif %if %suse_version == 1110 BuildRequires: libusb-1_0-devel %endif %if %suse_version < 1110 BuildRequires: hal-devel %endif Version: 1.7.4 Release: 1 Requires(pre): pwdutils Requires(post): %insserv_prereq %fillup_prereq Group: Productivity/Security License: BSD3c(or similar) Url: http://pcsclite.alioth.debian.org/ Summary: PCSC Smart Cards Library Source: %{name}-%{version}.tar.bz2 Source1: %{name}.sysconfig Source2: README.SUSE Source3: pre_checkin.sh Source4: baselibs.conf Source5: pcsc-lite-init Source6: pcsc-lite-reader-conf #Is not really used just keep in case off Patch0: disable-power-off.diff %if %suse_version > 1130 PreReq: sysvinit(syslog) %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build %define USER scard %define GROUP scard %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. %package -n libpcsclite1 License: BSD3c(or similar) Group: System/Libraries Summary: PCSC Smart Card Library Recommends: pcsc-lite >= %{version} %description -n libpcsclite1 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. %package devel License: BSD3c(or similar) Group: Development/Libraries/C and C++ Summary: Development package for the MUSCLE project SmartCards library Requires: %{name} = %{version}-%{release} Requires: libpcsclite1 = %{version}-%{release} %description devel This package contains the development files for pcsc-lite. It allows to compile plugins for the pcsc-lite package. %prep %setup -q # do not disable power off but keep it if it causes issues #%patch0 cp -a %{S:1} %{S:2} %{S:5} %{S:6} . %build %if %suse_version > 1110 ACLOCAL="aclocal -I m4" autoreconf -f -i %endif %configure\ --docdir=%{_docdir}/%{name}\ --enable-usbdropdir=%{ifddir}\ %if %suse_version >= 1110 --disable-libhal \ %endif %if %suse_version == 1110 --disable-libudev \ %endif --disable-static make %{?jobs:-j%jobs} %install %makeinstall mkdir -p $RPM_BUILD_ROOT%{ifddir} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/ sed s:@ifddir@:%{ifddir}: $RPM_BUILD_ROOT%{_sysconfdir}/reader.conf.d/reader.conf # this program is noinst in the package #install src/.libs/testpcsc $RPM_BUILD_ROOT%{_sbindir}/ install -D -m 755 pcsc-lite-init $RPM_BUILD_ROOT%{_initrddir}/pcscd ln -sf %{_initrddir}/pcscd $RPM_BUILD_ROOT%{_sbindir}/rcpcscd mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates cp %{name}.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pcscd mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name} cp -a AUTHORS ChangeLog ChangeLog.svn COPYING DRIVERS HELP README README.SUSE SECURITY TODO $RPM_BUILD_ROOT%{_docdir}/%{name} %clean rm -rf $RPM_BUILD_ROOT %pre getent group %{GROUP} >/dev/null || groupadd -r -o %{GROUP} getent passwd %{USER} >/dev/null || useradd -r -o -g %{GROUP} -s /bin/nologin -c "Smart Card Reader" -d /var/run/pcscd %{USER} exit 0 %post %fillup_and_insserv -y -n pcscd pcscd %restart_on_update pcscd %preun %stop_on_removal pcscd %postun %insserv_cleanup %post -n libpcsclite1 -p /sbin/ldconfig %postun -n libpcsclite1 -p /sbin/ldconfig %files %defattr(-,root,root) %doc %{_docdir}/%{name} %doc %{_mandir}/man?/*.* %{_sbindir}/* %dir %{_sysconfdir}/reader.conf.d %config(noreplace) %{_sysconfdir}/reader.conf.d/reader.conf %{ifddir} %{_initrddir}/pcscd /var/adm/fillup-templates/sysconfig.pcscd %files -n libpcsclite1 %defattr(-,root,root) %{_libdir}/libpcsclite.so.* %files devel %defattr(-,root,root) %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.*a %{_libdir}/pkgconfig/*.pc %changelog